Follow us @mongoosemetrics on Twitter
Friend us on Facebook
 
 

Dynamically Publish Tracking Phone Numbers With Cookies

This article explains how to publish a Mongoose Metrics tracking phone number on landing pages and websites where the tracking phone number is passed in the destination link of a paid search ad and set to cookie. This method is ideal for advertisers who want to drive traffic through PPC/paid search and measure of those keywords that result in offline phone call conversions.

Tracking Phone Number Publishing Example Scenario

  1. Searcher clicks on paid search ad.
  2. In the destination URL of the ad is the tracking phone number.
  3. When the searcher arrives at the landing page/website through the destination link, the tracking phone number is set to a cookie on the searcher’s computer.
  4. From the set cookie, the tracking number is published on the landing page and if needed throughout the entire website.
  5. Since the tracking number is set to a cookie on the searcher’s computer, the tracking number will re-appear every time that searcher returns to the website.
  6. If the visitor does not arrive at the site through a paid search destination link that contains the tracking number, the website’s default phone number appears instead.
  7. As with all Mongoose Metrics tracking phone numbers, we export the phone call into your analytics package of choice whenever a call is completed.

Tracking Phone Number Implementation Instructions

This solution is entirely Javascript based and will work on any browser that is both Javascript enabled and that accepts cookies.

Step 1. This step has actually two parts. First, paste the js snippet code below on the landing page of your campaign. This should be the same page as the one containing your tracking phone number links to. This code will set the tracking number found in the URL to a cookie on the searcher’s machine.

Second, you must paste the same code in place of any phone numbers on your site. Paste the code in the body of your webpage wherever you wish for the phone number to appear. The js snippet will either publish the default phone number or the phone call tracking number depending on if the set cookie is found.

<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>

Step 2. Download the file MM_PhoneTracking.js by right clicking and saving this link.

Step. 3. On line 58 of MM_PhoneTracking.js you’ll need to replace the demo number with the default number of your website. The default number is the phone number you want dialed when the visitor did not arrive at your site through your campaign.

Step 4. Post MM_PhoneTracking.js 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.

Step 5. That’s it! To set the tracking number to cookie you must arrive at any page that contains the on-page js snippet and also have the tracking number in the URL. The snippet is used to both set the tracking number to cookie and/or display the tracking number. Remember to paste it on the entry page of your campaign and anywhere you want the phone number to appear.

The syntax of the url paramter is:
phone_number=8001234567

An example link is:
http://www.mongoosemetrics.com/?phone_number=8001234567

Additional Implementation Notes

Changing phone number format.
Both the default and tracking number must be stored and passed without formatting. You can change how the phone numbers will appear on the web page beginning on line 96 of the MM_PhoneTracking.js file.

Changing How Long The Cookie Is Stored
By default the cookie is set to save on the visitors machine indefinitely. If you need to change how long the cookie is kept before expiring you may do so on line 51 of MM_PhoneTracking.js

Get More Information

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


This entry was posted on Wednesday, April 30th, 2008 at 5:04 pm and is filed under Integration. You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.

Comments are closed.