My question is more a confirmation than a problem itself, I will give a general context of what my company does so that you understand everything that I have to deal with.
The company in which I work is an e-commerces sales review evaluator, we send an email to the buyer and he responds with his words and then this review appears in a component (widget) that is on the product preview page within the E-commerce, available for likely customers to see what they actually bought said.
My task then, was to have the user interactions appear on the client's analytics, so that we could evaluate who used our product and then made a purchase for example. I have evaluated how best to use events.
But the big problem I faced was to make it work in all possible analytics settings (with tag manager, analytics.js, ga.js) anyway, all possible settings.
And I got to that final code in (coffeescript)
@sendEvent: (action, product_name) ->
category = 'OurCompany Widget'
commonOptions = [category, action, product_name]
if typeof ga == 'function' && typeof ga.getAll == 'function'
trackers = ga.getAll()
if trackers.length > 0
ga ->
_.each ga.getAll(), (tracker) ->
ga "#{tracker.get('name')}.send", 'event', commonOptions...
else
ga 'send', 'event', commonOptions...
if typeof _gaq != 'undefined' || typeof _gat != 'undefined' && typeof _gat._getTrackers != 'undefined'
_.each _gat._getTrackers(), (tracker) ->
tracker._trackEvent commonOptions...
So the questions I ask you:
- Is there a better way to get an integration with all possible combinations of analytics?
- Can this current format cause any kind of damage to client data? (We received a complaint - just this one - from one of the customers saying that after triggering our tracking it interfered with capturing purchase data from them "they lost those data")
- And there are a few stores where buying influence data appears zeroed, simply the segments I created (basically filters by event action name) only returns 0.0% while the "All Users" segments appear OK (and yes the events are Being triggered - appear in the Real Time tab), my hypothesis is the payment gateway is cutting off all session events when the customer will pay (this website sells cosmetics and a segment filtering by woman only returns 2 sales from more than 500 sales, did you agree with this?).