On this page
What this issue is
Dynamic number insertion (DNI) is a feature of call tracking tools. A small JavaScript snippet looks for your phone number on the page and swaps it for a tracking number linked to the visitor's source, such as a Google Ads click, an organic visit or a Meta ad. When the visitor calls, the tool knows where they came from.
- Ad clickVisitor lands with gclid or UTMs
- Call tracking scriptScript blocked, late or not installed
- Number swapDefault number stays on the page
- Phone callCall has no source
- ReportingAds show no phone leads
The visitor sees the default number, so the call cannot be matched to the ad.
Why it costs you leads or sales
Example: 100 calls a month from paid traffic. With the swap working, most are matched. With it broken, they all show as direct or unknown.
How to check if your site has it
Note your default number
Open the page in a private window with no tracking parameters. Write down the number shown in the header, footer and any buttons.
Visit with a tagged URL
Add the parameters your tool uses for a paid source, for example
?utm_source=google&utm_medium=cpc&gclid=test123. Check your call tracking tool's docs for which sources it swaps for.Compare every number
Check the visible text and the link target. On mobile, tap the number and see which number the dialler opens. Inspect the element and read the
href.Check the console and network tab
In browser developer tools, look for errors from the call tracking script and confirm the script file loads with a 200 status.
Repeat on key pages and devices
Test the landing pages, the contact page, pages with popups or sticky call buttons, and a mobile browser.
Place a test call
Call the swapped number and check that the call appears in your call tracking dashboard with the right source.
| What you see | Likely cause |
|---|---|
| Default number never changes | Script not installed, blocked by consent, or loaded on the wrong pages |
| Number changes after a flash | Script loads late or is deferred below the content |
| Text changes, tap-to-call does not | The tel: link is not covered by the swap rules |
| Number in a header works, button does not | Selector or format does not match that element |
| Works on some pages only | Script missing from a template or the number is formatted differently |
| Works on desktop, not in the app browser | Cookies or script restricted in in-app browsers |
How to fix it
Confirm the script is on every page
Install the snippet from your call tracking tool site-wide, ideally in the head or through Google Tag Manager. Remove duplicates, as two copies can fight each other.
Match the number exactly
Most tools look for the default number you set up. Make sure the number on the page uses the same digits and format. Numbers split across spans, written as images or built by JavaScript often do not match.
Cover the tel: links
Make sure the
href="tel:..."value matches the default number too, so the tap-to-call target is swapped along with the text.Check consent rules
If your cookie banner blocks the call tracking script until consent, visitors who decline see the default number. Decide with your legal adviser how the tool should behave, and set up the tag trigger to match.
Check pool size and active sessions
If your pool has too few numbers for your traffic, the tool may fall back to the default number. Increase the pool in the tool's settings.
Re-test and place a call
Repeat the manual test and confirm the call appears with its source.
Add the snippet site-wide
Use a header and footer scripts plugin or your theme's header settings to paste the call tracking snippet. Clear any caching or optimisation plugin, and exclude the script from deferral or combining if the number flashes or does not swap.
Check page builders
If numbers are inside a builder widget that renders later, confirm the swap still runs on them.
Add to theme.liquid
In Online Store > Themes > Edit code, paste the snippet in
theme.liquidbefore</head>. Make sure the number in the header, footer and any sections matches the default number.
Create a Custom HTML tag
Paste the call tracking snippet into a Custom HTML tag and fire it on All Pages, or on the consent condition you have agreed.
Preview
Use Preview mode to confirm the tag fires before the visitor can interact with the number.
Add to project custom code
Open Project Settings > Custom Code and paste the snippet in the Head code box. Publish the site, as the script does not run in the designer.
Add a custom code snippet
Go to Settings > Custom Code, add the snippet to All pages and place it in the Head. Custom code needs a premium plan with a connected domain.
Use code injection
Add the snippet under Settings > Advanced > Code Injection > Header. Code injection needs a plan that supports it.
Add tracking code to the funnel or site
Paste the snippet in the Tracking Code (Head) section of the funnel or website settings, and check each page uses it. Confirm the number on the page matches the default number.
Load the script in the head
Add the snippet to your base template so every page has it. Keep the number as plain text in the HTML, not built after load.
<a href="tel:+442071234567">020 7123 4567</a>The call tracking tag does not fire, so the default number stays.
How to confirm it's fixed
- A tagged paid URL shows a tracking number in the text and the tel: link
- A direct visit shows the number you expect for that source
- The number appears on first view without a long flash of the old number
- A test call shows in the call tracking dashboard with the right source
- The swap works on mobile, desktop and the pages you send ads to
- Declining cookies behaves as you decided
How to prevent it happening again
- Re-run the tagged-URL test after theme, plugin, consent banner or tag manager changes
- Keep the default number in one place and update it in the call tracking tool whenever it changes
- Do not rebuild the header or footer without checking the number still matches
- Review pool size when ad spend or traffic grows
- Add the test to your launch checklist for every new landing page
- Check your call tracking tool's reports for a sudden drop in tracked calls
How FunnelGuard handles this
Questions people ask
Why is my call tracking number not changing on my website?
The most common causes are a missing or blocked script, a number on the page that does not match the default number set in the tool, and a consent banner that stops the script running. Test with a tagged URL and check the browser console for script errors.
What is dynamic number insertion (DNI)?
Dynamic number insertion is a call tracking feature that uses JavaScript to replace the phone number on your page with a tracking number linked to the visitor's source. When someone calls, the tool can tell which campaign or channel brought them.
Why does the tracking number show in the text but not the tap-to-call link?
The swap rules may only cover visible text and not the tel: link, or the link uses a different number format. Make sure the href value matches your default number so the tool can replace it.
Does a cookie banner stop call tracking number swaps?
It can. If the call tracking script is set to wait for consent, visitors who decline or have not answered will see your default number. Decide how the tool should behave for those visitors and configure the tag to match.
How do I test call tracking number swapping?
Open your page in a private window with a tagged URL, such as one with utm_source and gclid, then check the number in the text and the tel: link. Place a test call and confirm it appears in your call tracking dashboard with the right source.
Why does the old number flash before the tracking number appears?
The script loads after the page content, often because of deferral, caching or optimisation plugins. Load the script earlier, in the head, and exclude it from delay or combine settings.
Can FunnelGuard check my call tracking number swap?
Not yet. FunnelGuard does not check call tracking number swaps, though it is a possible future check. It does run your lead form, checkout and button journeys on a schedule and checks the tracking hits sent to ad and analytics platforms.