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:
nimbatafor 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.
- Under Swap Type, select Span Tag.

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
Troubleshooting: Why are numbers not swapping?
Updated on: 30/03/2026
Thank you!