I want to add to my site file downloads tracking with Google Analytics.
I understand that I need to add an 'onclick' event to all the links on the site.
Like this:
<a href="file.pdf" onclick="ga('send', 'event', 'Google Link', 'Action
label', 'Action Value');">link</a>
But I have so many links so it is not practical.
Is there a way to write any code in one place which will do the same thing?
Thanks.