# Swap groups

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: one swap group per source you measure separately

- Each swap group in Nimbata represents a pool of numbers assigned to a specific traffic source or audience.
- When a visitor arrives from that source, the DNI script swaps in a number from that group and attributes any resulting call to it.
- If two sources share the same swap group, you cannot distinguish calls from one versus the other.
- If each source has its own group, you can.

### Single source tracking

Use one swap group set to **All online sources** 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 a separate swap group for each major channel you want to measure independently:

- One group for **Google Ads (Paid Search)**
- One group for **Organic Search**
- One group for **Direct**
- One group for **Referral / Social**

With this structure:

- Each group requires its own pool of numbers.
- 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 a **Google Ads** or paid-search swap group.
- Nimbata captures the `gclid` parameter and passes keyword and campaign data alongside the call.
- You do not need a separate number per campaign.
- One paid search swap group 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 group
- **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](https://help.nimbata.com/tracking/number-pools#calculate-your-pool-size)\
Detailed guide: [How many numbers you need](https://help.nimbata.com/tracking/number-pools#how-many-numbers-you-need)

### Setting it up

Once you know your structure, create your swap groups and assign numbers accordingly.

Detailed guide: [Set up swap groups](https://help.nimbata.com/tracking/swap-groups#set-up-swap-groups)\
Detailed guide: [Tracking numbers: Number types and channels](https://help.nimbata.com/tracking/tracking-numbers#number-types-and-channels)\
Detailed guide: [What DNI is](https://help.nimbata.com/tracking/dni-setup#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](https://help.nimbata.com/tracking/dni-setup#set-up-dni-step-by-step).

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

   - Go to [Call handling > Call Flows](https://app.nimbata.com/call-handling/call-flows).
   - Click **+ Add**.
   - Create one call flow per phone number that appears on your website.
   - Go to [Tracking > Numbers](https://app.nimbata.com/tracking/numbers).
   - Assign your tracking numbers to the corresponding call flows.

   Detailed guide: [Build a call flow](https://help.nimbata.com/call-handling/call-flows#build-a-call-flow)

2. **Add and configure your swap groups**

   - Go to [Tracking > Tracking Code](https://app.nimbata.com/tracking/tracking-code).
   - Click **+ Add swap group**.

   For each group:

   - Enter the phone number exactly as it appears on your website.
   - Assign at least one tracking number to the group.

   ![Assign at least one tracking number to the group.](https://help.nimbata.com/_astro/01-image_tftt9u.DGLAXYo4_Zn1v5f.webp)

   > **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](https://help.nimbata.com/tracking/swap-targets#how-swap-target-matching-works).

3. **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](https://help.nimbata.com/tracking/swap-groups#rename-a-swap-group)\
Detailed guide: [Use span tags](https://help.nimbata.com/tracking/swap-targets#use-span-tags)\
Troubleshooting: [Numbers not swapping](https://help.nimbata.com/tracking/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:** Renaming is only available when you have two or more swap groups configured.

1. **Go to Tracking > Tracking Code**

   Go to [Tracking > Tracking Code](https://app.nimbata.com/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.

   ![Click the green checkmark to save.](https://help.nimbata.com/_astro/01-image_12sjqq3.CIXIv_iY_2uD07e.webp)

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

Detailed guide: [Set up swap groups](https://help.nimbata.com/tracking/swap-groups#set-up-swap-groups)
