Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Dynamic number insertion not swapping the phone number: fix

TRK-249High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Call tracking tools such as CallRail or CallTrackingMetrics give you a pool of phone numbers. A small JavaScript snippet on your site looks for your normal number (the swap target) in the page, then replaces it with a tracking number tied to the visitor's source, such as a Google Ads click or an organic visit. This is called dynamic number insertion, or DNI.

Why it costs you leads or sales

Calls still arrive, so nothing looks broken. But you lose the link between the call and the campaign. Reports show calls as direct or unknown, call conversions do not reach your ad platforms, and you cannot tell which keywords or ads bring phone leads. Budget then moves to the wrong places, and ad bidding learns from less data.

Where attribution is lost
  1. Ad clickVisitor lands with a source
  2. DNI scriptCannot find or replace the number
  3. Default number shownSame number for everyone
  4. Call reportsSource unknown
  5. Ad platformNo call conversion data

The swap fails, so the call cannot be tied back to the ad.

Calls with a known sourceExample numbers
Calls with a known source (example)Swap failing: 5 %; Swap working: 85 %03365585Swap failingSwap working%

Example: share of calls with a known source before and after fixing the swap. Numbers are illustrative.

How to check if your site has it

Test the swap by hand
  1. Open a private window

    Use incognito so cached numbers and cookies do not interfere. Accept cookies if a banner appears, since many call tracking scripts wait for consent.

  2. Arrive with a trackable source

    Visit your page with a test parameter, such as ?utm_source=google&utm_medium=cpc, or follow a real search link. Check your call tool's docs for which sources trigger a swap.

  3. Compare the number

    Look at the number in the header, footer, and contact page. It should differ from your default number.

  4. Inspect the script

    Open browser DevTools, then the Network tab, reload, and search for your call tracking vendor's domain. Check that the script loads with status 200. Look at the Console tab for errors.

  5. Check the page source

    Right-click the number, choose Inspect, and see whether the text matches your swap target exactly, including spaces, dashes and brackets.

How to fix it

Common causes and what to do
CauseWhat you seeFix
Script missing on some pagesSwap works on the home page onlyAdd the snippet to the site-wide header or tag
Number format mismatchScript loads, number unchangedMake the page number match the swap target exactly
Number in an image or iframeNumber never changesUse real text in the page
Consent tool blocks scriptSwap works only after acceptingReview consent category for the call tracking script
Caching or minify toolsScript delayed or removedExclude the script from optimisation
Number added later by JavaScriptSwap runs before number existsCheck vendor settings for dynamic content
Fix by platform
  1. Add the snippet site-wide

    Paste the vendor's snippet in your theme header or a header-scripts plugin so it loads on every page, not one template.

  2. Exclude it from optimisation

    In your caching or performance plugin, exclude the call tracking script from delay, defer and combine settings, then clear the cache.

  3. Use plain text numbers

    Make sure the number is text in the block or widget, not an image, and matches the swap target.

How to confirm it's fixed

Confirmation checks
  • In a private window with a test source, the page shows a different number from your default
  • The swap works on the home page, a landing page, and the contact page
  • The swap works on mobile as well as desktop
  • The vendor script loads with status 200 and the Console shows no errors
  • A test call to the swapped number appears in your call tool with the right source
  • A visit with no source still shows the right fallback number

How to prevent it happening again

Habits that keep the swap working
  • Re-test the swap after every theme change, redesign, or new landing page
  • Keep the swap target in one place and reuse it in the header, footer, and content
  • Do not change how the number is written without updating the swap target
  • Review consent and caching settings after plugin updates
  • Ask your call tracking tool to show swap status or session counts, and watch for drops
  • Test new landing pages before ads are sent to them

How FunnelGuard handles this

FunnelGuard does not check for this yet. It does not test whether your call tracking script swaps the number. A DNI check is a possible future addition.

What FunnelGuard does do is run your real customer journeys on a schedule, such as lead forms, checkouts, and booking and chat buttons, and check each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. That covers the form and click side of your funnel, not the phone number swap.

Questions people ask

Why is my call tracking number not changing on my website?

The most common causes are that the script is not loaded on that page, the number on the page does not match the swap target in your call tool, or a consent tool is blocking the script. Check the Network tab in DevTools to see if the script loads, then compare the number text to your settings.

How do I test dynamic number insertion?

Open a private browser window, accept cookies, and visit your page with a trackable source such as UTM parameters or a real ad link. The number should differ from your default. Then call it and check your call tool logs the right source.

Why does the DNI swap work on some pages but not others?

The script is probably only installed on some templates, or the number on the failing pages is written differently or sits inside an image or iframe. Add the snippet site-wide and use plain text in the same format on every page.

Can a cookie banner stop the phone number from swapping?

Yes. If the call tracking script is set to load only after consent, visitors who have not accepted will see the default number. Decide which consent category the script belongs to and test both accepted and declined states.

Does a caching or speed plugin break dynamic number insertion?

It can. Options that delay, defer, combine or minify JavaScript may postpone or break the swap script. Exclude the call tracking script from those settings, clear the cache, and retest.

Why do my calls show as unknown source?

Often the visitor saw the default number because the swap failed, so the call could not be linked to a session. Fix the swap, then test with a real call to confirm the source is recorded.

Does FunnelGuard check if my DNI number swap works?

No. FunnelGuard does not check dynamic number insertion yet; it is a possible future check. It monitors forms, checkouts, booking and chat buttons, tracking hits and lead delivery, so test the number swap by hand for now.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: dni_swap: CallRail, CallTrackingMetrics, WhatConverts, Invoca (Stage 21).

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.