Dynamic number insertion (DNI) is a call tracking method that swaps the phone number on your website for a tracking number. A small script reads where the visitor came from and shows them a number chosen in one of two ways: by their source (one number for each channel) or by their session (a number of their own from a pool). You choose which when you set it up. When they call, the call is credited to that source or that visit.

You can track a click or a form fill down to the keyword. Without DNI, the moment a visitor picks up the phone that trail goes dark: the phone rings, and nobody knows which campaign paid for it.

This guide covers how DNI works, the two ways to swap, what it captures, how many numbers you need and how to set it up. DNI is one part of call tracking; start there if you want the whole picture.

What is dynamic number insertion?

Dynamic number insertion is a short script on your website that replaces your phone number with a tracking number. Which number a visitor sees depends on how you set it up:

  • By source. Every visitor from the same channel sees the same number: one for Google Ads, one for organic search, one for social. A call to that number is credited to the channel.
  • By session. Each visitor sees a number of their own from a pool and keeps it while they browse. A call to that number is matched to that visit: its source, campaign, keyword and pages viewed.

You can mix the two, for example a pool for paid search, where the keyword matters, and a single number for each other channel.

DNI is also called dynamic number swapping or dynamic call tracking. The terms describe the same thing.

How dynamic number insertion works

  1. A visitor lands on your website carrying source data: UTM parameters, a Google Ads click ID (GCLID), a referrer, or nothing at all for a direct visit.
  2. The DNI script runs as the page loads and asks the call tracking software which number this visitor should see.
  3. The platform returns a tracking number. With source-based swapping it is the number assigned to that visitor’s channel. With session-based swapping it is a number from the pool for that channel, which the visitor keeps while they browse.
  4. The script swaps the number wherever it appears on the page: the header, the footer, click-to-call buttons and the body text.

When the visitor calls, the call is forwarded to your normal business line and logged against the source or the visit. The caller notices nothing.

Swap by source or by session

The swap can follow the visitor’s source or the visitor’s session. You choose when you set up your numbers, and you can use both on the same site.

By source (source-level) By session (visitor-level)
What the swap is based on The channel the visitor came from The individual visit
What a visitor sees The number assigned to their channel A number of their own from that channel’s pool
What a call is credited to The channel The visit: source, campaign, keyword, landing page
Numbers needed One for each source A pool sized to your traffic
Best for Comparing channels; low-traffic sites Google Ads, Microsoft Ads and SEO reporting by keyword

In Nimbata the choice is made on the numbers themselves. Each tracking number gets a source, such as Google Ads, organic search or all online sources. One number for a source swaps by source. Several numbers for the same source form a pool, and visitors from that source each get one of them.

Most advertisers who pay per click use a pool for paid search, because channel-level data cannot tell a keyword that brings customers from one that only brings clicks.

A worked example

A plumbing company runs Google Ads and also ranks in organic search. Its website shows the office number, (512) 555-0100.

  • Maria clicks an ad for “emergency plumber”. The script sees the Google Ads click ID and shows her +1 512 555 0142 from the paid search pool.
  • James clicks an ad for “water heater repair” a minute later. He gets a different number from the same pool, +1 512 555 0155.
  • Priya arrives from an organic result. Organic search is set up with a single number, so she sees +1 512 555 0167, as does every other organic visitor.

All three call. Maria’s and James’s calls are logged with their keyword and landing page, because each had a number of their own. Priya’s call is logged as organic search. The office phone rings the same way for all three.

What happens when a visitor comes back

The script stores the number in the visitor’s browser, so someone who returns a few days later sees the same number and their call is still credited to how they first found you. In Nimbata this lasts 21 days by default, and first click is the default attribution. You can switch to last click, which gives a returning visitor a new number when they arrive from a different source.

What DNI captures

With session-based swapping, DNI records for each call:

  • Source and medium (paid search, organic, social, referral, email)
  • Campaign, ad group and keyword for paid search
  • UTM parameters and any custom URL parameters
  • The Google Ads click ID (GCLID)
  • The landing page and the page the visitor called from
  • The full list of pages viewed
  • The referring site
  • Which tracking number was dialed

With source-based swapping you get the channel and the number dialed, without the keyword or the pages. Either way, the call itself adds the date and time, the caller’s number and location, the length and the outcome.

DNI vs static tracking numbers

A static tracking number never changes: one number on a billboard, another on your Google Business Profile. DNI changes the number for each visitor.

Static number DNI
Where it works Anywhere: print, radio, TV, listings Your website only
What you learn Which placement made the phone ring The channel behind each call, or the keyword and pages with a pool
Numbers needed One per placement One per source, or a pool
Best for Offline campaigns and listings Paid search, SEO and other online traffic

Most businesses use both: static numbers offline, DNI on the website.

Why marketers use DNI

1. Calls are credited to a source

Without DNI, every call from your website is anonymous. With it, each call arrives with its source, and with a number pool its campaign, keyword and landing page too, so calls appear in your reports next to forms and purchases. See how call attribution works in Nimbata.

2. Google Ads can bid on calls that matter

Most teams optimize Google Ads on form fills because that is what they can measure. If half your leads call, half the picture is missing. DNI ties each call to its click, so qualified calls can be sent back as conversions and bidding learns from them.

3. Revenue is tied back to ad spend

