Who/What should be responsible for pushing GA events? #1260
Replies: 6 comments 9 replies
-
The current decision is to make it a standard that we emit vue events in 'atoms' & 'molecules' and capture these in parent components and then push GA events from there. |
Beta Was this translation helpful? Give feedback.
-
Was just having a think about this whilst working on a ticket (f-status-banner). I think in some instances it would make sense to emit from the component and let the consuming application / vertical deal with what they would like to happen, if anything, for example things like buttons or smaller more shareable components (by shareable I mean more open source type sharing). But for larger components that are more tied to our own system & generic across teams like the f-status-banner (shared across verticals basically) I think it makes sense to push events directly from this component rather than emitting, the reason being is because each team would essentially need the same repeated code (GA push methods setup) in their codebase if they end up using this component, therefore making it a little harder to plug and play. Thoughts? |
Beta Was this translation helpful? Give feedback.
-
If we have components '... that are more tied to our own system & generic across teams like the f-status-banner' then should these be in the open-source fozzie mono repo? what other company would want our bespoke component pushing our bespoke GA events? whereas if we think our components is useful as an open-source shareable component then by emitting vue events we keep it very agnostic. |
Beta Was this translation helpful? Give feedback.
-
Q. What are the actual requirements, problem that we are trying to solve here? Some examples or context may help inform the decision? |
Beta Was this translation helpful? Give feedback.
-
I pretty much agree with @kevinrodrigues – I don't think there's ever a hard and fast rule, but when I've talked about it in the past, my rough rules has been; If the component can be used in different places across the web flow, then we're likely to need to emit events and let the consumer handle emitting the analytics events. To give some examples: Atoms…like One thing to add that worked well when we used MoleculesLikely to be the same as above, as the idea of these components is that they're still shareable across the application. So embedding analytics code inside them doesn't make a lot of sense, unless there is a way we can avoid a lot of repeated if statements for each different type of GA push. OrganismsA bit less clear cut, as like Kev says above, it depends on how they're being used. I think we'll likely separate out page components like Things like PagesI'm including this as a separate category as I think it's inevitable that we'll split these out, either into a separate folder or their own mono-repo. I think for pages, it makes sense that they handle their own events. |
Beta Was this translation helpful? Give feedback.
-
Devil's advocate here: the GTM already provides an abstraction away from GA. You push things to a |
Beta Was this translation helpful? Give feedback.
-
For discussion: In reference to pushing GA events, should we only emit Vue events (to signal an actions that the Analytical Team might want to record) from Fozzie components in folders 'atoms' & 'molecules' and never push actual GA events?
Beta Was this translation helpful? Give feedback.
All reactions