On this page
What this issue is
Dynamic number insertion (DNI) is a script from a call tracking vendor. It shows each visitor a tracking phone number based on where they came from, such as a Google Ads click or an organic visit. Calls to that number are then credited to that source.
A phone number on a page often lives in two places: the visible text (555 0100) and the link target (<a href="tel:+15550100">). This issue happens when the script updates the text but leaves the href alone. On a desktop, people read the number and dial it, so it looks fine. On a phone, people tap the link and dial the old number.
<!-- Visible text was swapped, href was not -->
<a href="tel:+15550100">+1 555 0199</a>
<!-- Text shows the tracking number (0199), tap dials the default number (0100) -->Why it costs you leads or sales
Phone calls are often your highest value leads, and most click-to-call taps happen on mobile. If the tap dials the default number, the call lands in the wrong bucket (often "direct" or "unknown"). Your reports then undercount calls from paid campaigns.
- Ad clickVisitor lands with gclid or UTMs
- Script swaps textVisible number becomes the tracking number
- href unchangedtel: link still holds the default number
- Tap to callDials the default number
- Call reportCall not tied to the campaign
The visitor sees the right number, but the tap uses the default one.
Example: 100 calls actually came from a paid campaign, 70 of them by tapping a link on mobile. With the href not swapped, only the typed calls are credited.
How to check if your site has it
Open the page with campaign parameters
Use a private window and add the parameters your vendor uses, for example your landing page URL with
?gclid=test&utm_source=google&utm_medium=cpc. Wait a few seconds for the script to run.Note the visible number
Compare it with the default number you see on the page without parameters. It should differ if the swap works.
Inspect the link
Right-click the number, choose Inspect, and read the
hrefon the<a>tag. It should start withtel:followed by the same tracking number as the text.Test on a phone
Open the page on a phone, tap the number and look at the number in the dialler before you press call. Do not place the call unless you intend to.
Check every spot
Repeat for the header, sticky call button, footer and any button or icon that links to a phone number.
document.querySelectorAll('a[href^="tel:"]').forEach(a => {
console.log(a.textContent.trim(), '->', a.getAttribute('href'));
});How to fix it
The exact fix depends on your call tracking vendor, because each script finds numbers in a different way. Most look for the default number written as text, and many only update an href when the link follows a specific pattern. Check your vendor's documentation for the swap class or attribute they support.
Match the number format exactly
Many scripts look for the default number in the exact format set in your dashboard. Make the
hrefuse the same digits, for exampletel:+15550100, and make sure the number you configured matches the one in your markup.Use your vendor's swap class or attribute
Add the class or data attribute your vendor documents to the link, so the script knows to update both the text and the href.
Keep the number as plain text in the link
Numbers split across tags, or set by CSS or an image, may be missed. Put the full number as text inside the
<a>.Handle late-loaded elements
If the link is added after page load (popup, sticky bar, tabbed content), check that your vendor supports dynamic content, or trigger its re-scan after the element appears.
Re-test with parameters
Repeat the check above on desktop and a phone.
Find the link
Check the page editor, the theme header and any builder widget (Elementor, Divi). Button and icon widgets often store the number only in the link field.
Add the swap class
Add the vendor's class in the Advanced or CSS Classes field of the button, or edit the link in the Code editor.
Clear caches
Purge page and CDN caches, and check that the script is not delayed or deferred by an optimisation plugin.
Edit the theme
Go to Online Store > Themes > Edit code. Search the header, footer and announcement bar sections for
tel:.Use text and href that match
Set both to the default number configured in your call tracking account and add the vendor's class.
Check how the script loads
Open the tag that loads the call tracking script and check its trigger. If it fires late, the swap may run before some links exist.
Re-run the swap if needed
If your vendor documents a re-scan function, call it from a Custom HTML tag triggered when new content appears.
Select the link element
In the Designer, select the Link Block or Button and check Element settings for a phone link.
Add the class or attribute
Add the vendor's class in the Selector field, or a custom attribute under Settings, then publish.
Edit the button or text element
In the funnel or website builder, open the element's link settings and confirm it uses a phone link with the default number.
Add the class
Add the vendor's class through the element's custom class setting, if available, and publish.
Check the button link
Select the button, choose the link icon and confirm the phone number is set as a Phone link.
Use an embed if needed
If you cannot add a class to the element, replace it with an HTML embed holding a link with the vendor's class.
Find the phone links
Check buttons, header and footer. Button links set as Phone store the number only in the link field.
Use a Code Block
If you cannot add a class, use a Code Block with a link that has the vendor's class.
Edit the template
Update the anchor so the text and href hold the same default number and carry the vendor's class.
Or update the href yourself
If the vendor exposes the assigned number in JavaScript, set the href from it, as in the snippet below.
// Run after the call tracking script has swapped the text.
// Only use this if the vendor has no built-in way to update href.
document.querySelectorAll('a.js-phone').forEach(function (a) {
var digits = a.textContent.replace(/[^0-9+]/g, '');
if (digits) a.setAttribute('href', 'tel:' + digits);
});Before
- Text shows the tracking number
- href holds the default number
- Taps on mobile dial the default number
- Calls show as direct or unknown
After
- Text and href show the same tracking number
- Taps dial the tracking number
- Calls are credited to the visitor's source
- Call conversions can reach your ad platform
How to confirm it's fixed
- With campaign parameters, the visible number differs from the default
- The console check shows matching digits in text and href for every tel: link
- Tapping the number on a phone shows the tracking number in the dialler
- Header, sticky button, footer and popups all behave the same
- A test call appears in your call tracking dashboard with the right source
- Without parameters, the default number shows in both text and href
How to prevent it happening again
- Add the tel: link check to your release checklist whenever you edit headers, footers or page templates
- Use one reusable phone component instead of pasting numbers in many places
- Do not swap a text-only number for an image or icon-only button without testing the link
- Re-test after changing themes, page builders, caching or script optimisation plugins
- Place a test call once a month from a phone and compare the source in the dashboard
How FunnelGuard handles this
FunnelGuard does not check this yet. Comparing the visible number with the tel: link after a swap is a possible future check, not something it does today.
What FunnelGuard does today 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 the inbox and CRM. That can show a broken step on a page that holds your phone button, but it will not tell you the href is stale.
Questions people ask
Why is my call tracking number changing on the page but not when I tap it?
The script is updating the visible text but not the href of the tel: link. On a phone, tapping uses the href, so it dials the default number. Add your vendor's swap class or make the link match the format the script looks for.
How do I check if my tel: link is being swapped by DNI?
Open the page in a private window with campaign parameters, right-click the number and choose Inspect. The href should start with tel: and the tracking number shown in the text. You can also list all tel: links in the browser console and compare them with their text.
Why are my mobile calls showing as direct in call tracking?
One common cause is that tapped links still use the default number, so the call cannot be linked to the visitor's source. Check that the tel: href is swapped as well as the visible text. Other causes include a script blocked by consent or a pool of numbers running out.
Does dynamic number insertion update the href automatically?
It depends on the vendor and on how your markup is written. Many scripts update links only when they find the default number in a specific format or when the element has a documented class. Read your vendor's setup guide and test the result.
Can I fix a tel: link that DNI ignores with JavaScript?
Yes, as a fallback. After the swap runs, read the number from the link text and set the href to tel: plus those digits. It must run after the vendor script, and a built-in vendor method is better where it exists.
Why does the swap work on desktop but calls fail on mobile?
Desktop visitors usually read the number and dial it, which uses the swapped text. Mobile visitors tap the link, which uses the href. If only the text is swapped, mobile calls are not attributed.
Does FunnelGuard check whether the tel: link matches the swapped number?
No. That check is not available yet and is a possible future addition. Until then, use the console check and a phone test, and review call sources in your call tracking dashboard.
Related issues
- TRK-249Dynamic number insertion (DNI) script not swapping numberFix guide
- TRK-250DNI swap fails on mobile tel: linksFix guide
- TRK-252DNI pool exhausted, everyone sees default numberFix guide
- TRK-254CallRail/CallTrackingMetrics script blocked by consentFix guide
- TRK-255Call conversions not sent back to Google AdsFix guide
- TRK-253Call tracking number disconnectedFix guide