Analytics
4.5K members online now
4.5K 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

How do I check that my coding is correct for onclick button tracking?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

 

 

I have confirmed with Google that my analytics goal implementation is correct.  So where did I go wrong in my coding?

 

<div class="span9">
<div class="feature">
<h2><a href="locations/" >Everywhere you go! </a></h2>
<p class="hidden-phone">No matter where life takes you, we are nearby! </p>
<a class="btn btn-red btn-small hidden-phone" href="locations/" onClick="ga(‘send’, ‘event’, ‘button’, ‘click’, ‘locations/’);" ><i class="icon-angle-right"></i>Learn More</a>
</div>

How do I check that my coding is correct for onclick button tracking?

[ Edited ]
Participant ✭ ✭ ✭
# 2
Participant ✭ ✭ ✭

Hi Tiffany,

 

Could you please share the URL of your website where you've implemented this code?

 

We'll take a look and give you actionable advice. You can modify or remove this URL later on in your post if you want.

 

I guess the problem is that you have used invalid quotes in your code.

 

This code should work:

 

<a class="btn btn-red btn-small hidden-phone" href="locations/" onClick="ga('send', 'event', 'button', 'click', 'locations/');" >

 

Looking forward to hearing from you.

Taavi