Dynamically Publish Phone Call Tracking Numbers
Mongoose Metrics allows you to dynamically publish tracking numbers so that you can easily track incoming phone calls from both organic and paid search campaigns. The following steps will help you implement the cookie needed to record visitors from a link with the tracking number in the destination URL. Once installed, the cookie will merge the conversion directly into your web analytics program.
Advertisers that want to track both organic and paid search campaigns down to the keyword level can do so by implementing the following methodology. When a person visits a site, a tracking number appears that corresponds to a certain keyword or campaign. When called it will represent a conversion for that keyword.
To start dynamically publishing phone numbers on to your site you must place a simple java script code onto your website. It is usually best placed where your phone number appears. This will allow your tracking number to display on your webpage whenever a visitor to your website comes from a tracked campaign.
To get a better understanding of how the cookie works, here is a simple example:
- A user clicks on a paid search ad or organic link to your website
- In the link, the tracking number is in the destination URL. For example the link is www.mysite.com/ ?phone_number=8001234567 where 8001234567 represents the tracking phone number for that given advertisement.
- When the visitor arrives at the site a cookie is placed onto his or hers browser so that the tracking phone number shows anywhere on the site with the java script code.
- If the visitor calls the number that is shown, the call will be tracked in both your Mongoose Metrics account and your web analytics account
Note- If a user does not come from a tracked campaign your default number will appear and not be tracked.
To successfully implement the cookie follow these steps:
- Place the following java script code on the landing page and anywhere else on your site that you want the tracking code to appear on.
<script language="javascript" src="/MM_PhoneTracking.js"></script>
<script language="javascript" >
key = getVar("keyword");
tn = getVar("phone_number");
source = getVar("source");
content = getVar("content");
campaign = getVar("campaign");
if(tn!="")
{
setcookie(key,tn);
}
getcookie(); //call getcookie function to retrive the cookie
</script>
The code will then show the phone number correlated with the tracking number located in the destination URL. If you do not wish to show the number on a certain page then do not replace your default number with the code.
- Save the following script to your computer and edit line 58 with your default phone number
- Post the script to the root directory of your site. If you want to post the file elsewhere that’s fine but be sure to edit the on-page js snippet which references the path.
If successfully implemented, you will now be able to track phone calls generated from your online campaigns. If a visitor arrives to to your site from a linke with the tracking number then that number will appear wherever you placed the java script code.
Additonal Information:
Phone Number Format
If you wish to change the format of the phone number, please go to the line 96 of the java script file and change the formatting to your liking.
Cookie Length
By default, the cookie is set to save on the visitor’s machine indefinitely. If you need to change how long the cookie is kept before expiring you may do so on line 51 of the java script file
Mongoose Metrics offers simple to use enterprise class phone call tracking services for both online and offline marketers. We want to understand your needs. Please complete the form below and a Mongoose Metrics representative will contact you shortly. You can also contact us directly at 877-784-0496
