AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Ads
4.3K members online now
4.3K members online now
Learn how to reach mobile device users, drive phone calls, and increase app installs
Guide Me
star_border
Reply

Website Call Tracking - I must be missing something

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

I have two different section on my site with my number.  1 is clickable and the other is not.

 

I setup the call tracking for websites and that is in the header.

 

<script type="text/javascript">
(function(a,e,c,f,g,h,b,d){var k={ak:"123456789",cl:"123456789GoQ14i5oAM"};a[c]=a[c]||function(){(a[c].q=a[c].q||[]).push(arguments)};a[g]||(a[g]=k.ak);b=e.createElement(h);b.async=1;b.src="//www.gstatic.com/wcm/loader.js";d=e.getElementsByTagName(h)[0];d.parentNode.insertBefore(b,d);a[f]=fu... Date,e)};a[f]()})(window,document,"_googWcmImpl","_googWcmGet","_googWcmAk","script");
</script>

 

( Numbers changed to protect privacy)

 

The second code I have in the header for the clickable link is

 

<script type="text/javascript">
var callback = function(1-800-123-4567, +18001234567) {
var e = document.getElementById("number_link");
e.href = "tel:" +18001234567;
e.innerHTML = "";
e.appendChild(document.createTextNode(1-800-123-4567));
};
</script>

 

Next up is the two code to call the number.  1 is clickable and the other is not.

 

Clickable Call Forwarding / Replacement code

 

<body onload="_googWcmGet(callback, '1-800-123-4567')">
<a href="tel:18001234567" id="number_link">
1-800-123-4567</a>
</body>

 

Non clickable Call Forwarding / replacement code

 

<body onload="_googWcmGet('callback', '1-800-123-4567'')">
<span class="callback">1-800-123-4567'</span>
</body>

 

I have call extensions and a Call Only ad setup for the campaign.  It's been a few days and still no forwarding number appears for both Desktop and Mobile traffic.  I'm not really sure how else to test buy to keep clicking on the ad which is what AdWords says to do to test.

 

I have cleared my browser cache and tried testing on multiple devices and browsers.  I must have something wrong somewhere in the code.

 

Any help would be grand.

1 Expert replyverified_user

Re: Website Call Tracking - I must be missing something

Top Contributor
# 2
Top Contributor
Hi Jacob,

For the non-clickable number the code to use is:

<body onload="_googWcmGet('number', '1-800-123-4567')">
<span class="number">1-800-123-4567</span>
</body>

https://support.google.com/adwords/answer/6095883?hl=en-AU&authuser=0#gfn


And this code is wrong:


&lt;script type="text/javascript">
var callback = function(1-800-123-4567, +18001234567) {
var e = document.getElementById("number_link");
e.href = "tel:" +18001234567;
e.innerHTML = "";
e.appendChild(document.createTextNode(1-800-123-4567));
};
&lt;/script&gt;

You should just copy the code that Google supplies and don't change anything within it.


Also, it wasn't clear from your post, but you can only apply the call forwarding to one phone number per web page.



Re: Website Call Tracking - I must be missing something

Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆
I am using just 1 number on the site but it's in two different locations. 1 of the links is clickable for mobile devices and the other link is non clickable.

I had the original code in place from AdWords. Should of mentioned that and it did not work. Both the non linked number and the linked number.

for the linked number I took the code right from "Example 3: Pass the Google forwarding number to a custom callback function on your mobile site" on https://support.google.com/adwords/answer/6095883?hl=en

<head>
&lt;script type="text/javascript">
var callback = function(formatted_number, mobile_number) {
// formatted_number: number to display, in the same format as
// the number passed to _googWcmGet().
// (in this case, '1-800-123-4567')
// mobile_number: number formatted for use in a clickable link
// with tel:-URI (in this case, '+18001234567')
var e = document.getElementById("number_link");
e.href = "tel:" + mobile_number;
e.innerHTML = "";
e.appendChild(document.createTextNode(formatted_number));
};
&lt;/script&gt;
</head>
<body onload="_googWcmGet(callback, '1-800-123-4567')">
<a href="tel:18001234567" id="number_link">
1-800-123-4567</a>
</body>

I did lead over the <head> </head> as I placed the code in the header of the site so it's between this already.

From looking online after it did not work for me I attempted to modify it with the examples I showed above. I'll switch back and see. Getting real old paying to click on my own ad to test this out. Just like with Google Tags it would be cool to test this without having to pay to click your own ad.

Re: Website Call Tracking - I must be missing something

Follower ✭ ☆ ☆
# 4
Follower ✭ ☆ ☆
Tested again with the original code and no such luck. Still the same. No numbers switched out.

If anyone has some thoughts I'm all ears. I'm using the code on a wordpress site. Cache is cleared and viewing the source code everything shows just fine.

Re: Website Call Tracking - I must be missing something

Follower ✭ ☆ ☆
# 5
Follower ✭ ☆ ☆
I waited a few days. Still no call forwarding number on the landing page when clicking through the ad.