Mongoose Metrics Home

Archive for the ‘Integration’ Category

How To Create Email Alerts From Phone Call Tracking Numbers

Thursday, May 22nd, 2008

This how-to article will show you how to create your own custom email alerts that triggers when a Mongoose Metrics phone number is dialed. The email alert can contain all the call details from the phone call including incoming caller phone number and call time duration. To implement this feature you’ll need access to a web server that can send email through a scripting language processed on a web page. Our example will make use of PHP’s mail function.

Understanding Mongoose Metrics Dynamic Variable Insertion
With all Mongoose Metrics phone call tracking numbers you can elect to have a URL visited every time the tracking number is dialed. However, an advanced version of this feature exists which enables you to dynamically append to your elected URL variables which will be populated real-time with the phone call details.

As an example, a URL with the parameter syntax of :
http://www.mongoosemetrics.com?incoming_caller=CALLER_PHONE

would construct the URL if dialed by the number 216.502.2750:
http://www.mongoosemetrics.com/incoming_caller=2165022750

The above example makes use of the Mongoose Metrics dynamic variable CALLER_PHONE which acts as a place holder in the URL string. When the tracking number is dialed and the call is completed, the Mongoose Metrics phone server will see this place holder variable in your URL string and replace it with the actual data from the live call.

Here are some of the dynamic variables available:

CALLER_PHONE - The incoming caller’s phone number.
CALL_DURATION - The total billable length of the call.
CALL_DATE - Date of the call.
MONGOOSE_NUMBER - Trackable phone number which was called by caller.
CALL_DESTINATION - Destination number that trackable number points to.

Step One - Construct Your Tracking URL

  • From the ‘Trackable Number’ tab in our Mongoose Metrics account, click on the ‘configure’ link to the right of your tracking number.
  • Next, construct your URL which will be visited every time your tracking phone number is dialed. To send to your email alert meaningful information about the call, use some of the above dynamic call variables in your URL string. Here’s an example URL string which would be placed after the domain name portion of your URL: /?phone_number=CALLER_PHONE&call_time=CALL_DURATION

When the tracking number is dialed, Mongoose Metrics will construct the URL string and visit the URL. The phone server will replace CALLER_PHONE and CALL_DURATION with the actual data from the phone call. In this way you have now passed from the phone call the call detail information and sent it to a web server for further handing.

Step Two - Creating An Email Script

Our example will use PHP’s mail function. To review, we now will have a web page visited every time a tracking number is dialed and the web page will be visited by the Mongoose Metrics phone server with a URL string that’s populated with the phone call details. You next have to grab the data found in the URL string and insert this into your email alert message. With PHP this is fairly straight-forward. Here’s how:

On the web page that the Mongoose Metrics phone server will visit place this code snippet above your<html> tag. This code example will look for the URL parameters phone_number and call_duration. If it finds these parameters in the URL string, it will grab their values and send them off in an email.

<?PHP
$phone_number = '-1';
if (isset($HTTP_GET_VARS['phone_number'])) {
$phone_number = $HTTP_GET_VARS['phone_number'];
}
$call_duration = '-1';
if (isset($HTTP_GET_VARS['call_duration'])) {
$call_duration = $HTTP_GET_VARS['call_duration'];
}
?>

Next you need to paste anywhere in the web page code so long as it’s below the above snippet the code that actually sends out the email. Here’s some example code to get the job done. It may be adapted to your needs of course.

<?PHP
if ($phone_number <> '-1') {
$to = 'me@mydomain.com';
$subject = ' '. $phone_number .' | ' . $call_duration .' - Phone Call Alert';
$message = '';
$headers = 'From: alerts@mydomain.com' . "\r\n" .
'Reply-To: noreply@mydomain.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
}
?>

The above code example will send an email with a subject line only. In the subject line will be the incoming caller’s phone number and call time duration.

Adaptations And Uses

The above information gives you the basic picture and setup. From this you can now fire off email alerts whenever your tracking number is dialed. Keep in mind that since this implementation requires you to develop your own processing code to construct the email, the variations on what you can do are endless. Here are some additional examples of how to further adapt this method:

  • Send the email if the call duration is over or under a certain call duration length
  • Send the email to different recipients based upon the area code of the incoming caller
  • Send the email if a specific tracking number is dialed
  • Send the email if it’s called from a specific keyword or campaign
  • Send the email based upon the time of the call
  • Instead of an email, why not insert the data into the server’s database for additional processing or advanced metrics. This could include associating the incoming caller’s phone number with a web sales or lead generation conversion or archiving the data as apart of a longer sales cycle.

