Hi -- Thanks. Could I add this to the footer field in themes.php?page=theme-options#footer-custom-js
I would like the flexibility to pass different values to the event depending on the button/link. Or have the script pass the label of the link/button to Google. Is this possible?
How to sent onClick events to Google Analytics? I have the analytics js pasted into the Footer option in the theme config.
I have tried this: <a onClick="ga('send', 'event', 'Link', 'Click', 'App', '0');" href="url"> and onclick="__gaTracker( ... " to no avail.
My preference would be not to use another plugin.
Hi Phil,
You can do this with jQuery,
Maybe this could work for you?
Hi -- Thanks. Could I add this to the footer field in themes.php?page=theme-options#footer-custom-js
I would like the flexibility to pass different values to the event depending on the button/link. Or have the script pass the label of the link/button to Google. Is this possible?
Hi Phil,
It depends what information you want to pass and which links do you target, for example you can pass the Link Name (value) in this form:
Where do I add this script. To the top of each portfolio post. Or to the footer? Or in header.php?
Hi Phil,
You need to place that code on Theme Options > Footer > JavaScript & Tracking Code > Footer JavaScript