I am trying to track clicks on my site using the analytics.js script for tracking events. I implement the snippet and test using the "Real Time" view and nothing shows up. Here is the snippet I am using:
<a href="my-file-link.pdf" onClick="ga('send', 'event', {
eventCategory: 'download', eventAction: 'click', eventLabel: 'download
overview'});" target="_blank">Link</a>
I have also tried:
<a href="my-file-link.pdf" onClick="ga('send', 'event', 'download', 'click','download overview');" target="_blank">Link</a>
Anyone know what I am doing wrong?
ga('create', 'YOUR_ANALYTICS_ID', 'auto');
before thega( 'send'
function – martin schwartz Sep 18 '19 at 23:16