Analytics
4K members online now
4K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Event Tracking code not working/not understand "value"

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi there, I've been trying for the couple of days to create a new goal on my site in order to track click on the phone number throughout the site. Using GA Universal, here is the code that I have inserted on my site: <a onclick="ga('send', 'event', 'Clicks', 'Clicked', 'Telclicks', '0');" href="tel:3145769123">314-576-9123</a>

 

Category, action, label and value are all the same as set on the goal, but for some reasons i'm not getting any conversions, despite testing it myself on different computers/phones. Is this link with value, that should be set to 1 instead of zero ?

 

Kindest Regards

2 Expert replyverified_user

Re: Event Tracking code not working/not understand "value"

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi @Clement D,

 

I would start by using a great, free tool by Google called Google Tag Assistant. This is a Chrome extension that will allow you to check the health of your tracking code and learn ways to optimize it, if any. Install it, enable it and visit your website.

 

Please give it a try and let us know what you discover. 

 

Best Regards,

 

James

_________________________________________________________
Google AdWords Top Contributor | Google Partner | GYBO | Local Guide | My Profile


 


 


 

Re: Event Tracking code not working/not understand "value"

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi James,

 

Thank you for our quick reply. I had previously installed the GA debug extension which did not see any issue with my page. Using your extension (Tag Assistant),  I can see my GA Universal tracking code, though it doesn't seem to see the code snippet for tracking the click on phone number that I have added as well ?

Re: Event Tracking code not working/not understand "value"

[ Edited ]
Participant ✭ ✭ ✭
# 4
Participant ✭ ✭ ✭

Hi Clement,

Try this one:

<a href=”tel:3145769123” onClick=”ga(‘send’, ‘event’, ‘Clicks’, ‘Clicked’, ‘Telclicks’);“>314-576-9123</a>

 

Trigger the event you are tracking via GA event tracking and then look at the real time events report to check whether the event data (category,action,label) is being passed to Google Analytics or not.

 

Actually, it's easier to use Google Tag Manager to create this kind of events.

Hope this helps.
Taavi

Re: Event Tracking code not working/not understand "value"

Top Contributor Alumni
# 5
Top Contributor Alumni

Hi
I believe this is happening because the click is leading user out of browser before hit is sent. You should try hitcallback. Here is sample code

var href = "tel:3145769123";        
 
ga('send', 'event', {
    'eventCategory' : 'Clicks',
    'eventAction'   : 'Clicked',
    'eventLabel'    : 'Teleclicks',
    'eventValue'    : 0,
    'hitCallback'   : function () {
        document.location = href;
    }
});

And by the way event label and value are not mandatory parameters you can just skip them.

Regards, Nik
LinkedIn  |   @nikhilparachure | My Blog

Re: Event Tracking code not working/not understand "value"

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Hello, Apologies for the late reply. I have tried the code given by Taavi above and that did not work, the goal is still not getting triggered. I'm also quite unsure about how to add the code above: is this javascript ? Should I add it into my header but also keep my ahref code that i used first ? Sincerely,

Re: Event Tracking code not working/not understand "value"

Top Contributor
# 7
Top Contributor
Hi Clement D,

If you set a value for the goal, it needs to be an integer, and not a string. You currently have a string of '0'. Change this to an INTEGER of 0 if you need it. Also, in your goal configuration, you should set the value field to "Value Equals to 0". This will capture the conversion. If you do not need to set a value for that event, then just leave it blank:

ga('send', 'Clicks', Clicked', 'Telclicks');

and leave the Value field empty.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn