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