To track calls back to your online advertising campaigns, you will want to use CTM’s tracking code to dynamically display tracking numbers on your website.
The tracking code is a script that determines the advertising channel that led a visitor to your website and shows the tracking number that corresponds to that channel.
This provides powerful in-the-moment information for your agents and is the data that populates your advertising reports.
Watch the Tracking Code video tutorial.
Installing your Tracking Code
- Go to Numbers → Tracking Code.
-
Copy and paste the code into the top of your content in the <head> section of each page you are planning to track. If you use a template, you may enter it there instead.
-
Test the code to make sure it is working as expected.
You only have to add this code once to your website. The code will not need to be updated or re-installed if you modify your account (allocate new tracking numbers, modify account settings, etc.).
Number replacement can be blocked by slow scripts on your site, so we recommend placing our script before slower scripts to prevent visitors from seeing your original number being replaced as the page loads. Be advised that any additional dynamic number scripts running on the same site will interfere with the normal operation of the CallTrackingMetrics dynamic number insertion.
For Advanced Tracking Script Options, please refer to our API Integration guide.
Click below for installation directions specific to the following platforms:
Set Your Cookie Duration
Another critical function of the CTM tracking code is that it remembers your visitors to continue to show them the tracking number that they saw when they first came to the site. This allows the software to attribute the call back to the original visit so you know which ad was the one that first got their attention.
1. From the Tracking Code page, select “Cookie Settings” from the left-hand menu.
2. Set the duration of days that visitors will be associated with the original tracking source. (By default, the system is set to 30 days. Setting the value to 0 will disable cookies).
3. Click ‘Update Settings’ to save your changes.
Using third-party cookies will be helpful if people go to a separate landing page before coming to your domain. If you prefer not to use cookies for your visitors, you can enable “Last Touch” for the tracking source. With this feature enabled, visitors will always be shown the tracking number that matches the most recent channel they used to get to your site.
Delaying the Tracking Code
To delay running the Tracking Code, add the following script to the Tracking Code page:
var ctmAlreadyRun = false;
window.CTMSourceEvent = function(event) {
if (ctmAlreadyRun) { return; }
if (event.state != 'before') { return; }
setTimeout(function() {
__ctm.main.runNow()
ctmAlreadyRun = true;
},1000);
// console.log(event);
}
You can also add the following if you need the Tracking Code to run after some interaction with the page, such as clicking a button to show a number:
__ctm.main.runNow(changedElement)
Changed element is the button click or object that needs to be interacted with to fire the code again.
Comments
Article is closed for comments.