How to track customer phone calls generated through Adwords

A lot of you (or your clients) will be using Google Adwords to drive traffic to your websites whenever people search on appropriate keywords.  If you’re keen on doing this properly, you will also be using Google Analytics and it’s ‘Goal’ functionality to track whether or not these Adwords customers are converting in to online sales or enquiries.

But what if you also have a sales or enquiries phone number on your website?  And what if the person who clicked on your Google Adwords ad prefers to phone you up, rather than fill in an online form?  (This could be for any number of reasons, not least because they are wary of entering credit card details online).

Google Analytics doesn’t have anyway of tracking this – after all, it can’t see if someone is dialling your number.  But there is a way of finding out how many Google Adwords visitors do go on to call you, and it goes like this:

To track how many Google Adwords visitors turn in to phone based sales or enquiries you will need:

- the ability to add a line in to the header of each page that an Adwords visitor is likely to land on

- each page that displays a phone number to be a PHP page (I’m not in to ASP, so I’ll leave it to some future visitor to give the ASP equivalent of this.)

- and a separate phone number that your Adwords visitors can call in on (that is different to your regular phone number)

OK, firstly, we need to flag up our visitors as Adwords ‘clickers’.  If you’ve ever clicked on a Google virility penis enlargement pills review ad, you’ll notice that “?gclid=” followed by a long string of numbers is added to the URL of the first page you visit.  This is our way of identifying Adwords visitors, and we do it like this:

<?php

if ($_GET['gclid']) {

$expire=time()+60*60*8;
setcookie(“Believe_Adwords”, $_GET['gclid'], $expire);

}

?>

What this does is check whether or not the ?gclid exists (the ‘if’ part of the statement) and if so, it sets a cookie with a name of “Believe_Adwords”, content which is the gclid value (this isn’t really important) and an expiry time of 8 hours.

Next, we need to display the specific Adwords phone number to these visitors, and this is done by placing the following code wherever your phone number is currently displayed:

<?php

if (isset($_COOKIE['Believe_Adwords'])) echo “555-0968-5566“;

else echo “555-8979-4567“;

?>

Note: you will need to amend the numbers highlighted in bold, ensuring that you put the Adwords specific phone number after the ‘if’ statement, with your regular phone number after the ‘else’ statement.

ALSO NOTE: WordPress changes quotes and single quotes in to ‘curly quotes’ – you will need to convert these in to regular quotes if simply copy and pasting from this site. (Add installing the proper code highlighter mod to the to-do list :) )

This will display the Adwords specific phone number to anyone that has a cookie set (i.e. anybody who visited by clicking on an Adwords ad) whilst displaying your usual phone number to everyone else.  What this now allows is for you to use the report of phone calls received to the Adwords specific phone number to see how many Adwords visitors turned in to sales.  Simple!

14 thoughts on “How to track customer phone calls generated through Adwords

  1. Good tip – people often forget about this kind of ‘conversion leakage’ when they track their Adword ROI through Analytics or similar when it could be the difference between a worthwhile campaign and a waste of money!

  2. Pingback: I see clicks in Adwords but they don’t show in Analytics | Web | Believe Design - anything is possible...

  3. I’ve tried your php phone number cookie however when you navigate to another page on the site the original (non-google) number seems to be displayed. Do you have a work around for this problem?

    I’ve taken it a step further and used it in a php include which displays the number in my sidebar navigation sitewide. Maybe this is the problem?

    Otherwise it works fine if you stay on that first landing page.

  4. If I put the cookie on the landing page I have to refresh the page to see the changes made by the cookie on the page? Am I doing something wrong?

  5. Hey Adam,

    As long as the cookie is being set before your call to display the phone number, then it should display the correct one immediately.

    Is this the case?

    Otherwise you could try posting your code up here, so I can take a look?

    Rob

  6. Tracking phone responses from Google Adwords is extremly helpful in determining how to focus your pay per click campaigns. I am wonder if there is a way to do the same thing in Yahoo. I there a code or cookie available for Yahoo?

  7. I’ve tried to implement the above code and I am getting the following error. Cany suggestions. Thank you in advance.

    Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in /services9/webpages/l/o/lonestarreversemortgage.com/public/thankyou.php on line 83

  8. For your error, it’s not really possible to work out what the issue is without seeing your code – if line 83 doesn’t have a problem on it, check out the lines of PHP before this line for any missing ” ‘ ; , or } !

    For tracking yahoo, you can use the same approach – I’ve never advertised with Yahoo but I guess that when someone clicks through on an ad in Yahoo, they will add something to the URL just like Google add “?gclid=”

    For the purposes of dem:oing, lets say they add ?yclid=

    if ($_GET['yclid']) {

    $expire=time()+60*60*8;
    setcookie(”Believe_Yahoo”, $_GET['yclid'], $expire);

    }

    and then

  9. if (isset($_COOKIE['Believe_Yahoo])) echo “555-0968-5566“; // no. for Yahoo visitors

    else echo “555-8979-4567“; // no. for everyone else

  10. This is a great post, but I’m not having any luck getting this to work for me. In the second code snippet, I noticed that there is no closing ‘ in $_COOKIE['Believe_Adwords].

    I added the ‘ and it still didn’t work for me anyways. I’ll keep plugging away at it.

  11. Good point Nick – I’ve added in the errant apostrophe now. It should work with that in place – let me know what further problems you are seeing if it doesn’t.

  12. question:

    what if i just wanted to use adwords to generate a customer call…no web site….could i write the phone i wanted them to call instead of the clickable link

  13. This is a great post… Just what I was looking for… I think you could also use a session variable instead of a cookie… Session variables should do the job nicely.


Comments are closed.