A call ends in a booked job or a signed deal, and that revenue sits in your CRM. Because DNI attaches the source to the call, the source travels with the lead into the CRM, and revenue can be reported by channel and campaign. Nimbata’s integrations send each call with its source to HubSpot, Salesforce, Google Ads and others.

4. Everything else in call tracking depends on it

Call recording, transcripts and AI analysis of calls tell you what was said. DNI tells you which campaign the conversation belongs to. Without it, those insights cannot be tied to a keyword or an ad.

How many tracking numbers do you need?

Swapping by source needs one number for each source. Swapping by session needs a pool, and the pool has to cover the visitors on your site at the same moment, not your monthly total.

Nimbata’s help center gives this formula: peak hourly visitors, divided by 60 over the average session length in minutes, times 1.3. With 200 visitors in your busiest hour and a 3-minute average visit, that is 200 / 20 x 1.3 = 13 numbers.

Numbers in a pool are shared in rotation, and a call is credited to the most recent visitor who was shown that number. So if the pool is too small, a call can be credited to another visitor’s source and keyword. If it is too big, you pay for numbers you never use.

The number pool calculator works it out from your traffic, and our guide explains how to calculate a tracking number pool.

What to look for in a DNI tool

A DNI tool should give you:

  • Both ways of swapping. By source for channel reports, by session for keyword detail, on the same site.
  • Help sizing the pool, from your own traffic, so you neither run short nor overpay.
  • Local and toll-free numbers in the countries you advertise in.
  • Integrations with Google Ads, GA4 and your CRM, so calls count as conversions and leads arrive with their source.
  • Recording, transcripts and scoring, so you can tell a qualified call from a wrong number.
  • A way to check it works, such as a test that confirms the number swaps on your pages.

How to set up DNI

  1. Choose your numbers and their sources. Add one number for each source to swap by source, or several for a source to create a pool and swap by session. Numbers can be local or toll-free; our comparison of toll-free vs local numbers helps you choose.
  2. Add the script. Paste it into your site, add it through Google Tag Manager, or use the WordPress plugin. The help center has the DNI setup steps.
  3. Tell it which number to swap. Enter your business number exactly as the page shows it, with the same dashes, dots and brackets, or wrap it in a tag the script can find.
  4. Test it. Open your site from each source, check that the number changes, and call it. Adding ?gclid=test to the address imitates a Google Ads visit.
  5. Connect your tools. Send calls to Google Ads, GA4 and your CRM so they count as conversions.

See how Nimbata’s dynamic number insertion software works.

Common problems

  • The number does not change. The number on the page is written in a different format from the one you entered, it sits inside an image or an iframe, or a cached copy of the page is being served.
  • It changes for some visitors only. A number set to one source, such as Google Ads, only swaps for visitors from that source. A direct visitor will not see it.
  • Some calls have no source. The visitor declined tracking in your consent banner, so the script did not run. Server-side call tracking recovers part of this.
  • Calls are credited to the wrong visit. The number pool is too small for your traffic.

Questions DNI lets you answer

With DNI you can answer:

  • Which channels, campaigns and keywords produce calls?
  • Which landing pages and content lead to a call?
  • Do callers come from mobile or desktop?
  • When do calls come in, by hour and day?
  • Which call buttons on the page get used?
  • Which campaigns produce the calls that become customers?

Frequently asked questions about DNI

What is dynamic number insertion (DNI)?

Dynamic number insertion (DNI) is a call tracking method that swaps the phone number on your website for a tracking number. The number is chosen either by the visitor’s source or for each visitor’s session, depending on how you set it up, so every call can be credited to the channel, campaign or keyword behind it.

What does DNI stand for?

DNI stands for dynamic number insertion. It is also called dynamic number swapping or dynamic call tracking.

Is dynamic call tracking the same as DNI?

Yes. Dynamic call tracking is call tracking that uses dynamic number insertion to show different numbers to different visitors. Static call tracking uses one fixed number per source.

What is a DNI script?

A DNI script, or DNI code, is the short piece of JavaScript you add to every page of your website. It reads the visitor’s source and replaces your phone number with the right tracking number.

What is an example of a dynamic number?

A visitor from a Google ad sees +1 512 555 0142 on your site, while a visitor from organic search sees +1 512 555 0167 on the same page. Both numbers ring your normal line, but each tells you where the caller came from.

How many tracking numbers do I need for DNI?

One number for each source if you swap by source. If you swap by session, the pool depends on your peak hourly visitors and average visit length; a number pool calculator works it out from your traffic.

Does DNI work with Google Ads?

Yes. With a number pool for paid search, DNI captures the Google Ads click ID (GCLID) for each visitor, so a call can be credited to its campaign and keyword and sent back to Google Ads as a conversion.

Does DNI hurt SEO?

No. The number in your page code and on your business listings stays the same. The script swaps the number for the visitor after the page loads, so search engines keep seeing your real number.

Can DNI track calls from offline sources?

No. DNI only works on your website. For radio, print, billboards and listings, use a static tracking number for each source.

Does DNI slow down my website?

The DNI script is small and built to have minimal effect on page speed.

Is DNI right for you?

If people call you after visiting your website and you pay for that traffic, yes. DNI is what turns a phone call from an anonymous ring into a conversion with a source.

Start a free trial or book a demo to see it on your own site.