# Implementing Google Tag Manager with Discourse

**URL:** <https://meta.discourse.org/t/implementing-google-tag-manager-with-discourse/36861>\
**Category:** Data & reporting\
**Created:** [December 17, 2015, 11:23pm UTC](https://meta.discourse.org/t/implementing-google-tag-manager-with-discourse/36861 "2015-12-17T23:23:09Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [July 14, 2016, 6:29pm UTC](https://meta.discourse.org/t/implementing-google-tag-manager-with-discourse/36861/21 "2016-07-14T18:29:50Z")

</div>

I think I have it working in a branch:

[https://github.com/discourse/discourse/commit/8074d3bed9c4cfaee71e0ac88e4e614e0a59c14f](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.

---

_[View the full topic](https://meta.discourse.org/t/implementing-google-tag-manager-with-discourse/36861)._
