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
appKey
String
Optional
debug
Boolean
Defaults to false
. Enable consoles for all the tracking events.
dataPoints
string[]
By default, SDK will track all data
inactivityTimeout
number
Defaults to 30
. This field takes time in mins to specify the inactivity duration in which the session will expire.
optOut
Boolean
Defaults to false
. Opt users out of tracking.
testENV
Boolean
Defaults to false
. Enable testing version of SDK in which SDK will interact with testing servers.
testMode
Boolean
Defaults to false
. Enable test mode in which you can test tracking events without logging data onto the server in order to avoid storing testing data.
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
.
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
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
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
expiration
number
Default 365
. Duration in days for which the user is opt-out
Web3Analytics.optInTracking
Opt user in tracking.
Usage
expiration
number
Default 365
. Duration in days for which the user is opt-in
Web3Analytics.hasOptedOutTracking
Getter method for the status of user tracking consent.
Usage
-
number
Status of user tracking consent
Web3Analytics.widgetOnClick
For the custom on-click implementation of widget button.
Usage
campaignId
number
A unique campaign ID belongs to the widget.
redirectUrl
string | undefined
Redirect URL set on the campaign button click.
Last updated