Dynamic number insertion is a script that replaces the phone number shown on your website with a tracking number chosen for each visitor. The number comes from a pool and is tied to that visit, so a later call can be credited to the ad, search or page that brought the person in.
A website has a problem that a mailer does not. The mailer goes to one audience and carries one number. The website is seen by people who arrived from a search ad, a map result, an email, a social post and a friend's link, and they all see the same page. If the page shows one phone number, every call looks the same.
Dynamic number insertion, often shortened to DNI, solves that. It changes the number on the page to match the visitor.
How does the swap work?
A small script loads with each page. It does four things in order.
- Reads how the visitor arrived: ad parameters in the address, the referring site, a campaign tag.
- Decides the source, such as paid search, organic search, direct or a particular campaign.
- Gets a number from the pool set aside for that source and reserves it for this visit.
- Replaces every instance of your default number on the page with that number, in text and in click-to-call links.
When the visitor calls, the system sees which number was dialed, looks up which visit it was reserved for and credits the call. The caller reaches your normal line. If you want the broader picture first, How Does Call Tracking Work? covers where this step sits.
What is the difference between source-level and session-level swapping?
With source-level swapping, every visitor from paid search sees the same number. That gives you a count per source and costs few numbers, but you cannot link a call to one visitor's session or keyword.
With session-level swapping, each visitor gets a different number for the length of their visit. Many numbers are in play at once, and the system can say that this call came from this keyword, this landing page and this device. In Calling Tabs, website number pools use dynamic number insertion and record source, keyword, landing page and device per call. The tradeoff is that session-level swapping needs more numbers, which is the subject of How Many Numbers Does a Website Number Pool Need?.
How long does a visitor keep their number?
For the length of the visit, plus some grace afterward. If a visitor sees a number, leaves and calls ten minutes later from their phone's browser history, the number should still be theirs. After a period of inactivity, the number goes back into the pool for someone else.
That grace period matters. A caller who sees a number, thinks about it for an hour and then dials, hits a number that has been given to a different visitor, and you credit the wrong source. Shorter grace periods save numbers and risk misattribution. Longer ones cost numbers and improve accuracy.
When does it break?
Most failures come from the page, not the script.
- A phone number in an image, a PDF or a video cannot be swapped. The script only sees text.
- A number written in several formats, such as 555-0100 and (555) 0100 and 5550100, may only be matched in one.
- Click-to-call links with the number hard-coded in the link address, not just in the visible text.
- A page that renders late, so the visitor sees the default number for a moment, taps it and the call is credited to nobody in particular.
- Visitors who block scripts or who disable cookies see the default number.
Each of these degrades the data rather than stopping calls. People still reach you. You just learn less about them.
Does it change what callers see?
Yes, and that deserves honest thought. Two visitors can see different numbers for the same business, and a caller might notice that the number on a listing differs from the number on the website. Some businesses keep the same default number on listings and in the footer for consistency, and swap only the numbers near calls to action. Local listings are sensitive to number mismatches, so involve whoever manages your listings before you roll it out.
When is dynamic number insertion not the right tool?
It is not the right tool for every page. A landing page that serves exactly one campaign needs one dedicated number, not a pool and a script. A site that gets a few visits a day does not need session-level detail, because you can read the calls one at a time. And a site where the phone number is a minor detail, buried in a footer, may not justify the effort of making sure every instance swaps correctly.
The swap earns its keep when several sources share pages, when traffic is steady enough to produce meaningful call counts and when you intend to act on keyword or page level results. If you would never change a campaign based on which keyword produced a call, source-level numbers are enough and cost far fewer numbers.
How does it relate to forms and texts?
A visitor who does not call may fill out a form or send a text instead. Because the visit is already identified, the same source details can ride along with those. In Calling Tabs, form tracking is on every plan and texts carry the same source details, and caller timelines show visits, calls, texts and forms together. That is why tracking calls and forms in the same report matters: the visitor who called and the one who submitted a form came from the same ads.
Is there a privacy concern?
A script that reads referrers and session data is collecting visitor information, and some places regulate that. Whether you need a notice, an opt-in or neither depends on where your visitors are and what you collect. Ask your counsel or a privacy professional rather than guessing. This post gives you the mechanism, not a legal opinion.
What about single-page apps and late-loading content?
Sites built as single-page apps, or pages that load their contact details after the first render, are the hardest to swap correctly. The script has to notice when the number appears, not only when the page loads. If your site works this way, test moving between pages without reloading, since a swap that works on the first page may not run on the second. Ask your developer to confirm that the script handles content that changes after load, and check the click-to-call links in particular.
How do you test it?
Test it like a visitor would. Open the site in a private window from each source you care about: click your own ad if you can, search for your business, open a tagged link. Note the number on the page each time and make sure it is different, and consistent across the page. Call each number and confirm the call shows up in the report with the right source. On a phone, tap every click-to-call button. A half hour of this finds the image with the hard-coded number that would have quietly cost you data for months.
It is also worth testing a few days after launch with a sample of real calls. Compare the report to what you hear. If callers mention a search and the report says direct, something is off. The setup steps are in How Do You Set Up Call Tracking in an Afternoon?.
Common questions
- Does dynamic number insertion hurt SEO?
- Done properly, the page keeps a default number in its markup and the script swaps it for visitors. Search engines and visitors without scripts see the default. Check with your SEO or web developer if listings and the site must show matching numbers.
- What does a visitor see if the script fails?
- They see your default number, the one in the page itself. Calls to it still ring, but they are credited to a general source instead of the one that brought the visitor.
- Can it swap numbers inside buttons and links?
- Yes, if the script targets the number text and the tel link together. Check click-to-call buttons on mobile, because that is where swaps most often miss.
- Do I need it if I only run ads to a landing page?
- You may not. A landing page used by one campaign can use a single dedicated number. The swap becomes useful when several sources share a page.