Tracking and attribution
How does dynamic number insertion (DNI) work?
You add a small JavaScript snippet to your website; it detects where each visitor came from and replaces the phone number on the page with the tracking number for that source.
Details
- The snippet reads the referrer, UTM parameters and click IDs (gclid, fbclid, msclkid) when a visitor lands on your site.
- Each pool has one shared number. Visitors who have not given tracking consent, and visitors who arrive when every other number in the pool is taken, see the shared number of their source, so every visitor from Google Ads sees the Google Ads number, every visitor from Facebook the Facebook number, and so on. Calls to a shared number are counted per source, not per visit.
- With tracking consent, each visitor gets their own number from the pool for the length of their session, so a call can be tied to that visit's landing page, campaign and click ID. A pool with a single number works as one number per source.
- Consent: by default the snippet waits for consent when your business is in the EU/EEA, the UK or Switzerland. If your business country is not set, it decides per visitor from the visitor's time zone: visitors in those regions, and visitors whose region is unknown, are asked first. Set the country or change the mode under Settings → Workspace. Before consent it stores nothing on the visitor's device. It reads Google Consent Mode (analytics_storage), IAB TCF v2.2, GetCookies, Cookiebot, OneTrust and CookieYes; with another consent tool, call CallTracker.consent(true) or CallTracker.consent(false). After consent it stores a visitor ID in localStorage and session data in sessionStorage; when consent is withdrawn it deletes both and ends the visitor's session.
- Number pools are filled with US numbers today. Outside the US and Canada, give each campaign landing page its own fixed tracking number instead; the snippet is not needed for that.
- When the call comes in, CallTracker stores the attribution on the call and can report it as a conversion to Google Analytics 4 or Meta, and to Google Ads once Google approves CallTracker's API access.
- The snippet is 3.2 KB on the wire with Brotli compression (10.5 KB uncompressed), measured on 27 October 2026 alongside six other vendors' scripts. A fix on 28 October 2026 added about 0.2 KB compressed, and the consent gate added on 23 November 2026 about 1.5 KB compressed.
Related pages
More about tracking and attribution
- How do I see which ads bring paying customers, not just calls?
- Can I stop counting spam, wrong numbers and existing customers as conversions?
- Why does Google Ads show more (or fewer) calls than my call tracking?
- Can I see the click ID and the caller's number for each call?
- How do I find good leads we lost to missed calls?
- Will a call tracking number hurt my Google Business Profile or local rankings?
- How do I track calls from billboards, flyers and print ads?
Still have a question?
Email [email protected], or create an account and put a tracking number on your own ads.