Call TrackingOctober 17, 202611 min read

Dynamic number insertion: how it works and when to use it

Dynamic number insertion swaps the phone number per visitor so you can attribute calls by session or keyword. Use it when you need visit- or keyword-level attribution; use static numbers for channel-level tracking.

CallFlow Engineering Team

Telecom engineering and support at CallFlow (ALERTSIO LLC)

Dynamic number insertion: how it works and when to use it – Call Tracking article from the CallFlow blog

Dynamic number insertion (DNI) swaps the phone number on your site per visitor so you can tie calls to that visit. Use DNI when you need session- or keyword-level attribution on shared pages. If channel-level is enough, use static tracking numbers per source. When someone calls, the tracking number forwards to your usual destination, and your call log links the call to that visit.

What dynamic number insertion is and how it works

Think of it as a smart name tag for calls. A small JavaScript snippet runs on your pages and replaces your public-facing phone number with one from a pool of tracking numbers. It does this in the page text, in tel: links (click-to-call links), and in click-to-call buttons. Both desktop and mobile users see and dial the same tracking number. The swap happens in the visitor’s browser after the page loads. Your HTML can still show your main business number for bots and crawlers.

Here’s a concrete case. An HVAC company runs Google Ads, Facebook Ads, and gets steady organic search traffic. They want to know which visits turn into phone leads and, for paid search, which keyword drove the call. With DNI call tracking, a Google Ads visitor might see 555-0101, a Facebook visitor sees 555-0102, and an organic visitor sees 555-0103. Each of those is a tracking number in a pool. All of them forward to the same place the team answers. That can be a call queue with hold music, SIP endpoints (internet phones that register over IP) in the office, or a rotating list of field agents. In the call log, the platform records who called and which tracking number they dialed. It also stores the visit data (source, medium, campaign, even the GCLID if present) tied to that session.

Your call routing does not change. The DNI number forwards to your chosen target. You can run the same routing rules you use for normal calls. That includes time-of-day windows per target, priority or round-robin (send each next call to the next person in line) across agents, a simple IVR menu (press 1 for service), or a call queue with hold music. Attribution lives in the call record, not in the ring path.

You can host the swap script in your site template or inject it via a tag manager. Most marketers add it to the global tag container and use rules to run it on the pages that show a phone number. The pool itself is a set of tracking numbers you provision (local or toll-free) that you assign to channels or hold for session-level use. One short aside: CallFlow can provision local and US toll-free numbers (and numbers in several other countries) from a prepaid wallet for your DNI pool. Those calls can forward to phones, SIP endpoints, or browser agents (a web phone in your browser), with real-time logs.

If you want a deeper base in terminology before you set anything up, see our primer on call tracking and how it ties to call analytics.

What DNI can attribute—and what it cannot

Dynamic phone number swaps support three common levels of attribution:

  • Source-level attribution. You map a number to the referrer or to UTM source/medium. A visitor from Google Ads sees one number, a visitor from Facebook sees another, and organic search visitors see a third. This is the simplest model and often enough to judge ROI by channel.

  • Session-level attribution. Each active visitor gets a unique number for a time window (often tied to session length). This reduces cross-traffic confusion during peaks. If two visitors arrive from the same campaign at the same time, each sees a different DNI phone number. Each call then maps to the correct session. Session-level data lets you line up the call with the page path, time on site, and form events from that same visit.

  • Keyword- or ad-level attribution. If your campaign URLs carry parameters such as UTM fields or GCLID (Google Ads’ click ID), you can read those values on the landing page and attach them to the call record. That way, when the HVAC team answers, the log shows Paid Search > Brand Campaign > “ac repair near me” ad group, and you can roll up costs and conversions by keyword.

There are limits. If a visitor copies a number from a cached page, shares it with a friend, or dials it days later from a different device, the call may not match the original session. People also call from sources that do not go through your site. Calls from Google Business Profile, printed flyers, radio, or third-party directories do not see your site’s swap and should use dedicated static numbers.

Edge cases matter in the real world. Ad blockers or disabled JavaScript can prevent the swap. In those cases, the user may see your default number, and the call will not carry visit data. Single-page apps (sites that change views without a full reload) need a route-change trigger so the script can re-swap the number when the view changes. It’s fine to ship with a basic swap and then add SPA route listeners as you refine the setup.

