Website Tracking Snippet

Install the CallScaler tracking snippet on your website to enable DNI and form tracking.

What is the Tracking Snippet?

The CallScaler tracking snippet is a small piece of JavaScript code that you add to your website. It powers both Dynamic Number Insertion (DNI) and form tracking. The snippet is lightweight, loads asynchronously, and won't slow down your site.

Installation

Copy the snippet code from your Number Pool settings page and paste it into your website. You can add it to the tag or just before the closing tag. If you use a tag manager like Google Tag Manager, you can add it as a Custom HTML tag.

text
<!-- CallScaler Tracking Snippet -->
<script src="https://your-domain.com/api/v1/tracking/snippet.js"
  data-pool-id="YOUR_POOL_ID"
  data-target="+1234567890"
  async>
</script>

Configuration Options

The snippet accepts the following configuration via data attributes:

  • data-pool-id (required) — Your number pool ID
  • data-target (required) — The phone number on your site to replace
  • async (recommended) — Load the script without blocking page rendering

How It Works

When a visitor loads your page:

1. The snippet reads UTM parameters, click IDs, landing page URL, and referrer from the browser
2. It requests a tracking number from your pool via CallScaler's API
3. It replaces your target phone number on the page with the assigned tracking number
4. It monitors for form submissions and sends form data to CallScaler
5. The assigned number stays with the visitor for the duration of their session

Testing Your Installation

After installing the snippet:

1. Open your website in an incognito/private browser window
2. Add UTM parameters to the URL (e.g., ?utm_source=test)
3. Check if the phone number on your site changes to a tracking number
4. Submit a test form and verify it appears in CallScaler's Forms page
5. Call the tracking number and verify the call shows attribution data

Use incognito mode for testing to avoid cached sessions showing stale numbers.

WordPress & Common Platforms

For WordPress sites, paste the snippet in your theme's header.php file or use a plugin like "Insert Headers and Footers." For Squarespace, go to Settings → Advanced → Code Injection → Header. For Wix, use the Tracking & Analytics section in your site's settings.