Ok, we have given you some example of what you can do with this method, but why send email alerts from trackable phone numbers in the first place? Only you can decide if this implementation provides value to your online marketing campaigns. However, here are some examples of how Mongoose Metrics customers can make good use of this method.

  • Missing Calls. Phone call conversions from paid search campaigns can be quite valuable depending upon your market. We can all see missed calls with our existing phone systems already and Mongoose Metrics call detail reports will show you complete call logs. But lets face it, in a sea of phone calls and missed phone calls sometimes you (or your clients) can still miss the message and not return the call as quickly as possible.  If you’re on the go or on the phone a great deal, missing phone calls is a part of life and email alerts can provide a tremendous amount of urgency and clarity in deciding who needs to be called back first.
  • Sales Management. When phone call leads are valuable. Looking at call detail reports at the end of the day or at the end of the week sometimes isn’t fast enough. Email alerts can be constructed for sales managers so that they can easily see what’s going on with phone call leads and have a quick measurement of call volume and phone call time durations.
  • Client Notification. We are swamped with data and reports. In many business environments it’s just not realistic to expect clients to log into reports and invest time digesting the data. Yet clients still want to know what’s going on. If a simple subject line email makes the difference between communicating the right information the right way, it can make all the difference in the world.
  • Flexibility. At the heart of Mongoose Metrics philosophy is delivering a phone call tracking service that’s flexible and can deliver phone call tracking data however and where ever you need it to go.  Sending email alerts with phone call details is another example of our commitment to provide information that is adaptable to your way of business.

How To Set-up Phone Call Tracking With Google Analytics

Thursday, May 1st, 2008

This page provides step by step instructions as well as common questions regarding how to integrate Mongoose Metrics’ Phone Call Tracking service with Google Analytics.

Set-Up Instructions

  1. Create a Mongoose Metrics account. There is a demo code on the sign-up page. Use the code to fully test the service risk free. With all demo accounts you will not be charged, however you must place your credit card on file with our service.
  2. Provision a Mongoose Metrics tracking phone number. After provisioning the number you must do two things:a) Map the tracking number to a destination number. The destination number is the phone number that will ring when the tracking number is dialed.b) Next, within the ‘Trackable Phone Number’ section of your Mongoose Metrics account click on the ‘web analytics’ link next to your tracking number. This will take you to the web analytics set-up page. Once there, enter the URL which the Mongoose Metrics’s phone server will visit once the tracking phone number is dialed. We suggest you use the Google Analytics URL Builder tool in order to properly tag the URL. When the URL is properly tagged with a campaign, keyword, medium and source the call event will appear in the ‘Campaign’ section of your Google Analytics reports.
  3. Ensure that the URL you have designated the Mongoose Metrics phone server to visit has your Google Analytics js snippet on the web page. If you have already set-up Google Analytics this step should be complete.

That’s it! When the tracking phone number is dialed, the Mongoose Metrics phone server will issue an automated browser visit your specified URL. This will represent the call activity back to your Google Analytics reports.

Frequently Asked Questions

How is the phone call event represented in my Google Analytics reports?
A phone call is expressed as a unique visitors with one page view. By using the Google URL Builder to help define the medium of the campaign as, ‘phone’ you can infer that one unique visitor is equal to one phone call. The image below taken from a Google Analytics report demonstrates how the phone call event will appear in your account when defining the medium as ‘phone’ in the link to your tracking page.

Where do I view Mongoose Metrics phone call activity within my Google Analytics reports?
We suggest using the Google Analytics URL Builder in order to properly tag the tracking URL of your hidden web page. In the tracking URL define campaign medium as possibly ‘phone’ and use campaign name to represent the name of your marketing campaign where the tracking number is placed. To view offline phone call activity you can click on ‘Campaigns’ in the left menu of Google Analytics under the ‘Traffic Sources’ section. From there, you’ll see the campaign of the offline tracking phone number if you tagged the link using the Google URL Builder.

How are calls which are not answered handled?
If the tracking phone number is dialed and connected to the destination number, our phone call server will place a visit to your hidden tracking page. This will include calls that go unanswered.

I’m using paid search, how can I track in Google Analytics the keyword that delivered the offline phone call?
This can be accomplished by passing the tracking number in the destination link of your ad and from there publishing the tracking number to the landing page. You will need to provision a separate tracking number for each keyword, ad group or campaign you wish to track. Click here to see detailed set-up instructions.

Dynamically Publish Tracking Phone Numbers With Cookies

Wednesday, April 30th, 2008

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 have a measurement of which keywords in the paid search campaign resulted 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, should the searcher return to the website at a later date, the tracking number will re-appear.
  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 in its place.
  7. With all Mongoose Metrics tracking phone numbers, when the phone number is dialed, the phone call event will be injected into your analytics package of choice.

The above scenario demonstrates how paid search campaign managers can use Mongoose Metrics phone call tracking numbers in their campaigns and gain key insights into which keywords convert to offline phone calls.

Tracking Phone Number Implementation Instructions

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

Step 1. This step has two parts. First, paste the below on-page js snippet of code on the landing page of your campaign. This should be the same page that your destination link containing your tracking phone number links to. This code will set the tracking number found in the URL to a cookie on 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 where-ever 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 24 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 on-page snippet is used to both set the tracking number to cookie and/or display the tracking number so 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:
tracking_number=8001234567

An example link is:
http://www.mongoosemetrics.com/?tracking_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 46 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 12 of MM_PhoneTracking.js