gantry / gantry5

:rocket: Next Generation Template / Theme Framework
http://gantry.org
1.04k stars 204 forks source link

Need Google Analytics Event Fields #2132

Open ghost opened 7 years ago

ghost commented 7 years ago

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

mahagr commented 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.

simmonsr commented 7 years ago

Should also consider adding new gtag.js:

https://developers.google.com/analytics/devguides/collection/gtagjs/migration

ghost commented 7 years ago

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.

mariantanase commented 7 years ago

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

shoulders commented 6 years ago

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

mahagr commented 6 years ago

@w00fz FYI