> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.nimbata.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to set up span tag

# How to set up span tag

The span tag method gives Nimbata an explicit target to swap, rather than scanning the page for a matching number. 
Use it when auto-detection is unreliable. For example, when your number is rendered dynamically by JavaScript, a page builder, or a CMS template.

### How it works

When **Span Tag** is selected as the swap type, Nimbata's script finds `<span>` elements with the correct class name after the page loads and replaces their contents with the assigned tracking number. The original text inside the span (if any) is ignored.

### Required span format

Place the span exactly where you want the tracking number to appear:

```
<p>Call us at <span class="nimbata_number_1"></span> for more information.</p>
```

The class name follows the pattern `{prefix}_number_{swap_group}`:

* **Prefix:** `nimbata` for standard accounts, or your white-label name (lowercase) for white-label accounts.
* **Swap group number**: matches the swap group index in Nimbata (1, 2, 3, etc.).

Both of the following work identically; the original text inside the span is replaced either way:

```
<span class="nimbata_number_1"></span>
<span class="nimbata_number_1">555-555-5555</span>
```

### Step 1. Select Span Tag as your swap type

* Go to [Tracking > Tracking Code](https://app.nimbata.com/tracking/tracking-code).
* Under **Swap Type**, select **Span Tag**.

![](https://storage.crisp.chat/users/helpdesk/website/-/2/f/4/5/2f459a49cf382400/screenshot-2026-01-27-165525_1jca3sb.png)

### Step 2. Configure your swap groups

Set up your swap groups and assign a tracking number to each one.

### Step 3. Save & Publish

* Click **Save & Publish.**
* Add the span tags to your site's HTML where you want tracking numbers to appear.

### **Span Tag implementation example**

* Use the example below as a reference when adding span tags to your website. 
* Place the `<span>` tag exactly where you want the tracking number to appear. 
* Once the page loads, Nimbata automatically replaces the span with the correct tracking number based on the assigned swap group:

<p>
  Call us at
  <span class="nimbata_number_1"></span>
  for more information.
</p>
---

🎉 Visit the page to confirm the span is replaced with the correct tracking number.
Detailed Guide: [**How to set up swap groups**](https://help.nimbata.com/en/article/how-to-set-up-swap-groups-1kng9t9/)
Troubleshooting: [**Why are numbers not swapping?**](https://help.nimbata.com/en/article/why-are-numbers-not-swapping-on-my-website-dfo4sa/)
