简体   繁体   中英

Google Analytics Events Not Tracking

I have set up an event in Google Analytics:

Goal set up - Custom Type - Event Name - Email Click Category (equal to) - Email Click Action (equal to) - clicked

This has saved successfully in Analytics.

I then have the following link and javascript on my page (which also has the standard Analytics code)

 function email_clicked() { ga('send', 'event', 'Email Click', 'clicked'); } 
 <a href="mailto:email@addresss.com" onclick="email_clicked()">email@address.com</a> 

Nothing tracks though! Any help would be really appreciated.

Thanks

You should use the analytics.js debugger to see if the event is actually being sent. The most likely explanation is that you have an error somewhere else in your code, which is preventing that function is not running.

https://developers.google.com/analytics/devguides/collection/analyticsjs/debugging

You can also check the Real Time -> Events tab in google analytics to see if you events are being tracked. Events can take up to 24 hours to show up in your Google Analytics. Real Time section is your best chance to see the live tracking after debugger tool which Philip suggested.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM