1
votes

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 protected]" onclick="email_clicked()">[email protected]</a>

Nothing tracks though! Any help would be really appreciated.

Thanks

2

2 Answers

0
votes

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

0
votes

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.