Troubleshooting Dynamic Number Insertion

If you received a “swap target not found” status for a tracking number you expected to swap, check these items on your web page to make sure your swap target can be located.

Getting Started

You must test each page where you’ve installed your JavaScript snippet separately. For example, entering a landing page URL will not test the entire website.

Learn how to install the JavaScript snippet for your company

Note: If you're running an automated test using CallRail's auto-test feature, each test will check the web page for all tracking numbers in your company. In this case, you may see some tracking numbers show as “not found.”   

Swap Target Formatting 

First, make sure the swap target number (the number you have assigned to swap with the tracking number) is present on the web page you’re testing. Then, check that the tracking number marked “not found” is a tracking number you intend to use on that page.

Read this help article for information on swap targets.

Once you've confirmed your swap target is on the page and you're troubleshooting the correct tracking number, continue by checking your swap target number formatting.

  1. Check for <span> tags that break up the swap target number. Sometimes this is intentional to prevent the number from swapping. If you’d like the number to swap, remove any <span> tags.

  2. Ensure the script is not nested inside another element such as an <iframe>, <header>, or <noscript> tag.

  3. Double-check that the swap target is present in the source code of your URL in one of the following formats:

    111-222-3333, 111.222.3333, and (111) 222-3333.

    To check this, view the source code on the web page and search the last 4 digits of the swap target to see if the swap target is on the page.

  4. If your swap target is a vanity number (ex. 888-CALL-NOW), please contact our support team to configure the vanity number to properly swap.


Are there other ways to test dynamic number insertion?

To manually test dynamic number insertion and simulate different kinds of web visits, follow these instructions.

How do I prevent a number from swapping?

If you don’t want your numbers to swap, use these two methods. When you run the DNI test, it will show these swap targets as “not found.”

  1. Add a <span> in the middle of a number that you don’t want to swap for example: 555-<span>444<span>-3333. The number won’t be recognized as a swap target.

  2. Or add the attribute data-calltrk-noswap to an element containing the phone number. When this is added, nothing inside that element or its child elements will be swapped.

    For example, if you have a text message link on your site and don’t want it to send a text to the tracking number, add the attribute to the anchor tag like this: `<a data-calltrk-noswap href="sms:14045551234">`

I've followed these instructions and I still don't see my number swapping.

There are a few things you'll want to check if you still don't see your number swapping after testing dynamic number insertion:

  1. Your site may be cached on your internal network. Try accessing your website in a private browsing session (like "incognito" mode on Google Chrome). 

    If you suspect this to be the case, we strongly recommend testing your website on a computer that has not been to the site previously. Alternately, if no computer is available, please contact our Support department and we’ll be happy to verify your number’s swapping for you.

  2. The swap target may be incorrect. The swap target is the telephone number CallRail looks for on your website to dynamically replace with a tracking number. By default, the swap target is the destination number, but you can specify a different swap target for each tracking on the number configuration page. Use our instructions on Swap Targets to verify or change your swap settings.

  3. CallRail's swap code may not be placed correctly in the site's code. It’s important that our swap script is as close as possible to `</body>` tag in your site's code. This helps ensure that our swap code is one of the final things on the page to load. If you have placed it too far above the `</body>` tag, other pieces of code from other sources could be conflicting with our swap functionality. While uncommon, if you suspect that another website's JavaScript could be interfering with CallRail, we recommend removing or rearranging your other JavaScripts to see if this solves your problem.