Skip to main content

Disable Automatic Tracking

React Provider

You can disable any automatic tracking feature you want by passing an optional config prop to the React provider (ArcxAnalyticsProvider).

Note that not all automatically tracked events can be disabled. See the React column in the Configuration Options section for which can be disabled.

<ArcxAnalyticsProvider
apiKey="API_KEY"
config={{
trackPages: false,
}}
>
<App />
</ArcxAnalyticsProvider>

.init() method

You can disable any automatic tracking feature you want by passing an optional config parameter to the init function during the SDK setup via either the NPM package or the Script Tag.

The configuration options are passed into the config argument of the ArcxAnalyticsSdk function.

All of the configuration options are described in the Configuration section below.

NPM Package

import { ArcxAnalyticsSdk } from '@0xarc-io/analytics'

const sdk = await ArcxAnalyticsSdk.init('YOUR_API_KEY', {
cacheIdentity: true,
trackPages: false,
trackWalletConnections: false,
trackChainChanges: false,
trackTransactions: false,
trackSigning: false,
trackClicks: false,
})

Script Tag

If you're using the Script Tag, you can disable any automatic tracking feature you want by passing an optional config parameter to the init function during the Script Tag Setup.

<script>
const script = document.createElement('script')
const apiKey = 'YOUR_API_KEY'

// Add any configuration parameters you'd like here
const config = {
cacheIdentity: true,
trackPages: false,
trackWalletConnections: false,
trackChainChanges: false,
trackTransactions: false,
trackSigning: false,
trackClicks: false,
}

script.src = '<https://unpkg.com/@0xarc-io/analytics>'
script.onload = function () {
ArcxAnalyticsSdk.init(apiKey, config, 'script-tag').then(function (sdk) {
window.arcx = sdk
})
}

document.head.appendChild(script)
</script>

Configuration Options

Config keyTypeDescriptionDefaultReact Provider.init() Method
cacheIdentitybooleanCaches the identity of users in the browser's local storage to capture cross-session behaviourstrue
trackPagesbooleanTracks whenever there is a URL change during the session and logs it automatically.true
trackClicksbooleanAutomatically track click events of any element on the pagetrue
trackWalletConnectionsbooleanAutomatically track wallet connections (Metamask only)true
trackChainChangesbooleanAutomatically track chain ID changes (Metamask only)true
trackTransactionsbooleanAutomatically track transaction requests (Metamask only)true
trackSigningbooleanAutomatically track signing requests (Metamask only)true