Installing the tracking snippet
One snippet powers everything: web traffic reports, wallet connects, onchain attribution, and goals. You install it once per site and never touch it again.
Last updated
One snippet powers everything: web traffic reports, wallet connects, onchain attribution, and goals. You install it once per site and never touch it again.
What you'll need: a Mintfunnel account with Analytics & Attribution activated, and access to edit your site's `<head>` (directly, or through a tool like Google Tag Manager). Budget 5 to 10 minutes.
Step 1: Register your site
- Go to Analytics & Attribution > Setup & events.
- Under connected sites, click Add a domain.
- Enter your domain, for example `yourtoken.com`. You can paste a full URL and Mintfunnel will strip the protocol and path for you.
- Click Register domain.
The site appears in the table with an install status of "Not installed." That is expected until step 2.
Register each domain separately. If you have a marketing site on `yourtoken.com` and a mint flow on `mint.yourtoken.com`, both need registering, and each gets its own install code. Registering both is also what makes cross-domain journeys work: a visitor who lands on one and converts on the other is measured as one continuous funnel.
Each registered site counts as one connected data source against your plan. See Connected data sources explained.
Step 2: Install the snippet
Click Open on the site's row to see its snippet. It looks like this:
`<script async src="https://mintfunnel-cdn.com/sdk/v2/latest.js" data-token="…unique to your site…" data-api="https://app.mintfunnel.co"></script>`
The token identifies your account. You do not need an API key or any other identifier.
Option A: directly in your HTML
Paste the snippet into the `<head>` of every page you want measured. In practice that means a layout or template file so it appears site-wide. Put it in `<head>` rather than at the end of `<body>` so it is running before the visitor navigates away.
Option B: through Google Tag Manager
- In Mintfunnel, click Google Tag Manager above the snippet. The snippet changes to a GTM-safe format.
- In GTM, create a new Custom HTML tag.
- Paste the GTM version in.
- Set the trigger to All Pages.
- Click Save, then Submit, then Publish.
That last step matters. Saving in GTM does not put the tag on your site. Publishing does.
The two formats exist because GTM's Custom HTML feature silently strips some attributes from external script tags, which breaks the standard install. The GTM version behaves identically but survives that processing.
Option C: hand it to a developer
Click Send to developer on the setup page. It generates a one-click link carrying the snippet and short instructions that you can email or paste into Slack.
Step 3: Verify it is live
Visit any page on your own site, then look back at the install status in Mintfunnel. It flips from "Not installed" to Active with a green dot within about a minute.
If it stays gray for more than a few minutes, the usual causes are:
- The snippet went onto a staging or draft environment rather than the live site.
- An ad blocker in your test browser is blocking the SDK. Try a private window with extensions off.
- The hostname you tested on is not one of your registered sites.
- The snippet was pasted into GTM and saved but never published.
To check directly, open your browser's developer console on your site and type `window.mintfunnel.version`. A version string means the SDK loaded. `undefined` means the snippet never executed.
Step 4: Report wallet connects
The snippet handles pageviews, sources, and outbound clicks on its own. Wallet connects need one line, because only your site knows when a wallet actually connected.
Wherever your site connects a wallet, call this right after the wallet returns an address:
`window.mintfunnel.identify({ address: '0x...', chainId: 8453 });`
`chainId` is the numeric chain ID: 1 for Ethereum, 8453 for Base, and so on.
With wagmi, RainbowKit, or ConnectKit
Drop a small component anywhere inside your wagmi provider tree:
`import { useEffect } from 'react'; import { useAccount } from 'wagmi'; function MintfunnelIdentifier() { const { address, isConnected, chainId } = useAccount(); useEffect(() => { if (isConnected && address) { window.mintfunnel?.identify({ address, chainId: chainId ?? 8453 }); } }, [address, isConnected, chainId]); return null; }`
It fires whenever a wallet connects, switches chains, or reconnects on reload.
With Privy, Dynamic, and other auth wallets
Anywhere you can read the connected address, call `window.mintfunnel.identify({ address, chainId })`. The SDK validates the address shape internally, so passing an unexpected value is safe. It is ignored rather than recorded.
On Solana
Solana wallets connect the same way but use a base58 address and a Solana chain identifier, and onchain tracking uses watched addresses rather than EVM contracts. The rest of this guide applies unchanged.
Rotating your install token
If your token ever ends up somewhere public, such as a committed repository, click Regenerate install token on the setup page. A new token is issued and the old snippet stops working immediately, so paste the new snippet onto your site straight away.
Next
- Setting Up Tracked Events to define what counts as a conversion
- Reading your web traffic reports
