I want to add GA event tracking to my Discourse installation. Is there any existing documentation or examples I can reference? Thanks!
Here’s some of the events that I want to track:
• Logging in
• Homepage
o Creating topic
o Starring topic
• Category page
o Creating topic
o Watching category
o Tracking category
o Regular status for category
o Muting category
o Editing category (selecting edit option)
• Topic page
o Replying
o Inviting
o Starring
o Sharing
o Flagging
• Profile page
o Adding profile photo
o Adding background photo
o Editing profile fields
Creating a generic metrics framework would be a good idea so people can track these sort of data points in a provider of their choice (google analytics, mixpanel, etc.).
I agree. i’m not sure that this is a support issue, but should probably be an “extensibility” or plug-in topic.
I’m quite interested in this type of functionality. can anyone comment here as to whether the events iist @scotta’s original post are exposed at any point as a generic event (like a navigation event)?
Most, if not all of these seem like proper click events. When an action like (for example) Creating a Topic. is there a navigation hook event that could then be fed to a plugin that can invokes the appropirate GA call with the meta information of the action (location, user, etc.
I read through some of the plugin related threads, and it there didn’t appear to be a canonical reference to documentation describing how what capabilities the plugin framework expose from a general navigation perspective.
Is there a GO TO page/reference for how the plugin work re:navigation?
Looking for some feedback here… Please bear with me, as I’m new to Ruby and Rails.
I’m currently working on adding this kind of event tracking, as it is pretty critical for my Discourse installation.
Presently, my idea is to add a view for each event so that they can be embedded in the correct place. By default, these will have code for Universal GA events if that is enabled, and otherwise will not have any additional code.
I think that a view for each event also opens this up to easily being extended via plugin, since the plugin could just overwrite whichever views it wants. That’s how it works, isn’t it? For example, a segment.io plugin would simply overwrite each tracking view with some JavaScript.
It think would also be helpful for the user to be able to enable/disable individual events and change the event name in the admin panel, so advice on the best way to make that happen would be appreciated. The enabled/disabled status and event name would be exposed to the view, so even plugins for other tracking/analytics providers could take advantage of the ability to customize event names in the admin panel with no additional code.
If all this sounds good, I think I have enough information and examples from the codebase to follow to go ahead and get this working.
I have looked elsewhere on this forum and this is the only place I have seen this topic mentioned.
So I have two questions:
Am I correct in understanding that there are no events that come out of the box with this GA/UA integration, that it’s just pageviews and nothing else?
If we therefore want to add custom event tracking to our Discourse installation, we need to code and fire the events ourselves?
Definitely - I think something about integrating GA using Google Tag Manager would also be useful (since for our website we fire Universal Analytics tags via GTM).
Been thinking about this lately. I can’t believe no one has done this yet as it could be incredibly valuable for us.
If we were able to tell how many times someone starts to make a topic and then gets redirected to an existing topic, we could start putting numbers on how valuable Discourse is to us.
I’ll definitely be looking into this in the coming months and will report any findings or how it goes.
That sounds good, but it would be an underestimation. A potential support request can be diverted without a customer having begun to create a new topic. It could even be argued that as your community grows, and more unique topics are created, customers will more easily find answer from the search box on the first try, rather than having to begin creating a new topic to find it.
To demonstrate the value of our Community (and other channels) we aggregate and compare the relative size of the following metrics:
I’m currently trying to track events such as Creating a Topic and Replying to an existing one.
I know how GA Events work and I know how to add custom JS code to the head via Admin→Customize→CSS/HTML→</head>.
What I still haven’t figured out is what I should listen to, in order to call the event tracking code and send the Event to GA.
I even thought about listening to a click on the button, but that doesn’t seem the right way to do it.
Just wanted to check in… When I add GA tracking code to Discourse, as opposed to loading GA manually, does Discourse add any customization to the way events are fired, or is it basically just sending GA pageviews? Thanks.