A swap group tells the DNI script which phone number on your page to replace, and which pool of tracking numbers to use. This page shows how to plan your groups around the traffic sources you want to measure, then create and rename them.

Plan your swap groups

The way you organize your tracking numbers determines how granular your call attribution can be. This section explains the main structural approaches and when to use each one.

The core principle: sources live on your tracking numbers

  • A swap group pairs a phone number on your website (its swap target) with the tracking numbers that replace it.
  • Each tracking number has its own tracking source, set in Tracking › Numbers. One swap group can hold numbers from several sources.
  • When a visitor arrives, the DNI script swaps in a number whose source matches the visitor’s session, and attributes any resulting call to that source.
  • So to measure two sources separately, give each its own tracking numbers. You only need another swap group for another phone number on your site.

Single source tracking

Give your tracking numbers the All online sources source if you only need to know that a call came from your website, without separating channels. This is the simplest setup and requires the smallest number pool.

Channel-level tracking

Use separate tracking numbers for each major channel you want to measure independently, each with that channel as its source:

  • A pool for Google Ads (Paid Search)
  • A pool for Organic Search
  • A pool for Direct
  • A pool for Referral / Social

With this structure:

  • Each source requires its own pool of numbers. They can all sit in the same swap group.
  • Visitors are assigned numbers from the pool that matches their session source.
  • This structure lets you compare call volume and quality by channel.

Campaign-level tracking

  • For paid channels where you want to track down to the campaign, ad group, or keyword level, use DNI with Google Ads or paid-search tracking numbers.
  • Nimbata captures the gclid parameter and passes keyword and campaign data alongside the call.
  • You do not need a separate number per campaign.
  • One pool of paid search numbers handles all Google Ads traffic.
  • The granular data comes from the session parameters captured at the time of the call.

Offline and fixed-source tracking

Use this for sources where DNI is not appropriate. Print, radio, billboards, business cards, or directory listings use a single dedicated number per source. These numbers do not belong to a pool and do not swap; they are permanently published on the specific channel.

  • Billboard on Highway 101 > one fixed local number
  • Yellow Pages listing > a different fixed local number
  • Direct mail campaign > another fixed number

Each call to these numbers is automatically attributed to the source the number is assigned to.

Mixing online and offline

A typical multi-source setup looks like this:

  • Website, all digital (DNI pool): catches all website visitors not covered by a more specific source
  • Google Ads (DNI pool): captures paid search sessions with full keyword attribution
  • Print / offline (fixed numbers): one number per offline channel

This gives you full digital session attribution plus clean offline tracking, without overlap.

How many numbers you need

DNI pool size depends on your peak concurrent visitors and average session duration. Fixed-source numbers are always one number per source.

Detailed guide: Calculate your pool size
Detailed guide: How many numbers you need

Setting it up

Once you know your structure, give your tracking numbers their sources, then add them to the swap group of the phone number they replace.

Detailed guide: Set up swap groups
Detailed guide: Tracking numbers: Number types and channels
Detailed guide: What DNI is

Set up swap groups

You need at least one swap group per distinct number on your site. Use multiple swap groups when you have more than one number on the same page (for example, a Sales line and a Support line) and want to track them independently.

Before you start: make sure you have tracking numbers acquired and a call flow set up. See Set up DNI step by step.

  1. Create a call flow for each number on your site

    • Go to Call handling > Call Flows.
    • Click Create, then From Scratch.
    • Create one call flow per phone number that appears on your website.
    • Go to Tracking > Numbers.
    • Assign your tracking numbers to the corresponding call flows.

    Detailed guide: Build a call flow

  2. Add a swap group

    • Go to Tracking › Tracking Code.
    • Under Number Swapping, click Add another swap group below your swap groups.
  3. Enter the number from your website

    For each group, enter the phone number exactly as it appears on your website under Swap Targets, and press Enter.

  4. Assign tracking numbers

    Assign at least one tracking number to each group under Swap with: pick the numbers, or click Select all. A group with no tracking number (or no swap target) shows a red message, and you can’t publish until you complete or remove it. Every tracking number with an online source must also be in a swap group: until it is, a warning says how many of your tracking numbers are not assigned to a swap group, and you can’t publish.

    Tracking Code

    The script that swaps numbers on your website and attributes visitors to calls.

    Call TrackingForm Tracking
    Number SwappingAttributionStorageBrowser DataAdvanced

    Number Swapping

    Configure how tracking numbers are swapped on your website

    1Sales
    Swap Targets
    (415) 555-0100
    Swap with:
    2 tracking numbers selected
    All online sources2
    2Support
    Swap Targets
    (415) 555-01102
    Swap with:
    (415) 555-01423
    Google Ads1
    Add another swap group1
    Each swap group pairs the number on your site (2) with the tracking numbers that replace it (3). Add another swap group (1) adds one more.

    Tip

    Enter the number with the same dashes, dots and brackets your page uses; only spaces are forgiving. If the page shows the number in two formats, add a swap target for each. Details: How swap target matching works.

  5. Save & Publish

    • Click Save & Publish.
    • Copy the generated script tag to your site.

🎉 Your swap groups are live. Visit your site to confirm each number swaps correctly.

Detailed guide: Rename a swap group
Detailed guide: Use span tags
Troubleshooting: Numbers not swapping

Rename a swap group

Giving each swap group a descriptive name, such as “Sales”, “Support”, or “Homepage Header”, makes them easier to manage and identify in reports.

Tip

Every swap group on the Tracking Code page has an editable name. New groups are named Swap Group 1, Swap Group 2 and so on until you rename them. Each name must be unique, and can be up to 100 characters.

  1. Go to Tracking > Tracking Code

    Go to Tracking › Tracking Code.

  2. Rename the swap group

    • Hover over the swap group name you want to change.
    • Click on it to make it editable.
    • Type the new name.
    • Click the green checkmark to save (or press Enter).
    1Sales1
    Swap Targets
    (415) 555-0100
    Swap with:
    2 tracking numbers selected
    Type the new name, then click the green checkmark (1).

🎉 The new name appears immediately across your swap group configuration and reports.

Detailed guide: Set up swap groups