API Reference
Web3Analyitcs.init
Web3Analytics must be initialized with appKey
by invoking the init method at the top level of the application before using other methods.
Usage
Argument | Type | Description |
---|---|---|
appKey | String | Unique appKey like |
Optional | ||
debug | Boolean | Defaults to |
dataPoints | string[] | By default, SDK will track all data points. But you can limit them by passing the desired datapoints. |
inactivityTimeout | number | Defaults to |
optOut | Boolean | Defaults to |
testENV | Boolean | Defaults to |
testMode | Boolean | Defaults to |
Web3Analytics.walletProvider
Pass web3 provider
to track wallet connections and transaction status that are submitted or rejected on the dApp.
Wallets that are not included in Supporting Wallets will be classified as Other
wallet type.
Usage
In case of handling multiple wallets on the dApp. Example in React
.
Argument | Type | Description |
---|---|---|
provider | Web3Provider | EIP-1193 Standard Provider or Web3Provider-compatible Provider |
Web3Analytics.trackWalletConnection
To track the wallet type for wallets that are not part of Supporting Wallets. Usage
Argument | Type | Description |
---|---|---|
walletType | String | Name of wallet |
account | String | User Ethereum address |
chainId | number | User connected chainId |
Web3Analytics.trackPageView
Track all the pages visited on a DApp.
Usage
Argument | Type | Description |
---|---|---|
path | String | Path of the page. e.g. '/about', '/dashboard/stats' |
search | String | Query string of the page. eg: '?id=ab02' |
Web3Analytics.optOutTracking
Opt user out from tracking.
Usage
Argument | Type | Description |
---|---|---|
expiration | number | Default |
Web3Analytics.optInTracking
Opt user in tracking.
Usage
Argument | Type | Description |
---|---|---|
expiration | number | Default |
Web3Analytics.hasOptedOutTracking
Getter method for the status of user tracking consent.
Usage
Argument | Return Type | Description |
---|---|---|
- | number | Status of user tracking consent |
Web3Analytics.widgetOnClick
For the custom on-click implementation of widget button.
Usage
Params | Type | Description |
---|---|---|
campaignId | number | A unique campaign ID belongs to the widget. |
redirectUrl | string | undefined | Redirect URL set on the campaign button click. |
Last updated