On this page
What this issue is
Call tracking tools such as CallRail show each visitor a different phone number depending on their source. A small script runs in the browser, finds your phone number in the page and replaces it with a tracking number from a pool. This is called dynamic number insertion, or DNI.
The problem here is that the swap does not happen for ad traffic. The visitor sees your normal "default" number. They may still call, but the call is logged as direct or unknown, so you cannot see which campaign produced it.
- Ad clickVisitor lands with gclid or UTMs
- Page loadsCall tracking script should run
- Number swapDefault number stays on the page
- Call madeDialled on the default number
- AttributionCall not linked to the ad
The visitor arrives from an ad, but the script never replaces the number, so the call is not tied to the campaign.
Why it costs you leads or sales
The calls still arrive, so this issue is easy to miss. The cost is in the data. Without a source on each call, you cannot tell which keywords or campaigns drive phone leads. Call conversions are not sent back to Google Ads, so bidding learns only from form fills and under-values campaigns that produce calls.
You may then cut budget from campaigns that are actually working, or keep funding ones that are not. If your reports show calls as direct, this is a likely cause.
Example: share of ad-driven calls that show a campaign source before and after fixing the swap. Numbers are illustrative.
How to check if your site has it
Test it as an ad visitor would. Use a private browser window with extensions off, so cookies and blockers do not interfere.
Build a tagged URL
Add the parameters your tool uses to your landing page URL, for example ?utm_source=google&utm_medium=cpc&utm_campaign=test. For Google Ads sources, many tools also look for gclid, which only real ad clicks carry. Check your tool's source rules.
Open it in a private window
Load the page and look at every place your number appears: header, footer, hero, buttons and contact page.
Compare with the default number
If the number matches the one you normally publish, it did not swap. A swapped number should be one from your tracking pool.
Inspect the page
Right-click the number, choose Inspect, and see whether it is plain text, an image, or a link. Then open the Network tab and look for the call tracking script request. A blocked or failed request means the script is the problem.
Check the tool's own log
Most call tracking tools show recent sessions and the number assigned to each. If your test visit is missing, the script did not run.
How to fix it
These are the usual causes. Work through them in order.
| Cause | What you see | Fix |
|---|---|---|
| Script missing or blocked | No tracking script request in the Network tab | Install the snippet in the site-wide header, or fix the tag in your tag manager |
| Number on page does not match | Script loads but number stays the same | Make the published number match the default number set in the tool, exactly |
| Number is an image or inside a widget | Number looks right but cannot be selected as text | Use real text or a tel: link |
| Source rules do not match ad URLs | Organic visits swap, ad visits do not | Align the tool's source rules with your UTMs and gclid |
| Redirect strips parameters | URL in the browser has no UTMs | Keep the query string through redirects |
| Consent banner blocks the script | Swap works only after accepting cookies | Review the tool's consent settings with your legal advice |
| Number pool exhausted | Swap fails at busy times | Add more numbers to the pool |
Add the snippet site-wide
Use your theme's header scripts option or a header and footer plugin to paste the snippet from your call tracking tool. Avoid adding it to one page only.
Clear caches
Purge your caching plugin and CDN, then retest. Some optimisation plugins delay or combine scripts, so exclude the call tracking script if the swap runs late or not at all.
Create a Custom HTML tag
Paste the snippet from your call tracking tool, or use a template if your tool provides one.
Trigger on All Pages
Use the All Pages trigger so the swap runs on every landing page, including those without a form.
Preview and publish
Use Preview mode with your tagged URL to confirm the tag fires, then publish the container.
Add to the theme
In Online Store > Themes > Edit code, open theme.liquid and paste the snippet before the closing head tag.
Check the number format
Make sure your phone number appears as plain text in the theme, not inside an image or a section that loads late.
Use custom code
In Project settings > Custom code, paste the snippet in the Head code box and publish the site.
Use text, not an image
Put the number in a text element or a link block so the script can find it.
Add a custom code snippet
In Settings > Advanced > Custom code, add the snippet to the head and apply it to all pages. Custom code needs a Premium plan.
Use code injection
In Settings > Developer Tools > Code Injection (the name may vary by version), paste the snippet in the Header box. This needs a plan that allows code injection.
Add tracking code to the funnel or site
In your funnel or website settings, paste the snippet in the Head tracking code area. Do this for every funnel and page set, as it is set per funnel.
Place the snippet in the shared head
Add it to your base template so every page includes it, and load it early so the number is replaced quickly.
Match the number
Make sure the number in the HTML is exactly the default number the tool searches for.
Match the default number
In your call tracking tool, check the number it is set to replace. Compare it character by character with the one on the page, including spaces, dashes and country code. Many tools match formatted variants but not all.
Use text and tel: links
Make sure phone numbers are real text. For click-to-call, use a link like the example below so the number inside and the href both get swapped.
Check the source rules
Open the pool or tracker settings for paid search. Confirm it is set to match Google Ads traffic by gclid or UTM medium, and that your ad final URLs use the same values.
Keep parameters through redirects
If your ad URL redirects, test that the final URL still includes the query string. Remove or fix redirects that drop it.
Add numbers if the pool is small
If many visitors are on the site at once, a small pool may run out. Add numbers according to your tool's guidance.
<a href="tel:+15551234567">(555) 123-4567</a>How to confirm it's fixed
- A tagged URL in a private window shows a tracking number, not the default one, in every place the number appears
- The click-to-call link uses the swapped number in its tel: value
- The call tracking script request succeeds in the Network tab
- Your test visit appears in the tool's session log with the right source
- Placing a test call to the swapped number connects and is logged with the campaign source
- The default number still shows for visitors with no matching source
- Checks pass on mobile and desktop and on several landing pages
How to prevent it happening again
- Retest the swap after theme changes, new landing pages, redesigns or a switch of page builder
- Keep one default number and update the tool whenever the published number changes
- Exclude the call tracking script from script delay and minify settings if it breaks
- Test every new ad final URL once before launch
- Review call sources monthly and look for a rise in direct or unknown calls
- Document where the snippet lives so it is not removed in a cleanup
Week 1
A new landing page is published without the call tracking snippet.
Week 2
Calls arrive but show as direct in reports.
Week 4
Phone leads look low per campaign, and budget is moved away.
Week 5
A tagged test finds the default number and the snippet is added.
How FunnelGuard handles this
FunnelGuard does not check dynamic number insertion today. It is a possible future check, so do not rely on FunnelGuard to tell you when the swap stops working.
What FunnelGuard does cover nearby: it runs your real journeys such as lead forms, checkouts and booking buttons on a schedule, checks each step and the tracking hits sent to ad and analytics platforms, and confirms that test leads reach your inbox and CRM. That helps with form and tag problems, but not with which phone number is shown.
To watch for this issue, repeat the manual test above after every site or ad change, and monthly otherwise. Also check your call tracking tool's reports for a rising share of calls with no source, and ask the tool whether it offers its own alerts for a missing script.
Questions people ask
Why is my call tracking number not swapping on my website?
The most common causes are a missing or blocked tracking script, a number on the page that does not match the default number set in the tool, and source rules that do not match your ad URLs. Test with a tagged URL in a private window and check the Network tab to see which one applies.
Why does the number swap for organic traffic but not for Google Ads?
The paid traffic rule in your call tracking tool probably does not match your ad URLs. Check that the tool looks for the same gclid or UTM values your ads send, and that no redirect strips the parameters before the page loads.
How do I test dynamic number insertion?
Open your landing page with UTM parameters in a private browser window and see whether the phone number changes from your default. Then check that your visit appears in the call tracking tool and place a test call to confirm it is logged with the right source.
Does dynamic number insertion work with cookie consent banners?
It can depend on how the tool and your consent setup are configured. Some tools need cookies to keep the same number for a visitor, so a declined consent may stop or limit the swap. Check your tool's consent options and get advice on your legal requirements.
Why does my phone number swap on desktop but not on mobile?
A mobile theme or builder may show the number inside an image, a menu widget or a click-to-call button that the script does not find. Inspect the number on mobile and make sure it is plain text or a tel: link.
Can a redirect stop the number from swapping?
Yes. If a redirect drops the query string, the page loads without the gclid or UTMs and the tool treats the visitor as direct. Check the final URL after redirects and keep the parameters in place.
Will FunnelGuard tell me if my call tracking number stops swapping?
Not currently. FunnelGuard does not check number swapping yet, though it is a possible future check. It does monitor forms, tracking hits and lead delivery, so use a manual test or your call tracking tool's reports for this issue.
Related issues
- DLV-224Call tracking number (CallRail, etc.) swapped but not forwardingFix guide
- DLV-226Call tracking script missing on some pagesFix guide
- DLV-221Phone number on the site wrong or outdatedFix guide
- DLV-222Click-to-call link malformed (missing tel:, wrong country code)Fix guide
- DLV-230Call conversions not imported to Google AdsFix guide
- DLV-223Forwarding number dead or out of serviceFix guide