Finally, remember that DNI adds attribution. It does not change the caller ID of the person calling you, and it does not change how the call forwards. The swap only affects which tracking number the visitor dials and what metadata lands in your call log.

How big should your tracking number pool be?

Pool size controls accuracy and upkeep. If the pool is too small, numbers get reused while earlier sessions are still active. That can point the new call at the wrong session or dump it into an “unknown/other” bucket. If the pool is too large, you tie up numbers you rarely use and add work to manage and age them.

Size for concurrency, not for monthly traffic. You care about how many simultaneous visitors are likely to call during peak times, and how long you “hold” a number after a session ends. An HVAC firm might see lunchtime and early evening spikes on mobile. If ten visitors can be on the booking page at once, and most call within 15 minutes, start with a pool of 10–15 per high-intent channel.

Start where the calls come from. If most calls come from paid search and organic, give each of those channels its own pool. That way a hot hour in paid search does not drain numbers from organic. If Facebook traffic is high but call intent is low, you can assign a smaller pool to it. You can also run source-level pools for lower-intent channels and a session-level pool only for pages with high call rates.

Use guardrails instead of a spreadsheet of formulas. A low-traffic local site with a few calls per day can start with a small pool. High-traffic, high-intent pages (service pages with a big click-to-call button) need more. Landing pages built for a single ad group often work with source-level pools. Broad pages that serve many channels benefit from session-level pools.

Watch your logs in the first week. Signs that the pool is small include number reuse during peaks, more calls tagged as “unknown/other” than you expect, or calls landing on the wrong channel. If you see reuse, add numbers and lift the hold window slightly so a number is not returned to the pool too fast. If you see lots of idle numbers and clean attribution, you can trim the pool.

Pick local vs toll-free based on trust and reach. For community trust, many home-service buyers prefer a local area code that matches their city. For national or multi-state reach, a toll-free pool can look neutral and travel well. We break down those trade-offs in local vs toll-free. You can mix pools too: local for local campaigns, toll-free for national paid search.

You can resize pools over time. When you retire a tracking number, let it age before you reuse it in a different pool. That reduces misdials from people who saved the number earlier. If you change a pool’s composition, keep a note of which numbers were tied to which channels for a while, in case late calls arrive.

Avoid SEO and NAP issues with tracking numbers

Search engines and directories want NAP consistency: the same name, address, and phone number across the web. Keep your primary business number in your Google Business Profile and in all external citations and directory profiles. Do not put DNI tracking numbers in those listings. They live only on your site and on campaign landing pages you control.

On your site, put the canonical business number in the HTML by default. Let the DNI script swap it at runtime for users. This keeps crawlers, caches, and people with JavaScript turned off seeing the correct number, while still letting you attribute most calls.

Swap tel: links (the click-to-call links) along with visible text. Many mobile users click the link rather than dialing the digits they see. If you only change the text but not the link, you’ll lose attribution when a user taps to call. The HVAC example would replace both the “Call now” button text and its tel: href to the same tracking number.

If you use structured data (schema.org Organization or LocalBusiness), keep the canonical number there. Some SEO teams prefer to add both numbers to structured data to reflect the presence of a tracking line on the page. If you go that route, test in Search Console to be sure the primary still reads as your main line.

Format tracking numbers to look natural. For local campaigns, use a local area code and the local digit grouping your market expects. People are more likely to trust and dial a number that looks like it belongs in their city. For toll-free, pick a widely recognized prefix.

Static tracking numbers: when they’re enough

You do not always need dynamic swaps. Static tracking numbers (one dedicated number per channel or campaign) work well for ads and offline sources. Billboards, mailers, radio, and directory profiles should use their own numbers. Those sources never hit your site, so DNI cannot help there.

If your site has low traffic or one main paid source, static numbers on clean, focused landing pages can cover your needs without any script. Use one number for Google Ads, one for Facebook, and keep your main number on the rest of the site. This avoids JavaScript, single-page app, and ad-blocker edge cases.

The trade-off is depth. Static numbers give you channel-level clarity, but not session-level or keyword-level detail on multipurpose pages. If you run a single Google Ads campaign to its own landing page and the HVAC team picks up most calls from that page, a static call tracking number per campaign is often perfect. If you run a Facebook lead ad with a click-to-call, a distinct static number on that ad also works and is easy to report on.

When to use Google’s forwarding numbers

