Open ghost opened 7 years ago
Looks like the code to be added is JavaScript, so you likely need to add this into the JS part of the particle.
Should also consider adding new gtag.js:
https://developers.google.com/analytics/devguides/collection/gtagjs/migration
Looks like a better way of doing this is with Google Tag Manager, which I'm trying now. It was easy to set up in Gantry. It also adds Schema Markup.
It seems that a Google Tag Manager atom has already been born: https://www.en-toutes-lettres.fr/services-web/joomla-news/358-google-tag-manager-sur-gantry5
Is Gantry going to upgrade the Google Analytics code to cover this or should I open a new issue.
Google say the old code will work fine but all new installs should use the new code gtag.js etc..
I can either use the particle linked above, or add the JS code manually so this is not an urgent one. I thnk if gantry comes with a google analytics particle then it should have the latest code.
Thanks
@w00fz FYI
I'm trying to add event code to track download clicks and social link clicks from my site. I don't see an option for adding Google Analytics event code in Gantry's Google Analytics atom.
I'm trying to add this:
ga('send', 'event', 'Downloads', 'click', 'ZIP');
The Google code: https://developers.google.com/analytics/devguides/collection/analyticsjs/events
Gantry files to change: analytics.html.twig & analytics.yaml http://docs.gantry.org/gantry5/tutorials/overriding-particle-settings#overriding-particle-source-files