Troubleshooting Number Swapping
If you’re experiencing issues with your number swapping, the suggestions on this page are designed to help you identify what’s causing the number swapping to not work. Issues with number swapping typically fall into three categories:
- Issues with the tracking code
- Issues with the tracking source
- Issues with the target number
Whenever you test number swapping, make sure you carefully follow all of the steps as detailed in this article. You must always use a new private window when testing (simply clearing the cache is not reliable), make sure no other windows or tabs of the same type are open, and do not let the URL bar auto-complete.
Tracking Code Issues
In order for the numbers to swap on your website, the tracking script must be installed. You can find the instructions for tracking code installation here.
To verify the correct tracking code is running on your site, open your browser’s development console and enter __ctm.config.aid (there are two underscores at the beginning of the command).
- If you receive an error message or get no results, that means the script is not running on the page.
- Check to make sure the script has been added to your site’s source code. You may need to re-publish.
- Make sure there are no alterations to the tracking script; it should appear exactly the way it does on the Tracking Code page in your account.
- If the console returns a value that does not match your account ID, that means the wrong script is running on the page.
Tracking Source Issues
The rules defined in your tracking source triggers will determine when the tracking number(s) assigned to that source will be allowed to swap. If the string the source is set to look for does not appear in the visitor’s landing URL, or if their referring URL doesn’t match what the source is looking for, the number will not swap.
Check your tracking source by navigating to Numbers → Tracking Sources, then click edit next to the name of the source you’re testing.
- Open your tracking source and make sure the “onsite” toggle is set to “on.” Off-site sources will not be dynamically swapped on your website.
- In the source settings, make sure the trigger is defined. If both the referring and landing URL are blank, the source will only work for a visitor coming directly to your website (through a bookmark or by manually typing the URL).
- Keep in mind that if both the referring URL and landing URL are defined, both conditions must be met. For example, if you have “yelp.com” in the referring URL field and “yoursite.com” in the landing URL field, the source will only work for a visitor who navigates from yelp.com to your site. It is often best to use either the referring URL or the landing URL rather than using both.
- The source trigger field is a regular expression, which means many characters that are common in website URLs (such as hyphens “-“) can cause the source to not work. We recommend using the regular expression builder when creating custom sources. Learn how to use the regular expression builder here.
- Source position defines the order in which the script will try to match a visitor to your source. If the source you want a visitor to match is at position 100, but their web session also matches the trigger for the source at position 3, then the number for the source at position 3 will be shown. Check higher-priority sources to make sure the source triggers are unique.
Target Number Issues
The target number is the number that will be replaced on your website or landing page. In order for the script to read and replace the target number, it must be assigned to the tracking number that you want to have appear in its place. You can find more information on target numbers here.
Check your tracking source by navigating to Numbers → Target Numbers.
- You must have at least one phone match target number assigned to your tracking number. If the number you need to replace is a vanity number or has unusual formatting, make sure you have both an exact match and a phone match assigned.
- Sometimes, even if you are not using a vanity number, an exact match target number is needed for the script to identify the number on your site. Adding an exact match target number is a good first step in troubleshooting number swapping and resolves many common number swapping problems.
- If you are replacing multiple numbers on your website and they are located close to each other in your source code, you may need to place <span> tags around each individual number so the code will read both of them correctly.
- ex: <span>555-123-4567</span> <span>555-765-4321</span>
- If you have duplicate target numbers in your account, remove the duplicates. Duplicate target numbers have been known to cause issues with number swapping.