Google forwarding numbers (GFNs) attach to call extensions and call-only ads. They track calls that happen from the ad itself without touching your site. Setup is within Google Ads. Availability varies by country and number type, so check your account’s support docs. GFNs are useful if a big share of your conversions come from people who call straight from the ad. They can also surface useful call metrics inside Google Ads.

GFNs do not tag calls from users who click through to your site and then dial a number on the page. If that’s a common path for you, you will need site-side tracking as well. Use GFNs for calls from the ad, and use DNI for calls from the landing page after the click. Align your conversion actions and dedupe rules so the same call is not counted twice across platforms. If GFNs are limited or not available in your country, you can skip them and use your own tracking numbers in the ad and on the landing page instead.

For deeper routing ideas that pair well with ad-driven calls, see our notes on call forwarding for Google Ads.

When to use your own tracking numbers with DNI

If you want to tie calls to session data, page paths, and keywords, use your own tracking numbers with dynamic number insertion on your site. Capture UTM parameters and GCLID on the landing page, store them in a short-lived cookie or in session storage, and pass those fields with the call record. This approach works across countries and carriers because you control the numbers and the swap. You also keep a single source of truth in your call logs rather than splitting call data between ad platforms.

You can still show a call extension, but set your dedupe rules in analytics to count one call per user session. In some markets, call-only ads may be rare or harder to run well. Your own DNI setup gives you a stable path that does not depend on GFN availability.

Choose your next step

  • If you only need channel-level attribution, start with static numbers per source on clean landing pages.

  • If you need session or keyword-level insight across shared pages, set up dynamic number insertion with a right-sized pool. Test swaps on mobile and on any single-page routes your site uses.

  • Watch call logs and analytics in the first week. Adjust pool size and mapping rules if you see number reuse, “unknown/other” spikes, or mis-tagged calls.

  • For local trust, choose area codes that match your market. For national reach, add a toll-free pool.

If you want to get hands-on, you can provision local and toll-free numbers in minutes, then route to phones, SIP endpoints, or browser agents, all from a prepaid wallet with no subscription. You can sign up and start with one landing page and a small pool. If you’d like help mapping sources and setting pool sizes, reach out via our contact form.

Frequently asked questions

Can I do dynamic number insertion without JavaScript?

No. In-browser DNI that swaps the visible text and tel: links requires JavaScript to run in the visitor’s browser. Without JS, you must use static tracking numbers assigned to channels or make server-side HTML changes before the page is delivered (which is not session-level DNI). Also expect some missed attributions from users with JS disabled or from ad blockers.

How do I track calls from Google Business Profile alongside DNI?

Use a dedicated static tracking number for your Google Business Profile and other off-site sources, and keep DNI numbers only on pages you control. The static GBP number forwards to the same destination as your DNI pool, and its calls appear in call logs as a separate source. You can provision those numbers from a prepaid wallet and forward them to phones, SIP endpoints, or browser agents.

How long should I wait before reusing a tracking number from the pool?

Wait long enough that a saved number or a late caller is unlikely to be tied to the wrong session. Tie the hold period to your typical session length plus a safety buffer, then monitor logs for reused numbers or calls marked “unknown.” If you see reuse during peaks, lengthen the hold window or add numbers to the pool until reuse stops.

Will DNI work on single-page apps like React or Angular sites?

Yes. DNI can work on SPAs, but you must trigger the swap whenever the app changes views because there’s no full page reload. Add a route-change listener or hook to run the swap script after navigation, and ensure tel: links and buttons are updated. Also expect the usual limits: disabled JavaScript or ad blockers can prevent swaps.

Do I need local area codes in my DNI pool for local campaigns?

Local area codes help trust and local recognition for community-targeted campaigns, while toll-free numbers work better for national or multi-state ads. You can mix pools: local numbers for city-specific landing pages and toll-free for broad paid search. Provision the mix you need from a prepaid wallet and adjust based on caller response and conversion rates.

From the team

CallFlow Engineering Team

Telecom engineering and support at CallFlow (ALERTSIO LLC)

The engineers and support staff who build and operate CallFlow's call-routing platform. We write from what we see running inbound routing for pay-per-call marketers, agencies and small businesses every day: routing rules, carrier behaviour, spam flags, and the configuration mistakes that quietly cost calls.

Ready to get started with CallFlow?

No subscription. Transparent usage billing. Per-number spam scores. Built for scale.

Create Free Account →