Analytics
2.1K members online now
2.1K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

google event tracking link is not firing

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

i am trying to track a simple event click of an a link on a website. i have confirmed the account is using Universal Analytics that uses the /analytics.js to track.

 

i have created this url:

 

<a href="LINK" onclick="ga(‘send’, ‘event’, ‘Homepage CTA Block’, ‘Click’, ‘Homepage CTA Block-Top’);">linkhere</a>

 

however when i go to the Admin and see real time view of events, when i test the link and click on it the event is not showing up as fired. what am i missing here?

1 Expert replyverified_user

google event tracking link is not firing

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

seems like this is the actual code to use:

onClick="ga('send', 'event', { eventCategory: 'internal_click', eventAction: 'click', eventLabel: 'homepage_cta_click_top'});"

google event tracking link is not firing

Top Contributor
# 3
Top Contributor

Hi @Zach S :-)

Couple of questions.. 

1) Do site visitors get sent to a new page or to a different site after they click the link?

2) Are there any filters applied to the View that may be preventing your hits from being tracked?
3) Are you on a mobile device (these sometimes do not get seen in real time reports as expected due to mobile devices batching hits to conserve battery power)

 

Are you able to provide a link to the page so as to enable a quick peek via browser for any code typos

 

Thank :-)

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here