On this page
What this issue is
Call tracking tools like CallRail and CallTrackingMetrics use a JavaScript snippet. It reads where a visitor came from (UTMs, gclid, referrer) and swaps your phone number for a tracking number from a pool. This is called dynamic number insertion (DNI). The snippet usually sets cookies or storage to link the visit to the later call.
Why it costs you leads or sales
Calls from visitors who have not consented are still real calls, but they are credited to nothing, or to a generic number. Your reports under-count paid search, SEO or social calls. Smart bidding that depends on call conversions then learns from less data, and you may cut campaigns that actually work.
- Ad clickVisitor lands with gclid/UTMs
- Cookie bannerVisitor ignores or declines
- Call tracking scriptHeld back by the CMP
- Number swapDefault number shown
- Call reportNo source recorded
The consent block happens before the number swap, so every later step has no campaign data.
Example: share of calls that carry a source when the script is blocked until consent versus loaded for all visitors. Your numbers will differ.
How to check if your site has it
Open a clean session
Use a private or incognito window so no consent choice is stored. Visit your site with a test URL such as ?utm_source=test&utm_medium=cpc.
Do not touch the banner
Leave it unanswered. Look at your phone number in the header and on the contact page.
Compare with the tracking number
If you see your normal main number, the swap did not run. Then click Accept and reload. If the number now changes, consent is blocking the script.
Check the network
Open DevTools, Network tab, and filter for the vendor domain (for example callrail.com or calltrackingmetrics.com). No request before consent means the script is held back.
Repeat with Reject
Clear site data, choose Reject all, and look again. Note what your CMP allows.
| State | Number shown | Script request | Meaning |
|---|---|---|---|
| No choice made | Default number | None | Blocked until consent |
| Accepted | Tracking number | Present | Working for consenting users |
| Rejected | Default number | None | Blocked, as configured |
How to fix it
First decide the policy with your legal adviser. Then make the setup match it. Common outcomes: keep the script behind consent (and accept lower attribution), load it for everyone with a configuration your adviser approves, or use a tracking option from your vendor with fewer cookies. Check your vendor's documentation for what each option stores.
Find how the script is loaded
It may be pasted in the theme, added by a plugin, or fired from Google Tag Manager. Search the page source for your vendor's domain.
Check its category in your CMP
Look for the script in your consent tool's cookie or script list. Make sure it sits in the category you intend, and is not blocked by a broad rule.
Set the trigger correctly
If it stays behind consent, make sure it fires as soon as consent is given, without needing a page reload.
Keep the default number safe
Make sure your real main number is in the page HTML so visitors can always call, even with no script.
Retest
Repeat the clean-session check for no choice, accept and reject.
Open the tag
Edit the Custom HTML tag that holds the CallRail or CTM snippet, then open Advanced Settings, Consent Settings.
Set consent requirements
Choose whether it needs additional consent such as analytics_storage or ad_storage, matching your policy. Remove requirements you do not need.
Check the trigger
Use All Pages, or a trigger that also fires on your consent update event, so the tag runs once consent is given.
Preview
Use Tag Assistant preview and confirm whether the tag fires with consent denied and granted.
Find the loader
Check whether the script comes from the vendor plugin, a header snippet plugin or your theme.
Review your cookie plugin
In your consent plugin's settings, look for script blocking or auto-blocking rules and the category of the call tracking domain. Change it or add an exception as your policy allows.
Clear caches
Purge page and CDN caches, then retest in a private window.
Find where it loads
Check theme.liquid, the vendor's app and Settings, Customer events for the snippet.
Check Customer privacy
In Settings, Customer privacy, review the banner and regions. Scripts in the theme are not blocked by it automatically, so a blocking rule probably comes from an app.
Adjust the app or snippet
Change the category in your consent app or move the loading rule to match your policy.
Locate the snippet
Check Site settings, Custom code (head and footer) and page-level custom code.
Check your consent tool
If it is a third-party banner, mark the script with the attribute or category it expects, or remove the blocking attribute if your policy allows.
Publish and retest
Changes only appear after publishing.
Load after consent
Inject the vendor snippet from your consent callback, so it runs the moment consent is granted. See the code example below.
Or load unconditionally
If your legal adviser approves, include the snippet directly and remove it from the blocked list.
// Replace the URL with the snippet source from your CallRail or CTM account.
function loadCallTracking() {
if (window.__callTrackingLoaded) return;
window.__callTrackingLoaded = true;
var s = document.createElement('script');
s.async = true;
s.src = 'YOUR_CALL_TRACKING_SCRIPT_URL';
document.head.appendChild(s);
}
// Call this from your consent tool's 'accepted' callback.
// Check your CMP docs for the exact event or function name.
document.addEventListener('consent-accepted', loadCallTracking);How to confirm it's fixed
- Clean private window, no banner choice: behaviour matches your chosen policy.
- After Accept: the tracking number appears without a manual reload, if that is your design.
- After Reject: the default number shows and the page still works.
- Network tab shows the vendor request only when it should.
- A test call to the tracking number appears in the CallRail or CTM dashboard with the test source.
- Mobile browser test gives the same result as desktop.
How to prevent it happening again
Consent settings change when someone updates the banner, switches CMP or edits a tag. Keep a short note of which category each marketing script belongs to. Re-run the clean-session test after any banner, theme or tag change, and make a test call each month.
How FunnelGuard handles this
FunnelGuard does not check this yet. A consent-blocked call tracking script is a possible future check. Today you need to watch for it by hand.
What FunnelGuard does cover nearby: a robot visitor runs your real journeys on a schedule, such as lead forms, checkouts and booking or chat buttons, and checks the tracking hits sent to GA4, Google Ads, Meta and other ad platforms. That helps you spot broken form or ad tags, but it does not tell you whether your call tracking number swapped.
To watch for this issue yourself, repeat the clean-session test monthly and after every consent or tag change. Also check your CallRail or CTM dashboard for a rising share of calls with no source, and make a test call from a fresh browser. A free FunnelGuard audit is read-only and can be a starting point for reviewing your site, but it is not a substitute for these checks.
Frequently asked questions
Questions people ask
Why is my CallRail number not swapping?
One common cause is a cookie banner holding the script back until the visitor accepts. Open a private window, ignore the banner and check the Network tab for a request to callrail.com. If nothing loads until you click Accept, consent is blocking it.
Does call tracking need cookie consent?
It depends on your country, what the tool stores and how you configure it. Some setups need consent and some do not. Ask your legal adviser, then set your consent tool to match.
How do I stop my cookie banner blocking CallTrackingMetrics?
Find where the script loads (theme, plugin or Google Tag Manager), then change its category or consent requirements in your consent tool. Do this only if your legal advice allows. Retest in a clean private window.
What happens to calls from visitors who reject cookies?
They still call, but they see your default number, so the call has no campaign source. Your reports show them as direct or unknown. You can still count them in total call volume.
How do I test if consent is blocking my call tracking script?
Open a private window, add UTMs to the URL and leave the banner alone. Check whether the number changes and whether the vendor domain appears in the Network tab. Then accept cookies and compare.
Can Google Tag Manager consent settings block the CallRail tag?
Yes. If the tag has consent requirements such as ad_storage or analytics_storage and those are denied, it will not fire. Check Advanced Settings, Consent Settings on the tag and use Tag Assistant preview to see the result.
Does FunnelGuard detect call tracking scripts blocked by consent?
Not yet. It is a possible future check. FunnelGuard does check your forms and ad and analytics tracking hits on a schedule, so for call tracking you should test manually and review your call dashboard.
Related issues
- TRK-249Dynamic number insertion (DNI) script not swapping numberFix guide
- TRK-250DNI swap fails on mobile tel: linksFix guide
- TRK-251DNI swaps the number in visible text but not the tel: hrefFix guide
- TRK-252DNI pool exhausted, everyone sees default numberFix guide
- TRK-255Call conversions not sent back to Google AdsFix guide
- TRK-258Live chat leads not attributed (no UTM passed to chat)Fix guide