neil
(Neil Lalonde)
July 14, 2016, 6:29pm
21
I think I have it working in a branch:
https://github.com/discourse/discourse/commit/8074d3bed9c4cfaee71e0ac88e4e614e0a59c14f
The tricky part is setting up GTM to pass along the events to UA. UA is getting the page views, but they’re all at the root url. I’ve defined our own events (page.title
and page.url
), but GTM also has an automatic history listener (not sure it includes page title, so we might want to keep the custom events). Either way, I don’t have the GTM setup correct yet. I’ll keep playing around in the baffling GTM interface.
4 Likes
neil
(Neil Lalonde)
July 14, 2016, 9:45pm
22
Everything seems to be working. I wrote up a howto, so tag manager experts please review.
This topic will show you how to setup Google Tag Manager and send data to Google Analytics. After you’re done, the Google Tag Manager API will be running on your Discourse site, so you could in theory send arbitrary events to any service that integrates with Tag Manager. Analytics is only the beginning.
This guide covers setting up Google Tag Manager, if you only want to enable Google Analytics for your site, simply set the G-Tag in the ga universal tracking code site set…
7 Likes
polusok
(Mykhailo Poliarush)
July 14, 2016, 10:20pm
23
awesome, I need to update to latest version to try, it will take a bit and then I will check
polusok
(Mykhailo Poliarush)
July 14, 2016, 10:48pm
24
Did everything as per instructions, working like a charm! Thank you very much!
However, need to wait 1 or 2 days to see final statistics and results. I will let you.
UPD: Everything is fine! You can use solution.
7 Likes
This topic was automatically closed after 3095 days. New replies are no longer allowed.