Dynamic Number Insertion Overview

CallRail's JavaScript snippet allows you to add call tracking to your website using dynamic number insertion. 

In order for dynamic number insertion to swap a number on your website, you’ll need to have the following in place on your website:

- A visible telephone number within HTML or an image

- A telephone number in one of the following formats: 111-222-3333, 111.222.3333, or (111) 222-3333

How Dynamic Number Insertion Works

First, install CallRail’s JavaScript snippet on your site. Each company in your CallRail account has its own, unique script for call tracking. The installation is just like installing Google Analytics— a single JavaScript snippet added to each page of your website before the '</body>' tag.

Then, you’ll create tracking numbers within your CallRail account to track visitors from single sources with source tracking or all sources using a website pool of tracking numbers. When a visitor navigates to your website through one of the sources you’re tracking, CallRail’s JavaScript will detect the phone numbers on your web page and swap them with the correct tracking number. We’ll then store the visitor’s source in a cookie so they’ll continue to see the same tracking number each time they return to your website (unless the JavaScript snippet is removed).

There are several ways you can install dynamic number insertion on your website. Here are our other articles that will guide you through these methods:

  1. Install the JavaScript snippet directly to your website
  2. Use CallRail’s WordPress plugin
  3. With Google Tag Manager

Important Definitions

Destination Number: The number that rings at your business when one of your tracking numbers is called. This is where your calls are routed. Usually, your business number.

- Tracking Number: One or more telephone numbers that route to your destination number and allow you to track incoming leads. These tracking numbers replace your business number on your website using the JavaScript snippet's dynamic number insertion feature.

- Source Tracking Number: A single, static tracking number that tracks one campaign source. For example, a billboard or a Google ad extension.

- Website Pool: A pool of numbers that dynamically swap based on how a lead routes to your website and is able to capture visitor-level data like pages visited, PPC keywords, etc. This also allows for more extensive lead reporting like CPL and keyword reporting. 

Cross-Subdomain Call Tracking

Cross-subdomain tracking allows your website visitor’s referring data to be carried across subdomains. This allows CallRail’s dynamic number insertion script to show the same tracking to a visitor as they navigate across subdomains on a website (i.e. from http://campaign.example.com to http://example.com).

By default, every CallRail account is set up to track across subdomains. If you signed up for CallRail before March 2015, contact our support team to request that cross sub-domain call tracking be turned on for your account.

Swap Precedence Rules

When tracking multiple sources using dynamic number insertion, what happens if a visitor matches two or more of your swap criteria? CallRail’s JavaScript snippet has swap precedence rules in place that dictate the order in which tracking numbers will appear in these types of situations.

For example, if you have the following setups, you would want to be sure the tracking numbers were not interfering with one another:

- A source tracking phone number for "Google Ads" and another source tracking number for "All Search."

- A source tracking phone number for a landing page parameter, and a website pool for "All Visitors."

The following sources are listed from highest priority to lowest priority. Earlier rules in this list take precedence over later rules.

  1. Landing page parameter swaps (Example: utm_campaign=mycampaign) and landing page URL options are equal (example: Visitors who land on www.landingpage.com)

  2. Specific referring URLs (Example: Google PPC, yelp.com, direct visitors)

  3. Referrer groups (Example: Google Search, All Search, Organic Search, PPC Search)

  4. Source tracking numbers set to "Always Swap"

  5. Website pools

This means that any source tracking number will always take precedence over a website pool.  If you create a website pool to replace a source tracking number, you should set the swap setting on the original source tracking number to "offline" (or disable the unused phone number completely) to allow the website pool to function.