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


Auto-Test Dynamic Number Insertion

Use this auto-test to confirm that the JavaScript snippet is correctly installed on a web page. This test has two parts. First, it validates that your snippet has been installed in the correct location before the </body> tag. Then, it checks that your tracking numbers are swapping on your site.

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 Analytics in the navigation bar on the left.

  2. Click Settings at the top of the page.  

  3. Choose the company whose snippet you are testing.

  4.  Select All Integrations from the Integrations section in the left menu. 

  5. Choose the JavaScript Snippet integration.  

  6. Scroll down to the section titled Test JavaScript Snippet, at the bottom of the page.

  7. Copy and paste the web page URL that you’d like to test and click Start Test.   

  8. If your JavaScript snippet is properly installed, you’ll see a green checkmark in the Code Snippet Status section.
  9. If your JavaScript snippet is not found or not properly installed, you’ll see a yellow alert with instructions on how to fix your code installation and a date stamp of your last test.

    If the code snippet is not in the correct location, your numbers can’t swap so the second part of the test will not be performed. 

  10. In the Tracking Number Status section of the test, it’s important to note that we’re testing all the tracking numbers in your company. So, some numbers that show up as “not found” are not a problem. Only troubleshoot tracking numbers you expected to swap on the page you are testing.

    Screen_Shot_2018-08-14_at_12.48.10_PM.png
  11. Tracking numbers that are properly swapping on the page you’re testing will show a green checkmark in the Status column.

    Auto_DNI_Test_-_V2_Preview_Mode_-_InVision_2018-07-05_14-09-36.png

  12. Click the eyeball icon in the View column to see a live swap example of the tracking number swap on your page.

  13. This screen will show a screen capture of the tracking number swap that happened with a date and time stamp of when the swap occurred.  

    Auto_DNI_Test_-_V2_Preview_Mode_-_InVision_2018-07-05_14-11-07.png

  14. There will be a yellow alert message in the Status column for numbers that aren’t swapping on the single web page you’re testing.

    Remember, we’re testing all the tracking numbers in your company. This alert isn’t a problem for tracking numbers that won’t be used on the specific web page you’re testing.

  15. If it’s a tracking number you expected to swap on the page, click the Troubleshoot link to view a help article on troubleshooting common errors that will prevent a number from swapping.

    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 (next section) your web page to simulate a visit.

  16. You can also select the Number Name to be sent directly to the edit page for that number so you can make any configuration changes needed.

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

    If you’re having trouble, we’re happy to help. Contact us and be sure to include a link to the website where you've installed the dynamic number insertion code.

FAQs

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. They’ll be able to double-check additional settings for your tracking number to see why it might not be swapping.