跳到正文
DEV Community· Ebrahim Manj·· 2 天前AI 評分41

電話追蹤如何運作:追蹤號碼與動態號碼插入解析

How call tracking actually works: tracking numbers and dynamic number insertion explained

AI 導讀

電話追蹤以來電者撥打的號碼作為追蹤參數,將來電連回相應的市場推廣來源。網站可透過動態號碼插入(DNI)按訪客工作階段分配號碼,記錄來源、關鍵字及到訪頁面,再將電話轉駁至商戶的實際號碼。來電配對後,平台亦可轉錄及摘要通話,並評估來電者的購買可能性。

正文

Your analytics can tell you that someone clicked a Google ad, landed on /pricing and left after 40 seconds. What it can't tell you is that they then picked up their phone and called you, and became your biggest customer.

For a lot of businesses (plumbers, dentists, law firms, agencies running ads for them), the phone call is the conversion. Call tracking is the set of tricks that connects that call back to the marketing that caused it.

I'm building CallRing AI, a call tracking product, and when I explain it to developers the reaction is usually "wait, how does it know which ad the caller came from?" This post answers that, step by step, including the core technique behind it: dynamic number insertion (DNI).

The core idea: the phone number is the tracking parameter

On the web, you track attribution with things like ?utm_source=google or a gclid. A phone call carries none of that. The only data you reliably get is:

  • the number the caller dialed
  • the caller's number (caller ID)
  • the time

So call tracking uses the number that was dialed as the tracking parameter. If each marketing source shows a different number, the dialed number tells you the source.

All those numbers forward to the business's real line, so the business doesn't have to do anything differently. The call tracking platform sits in the middle, logs the call, and passes it through.

Static tracking numbers: one number per source

The simplest version is static numbers:

Where the number appears Number shown Forwards to
Google Business Profile (555) 010-1001 Main line
Facebook ads (555) 010-1002 Main line
Billboard on Highway 9 (555) 010-1003 Main line
Direct mail flyer (555) 010-1004 Main line

A call to 1003 came from the billboard. Done.

This works well for offline channels and fixed placements, and it's how a lot of businesses start. But it breaks down on your website, because one page gets visitors from many sources. Someone from a Google ad and someone from an organic search land on the same homepage. One static number can't tell them apart.

Dynamic number insertion: a number per visitor

DNI solves the website problem. Instead of one number per source, you keep a pool of numbers, and a script on your site:

  1. Works out where the visitor came from (UTM tags, gclid, referrer, landing page).
  2. Assigns that visitor a number from the pool for the length of their session.
  3. Swaps the phone number shown on the page for the assigned one.
  4. Remembers the assignment, so when that number rings, the platform knows which session (and therefore which source, keyword and page) the call belongs to.

When the session ends, the number goes back into the pool for the next visitor.

How big does the pool need to be?

Each number is "held" by one visitor while they browse and for a while after, because people often call a few minutes after leaving. If two visitors get the same number at the same time, you can't tell their calls apart.

A rough rule of thumb is: pool size ≈ peak concurrent visitors who see the number, plus some headroom. Many platforms also let you pool only paid traffic (where keyword-level data matters most) and show a single static number to everyone else, which keeps the pool small.

What a DNI setup looks like, step by step

Here's the flow from the visitor's side and the platform's side:

  1. A visitor arrives. A small script on the site reads where they came from: UTM tags, a Google Ads click ID (gclid), the referring site, and the page they landed on.
  2. They get a number. The platform picks a free number from the pool and assigns it to that visitor's session. It records which number went to which session, along with the source, campaign, keyword and landing page.
  3. The page shows their number. Every phone number marked on the page (in the header, the contact section, click-to-call buttons) is swapped for the assigned one. Click-to-call links are updated too, so tapping on mobile dials the right number.
  4. The number stays with them. As they browse more pages, they keep seeing the same number, so the session isn't split across several numbers.
  5. They call. The call comes in to the pool number. The platform looks up which session held that number at that moment, attaches the source, campaign, keyword and landing page to the call, and forwards it to the business's real line. The caller never notices.
  6. The number is released. After the session (plus a grace period for people who call a bit later) the number goes back into the pool.

That lookup in step 5 is the whole trick. Everything else a call tracking platform does is built on top of that match.

Things that make it hard in practice

The basic flow is the easy part. What makes it hard:

  • Pool exhaustion. When every number is held, what do new visitors see? Usually a fallback number, and you lose attribution for those calls.
  • Late callers. People call back hours later. Hold numbers too long and your pool runs out; release them too fast and calls get matched to the wrong visitor.
  • Bots and crawlers. They don't call, but they do grab numbers. Filter them before assigning.
  • SEO. Don't swap the number search engines see in your structured data or Google Business Profile. Inconsistent business phone numbers can hurt local rankings. DNI should only change what human visitors see.
  • Privacy and consent. If you record calls, recording consent laws differ by state and country. Some require every party to agree. This is the caller's experience, not just a technical detail.
  • Getting the data back out. Marketers want calls to show up as conversions in Google Ads and GA4, not in a separate dashboard. That means sending events back with the original gclid or client ID.

What happens after the call is matched

Once you know which campaign drove a call, the interesting questions start: was it a good call? A new customer or a wrong number? This is where AI has changed the category. Platforms can now transcribe calls, summarize them and score how likely the caller is to buy, so you can judge a campaign by the quality of its calls rather than just the count.

That's the part we focus on at CallRing AI: call tracking with DNI and number pools, plus AI transcripts, summaries and call scoring, and spam call blocking, so a campaign that brings in 50 robocalls doesn't look like a success.


I'm building CallRing AI, call tracking for small businesses and agencies. We launch in January. If you've built anything with phone numbers or telephony APIs, I'd like to hear what tripped you up in the comments.

來源:DEV Community · dev.to