Testing Dynamic Number Insertion

After you’ve installed the JavaScript snippet on your web page, use these testing methods to check that dynamic number insertion (DNI) is working and tracking numbers are swapping on your web pages. 

Getting Started

Install CallRail’s dynamic number insertion JavaScript snippet on every landing page and page of your site with a phone number. Each company in your CallRail account has its own, unique code snippet for call tracking.

Learn how to install your company's JavaScript snippet with this help article

Test JavaScript Installation

Use this test to confirm that the JavaScript snippet required for DNI is correctly installed on a web page. The instructions below cover installation via WordPress, Google Tag Manager, and manual insertion on your site's back-end. Testing is not available for installation via our Wix integration.

You must test each web page individually where you’ve installed the code snippet. Testing a landing page, for example, will not test your entire site.

  1. Click the Settings icon in the navigation bar on the left.

  2. Choose the company whose snippet installation you are testing.

  3.  Click the Integrations at the top of the page.

  4. Choose JavaScript Snippet from the list of integrations.

    NoteTesting is only available for installation via WordPress, Google Tag Manager, and manual insertion on your site's back-end.  

  5. Locate the field where you can enter your URL to be tested at the bottom of the section.


  6. Copy and paste the web page URL that you’d like to test and click Verify.   

  7. If your JavaScript snippet is properly installed, you’ll be alerted via messaging below the URL field.

    If your JavaScript snippet is not found or not properly installed, you’ll be alerted for that as well via messaging in the same location.

  8. If you are receiving a negative result but suspect it may be in error, follow the steps laid out in the next section to ensure dynamic number insertion is functioning correctly.

Manually Test Dynamic Number Insertion

Use these test methods to manually test dynamic number insertion. Because CallRail's swap code creates a cookie that remembers your previous website visits, you might think that dynamic number insertion isn’t working even when it is.

  1. First, Clear Your Cookies.

    Before you test, clear your cookies. Each test must be performed as if you are a brand new visitor; otherwise, number swapping will not work as expected. 

    If you prefer to test dynamic number insertion without clearing your cookies, you can do so by accessing the website in a private browsing window. Using a private browsing window (like Incognito mode in Google Chrome) lets you simulate yourself as a first-time visitor to the website. Please ensure no other private browsing windows are open when testing with this method.

  2. Simulate an Organic visit.

    For the purpose of this example, we’ll assume you’re testing a “Google Organic” tracking number.

    1. Clear your cookies, or open a fresh private web browser.

    2. Navigate to the source website (ie. Google.com).

    3. Search for your full URL on the search engine (ie. “www.yoursite.com”).

    4. In the search results, click the link to your website.

    5. Navigate to a page containing the phone number.

    6. Confirm that the tracking number is displayed. If so, congratulations, it works!

  3. Simulate a Google Ads click.

    For Google Ads, you can manually simulate a click without requiring you to click on an ad by appending "?gclid=test" to your URL.

    For example: https://www.yourwebsite.com/?gclid=test

  4. Simulate a Bing Paid click.

    Testing Microsoft Advertising requires a few more steps. Using the Mozilla Firefox web browser:

    1. Download the RefControl plugin --> RefControl

    2. Go to Tools --> RefControl Options --> Add Site

    3. Type in your site's address: “www.yoursite.com”

    4. Select Custom and type in http://www.bing.com

    5. Click "OK" then clear your cookies

    6. Append ?msclkid=test&wc_clear=true to your website's URL to simulate a paid click (for example, yourwebsite.com/?msclkid=test&wc_clear=true)

  5. Mimic mobile devices

    You can test dynamic number insertion for popular mobile devices like iPhones, iPads, Androids, etc using the Google Chrome browser's mobile emulation feature. Use the same techniques listed above for simulating visits when opening the source website using mobile emulation.

    The following Chrome documentation details the steps to enable the mobile emulation feature: Google Chrome Mobile Emulation


Does Dynamic Number Insertion work with caching plugins?

Certain plugins can cause the Javascript snippet to fail. Plugins like WP Rocket work by removing code that is deemed unnecessary to improve a page’s load time. This can often cause our Javascript snippet to be removed from your website. When this happens, the CallRail Javascript no longer loads on your website, and numbers will not swap properly.

We suggest either disabling these types of plugins, or adding an exception within the plugin for the domain cdn.callrail.com from JavaScript caching. 

What should I do if I keep getting error messages? If you keep getting error messages for numbers you expect to swap, try troubleshooting common dynamic number insertion errors.

Note: There are sometimes false negatives in this auto-test where your tracking number is actually swapping on your page. If you've checked all the troubleshoot items and still receive an error message, we recommend manually testing your web page to simulate a visit and see if your tracking number is swapping on your page.

If your tracking number is swapping, you can ignore any auto-test error messages. 

I’ve tried troubleshooting, but my number still isn’t swapping. What should I do? Reach out to our Support team if you continue receiving errors for tracking numbers you expected to swap on your page. Be sure to include which website you're testing when you reach out. We'll be able to double-check additional settings for your tracking number to see why it might not be swapping.