Which Ad Made the Phone Ring? Dynamic Number Insertion, Explained

Picture two people looking at your website on the same afternoon. One clicked a paid search ad for "emergency furnace repair." The other typed your name into a browser because a neighbor recommended you. Both pick up the phone and call the number in your header. Dynamic number insertion (DNI) is how you tell those two callers apart.
Without call tracking, those calls look identical. Your ad account sees nothing, your analytics sees nothing, and at the end of the month the paid campaign looks as if it produced a handful of form fills and not much else. Dynamic number insertion, usually shortened to DNI, is how you tell those two callers apart.
What dynamic number insertion actually does
DNI is a small piece of JavaScript that runs on your website. When a visitor lands, the script checks how they arrived: the referring site, the UTM tags on the link, a click ID from an ad platform, or the landing page itself. Based on rules you set, it replaces the phone number on the page with a tracking number assigned to that source.
The visitor sees a normal local or toll-free number. When they call it, the call forwards to your regular line in a fraction of a second, and the call tracking platform logs which source the number belonged to. Nothing about the caller's experience changes. Your team answers the same phones they always do.
Because the swap happens in the visitor's browser after the page loads, search engine crawlers still see your main business number in the page source. That matters for local search, where a consistent name, address and phone number across the web is part of how search engines confirm who you are.
Source-level vs. visitor-level tracking
There are two broad ways to set up DNI, and the right one depends on what you need to learn.
Source-level tracking
Each traffic source gets one number. Everyone arriving from paid search sees number A, everyone from organic search sees number B, everyone from social sees number C. It's simple, needs only a few numbers, and answers the big question of which channels drive calls.
The limitation is that you can't tell which keyword, ad or page drove a particular call, because thousands of paid search visitors share the same number.
Visitor-level tracking
Here the platform keeps a pool of numbers. Each new visitor from a tracked source is given a number from the pool that stays tied to their session for a while. When they call, the platform knows exactly which session the call belongs to, along with the keyword, campaign, landing page, pages viewed and the ad click ID.
That last part is the important one. With the click ID, the call can be sent back to the ad platform as a conversion tied to the specific click, which is what automated bidding needs to learn from phone leads.
How many numbers do you need?
For source-level tracking, count your sources. Five or six numbers covers most small businesses.
For visitor-level tracking, the pool needs to be big enough that a number isn't handed to a new visitor while the previous visitor might still call it. The rough logic:
- Work out how many visitors from tracked sources are on your site at the same time during your busiest hour.
- Decide how long a number should stay assigned to one visitor after they leave. Many setups use something in the range of 15 to 30 minutes.
- Size the pool so that at peak, every concurrent visitor plus everyone in that hold window can have their own number, with some headroom.
Most platforms report when a pool runs short, usually as calls that couldn't be matched to a single visitor. If you see a lot of those, add numbers. If numbers sit idle all day, you can shrink the pool. A good onboarding will size this from your analytics instead of guessing.
What you can do with the data
Once calls carry their source, a few things become possible that weren't before:
- Fair budget decisions. Channels that produce mostly phone leads finally get credit for them.
- Smarter bidding. When qualified calls flow back to Google Ads or Microsoft Ads as conversions, automated bidding can optimize toward the searches that produce callers who buy, not just callers.
- Landing page testing. You can compare which pages produce calls, not only which produce clicks or forms.
- Better conversations. A whisper message can tell your team "Paid search, water heater page" before they say hello.
Common mistakes that quietly break DNI
The number is an image or split across elements
The script needs to find the number as text. If your header phone number is part of an image, or the area code is wrapped in a separate element from the rest, the swap may fail silently. Check every place your number appears, including the footer, the mobile click-to-call button and any pop-ups.
Ad platforms have their own quirks here too. The Google Ads help page on tracking calls to a number on your website notes that its default JavaScript tag tracks only one number per page, and that the Tag Manager option isn't recommended if your site already uses dynamic number insertion or third-party call tracking. If you run both, decide which system owns the number swap.
The script loads on some pages but not others
Landing pages built in a separate tool, booking pages and old templates are frequent gaps. If a visitor lands on a page without the script, their call is attributed to nothing.
Click-to-call links aren't updated
On mobile, most calls start from a tap on a tel: link. Make sure the link target changes along with the visible text, otherwise visitors see the tracking number but dial your main line.
Caching or consent tools block the script
Aggressive page caching usually isn't a problem because the swap happens in the browser, but consent management tools can block the script until a visitor accepts cookies. Decide with your privacy advisor how call tracking should be categorized, and test the behavior on a fresh browser.
Counting every call as a conversion
Not every call is a lead. Existing customers, vendors, wrong numbers and spam all ring the same line. If you send every call to your ad platform as a conversion, bidding will chase volume rather than value. Use duration thresholds at minimum, and ideally tags, scores or AI answers that identify real prospects.
Testing your setup
Before trusting the reports, run a simple test plan:
- Open a private browser window and visit your site through a tagged link for each source.
- Confirm the number changes in every location on the page, on desktop and on a phone.
- Call the swapped number from your phone and confirm it rings through to the right place.
- Check that the call appears in the activity log with the right source, landing page and, for paid visits, a click ID.
- Repeat for direct visits and confirm your default number shows.
Ten minutes of testing catches most of the problems above before they cost you a month of bad data.
Is DNI worth it for a small business?
If phone calls are how most of your customers first reach you and you spend money on more than one channel, almost certainly yes. Source-level tracking is inexpensive and simple. Visitor-level tracking is most useful once you run paid search or paid social at a level where keyword and ad decisions matter.
If you'd like to see what a DNI setup would look like on your own site, including how many numbers you'd need, book a RingIris demo and we'll walk through it with your traffic in mind. You can also read more about how RingIris handles attribution.
Related reading
Frequently asked questions
What is dynamic number insertion?
A script on your website that shows each visitor a tracking number tied to how they arrived, so a phone call can be credited to the right ad, search or referral.
Does dynamic number insertion hurt local SEO?
It shouldn't if your real number stays in your HTML and listings and the tracking number is swapped in by script. Keep your Google Business Profile number consistent.
How many tracking numbers do I need?
For source-level tracking, one per source. For visitor-level tracking, enough to cover peak simultaneous visitors for the time each number stays assigned.
Can I use Google's forwarding numbers and a call tracking tool at the same time?
You can, but two scripts swapping the same number causes conflicts. Pick one system to own the swap and pass conversions to the other.


