Mobile app version of vmapp.org
Login or Join
Angie530

: Event tracking that will work in multiple websites with various versions of Google Analytics without interfering with other tracking My question is more a confirmation than a problem itself, I

@Angie530

Posted in: #GoogleAnalytics #Tracking

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

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Angie530

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sue5673885

You have taken an interesting approach for solving this across all GA implementations!

What worries me is the broad strokes with which you are spamming all GA trackers with your event data. Let's take a site which uses a third party chat widget (e.g Olark). As I understand, they have their own GA in there somewhere, and this javascript will take all trackers and send the event data in those.

That would send additional events in 3rd party systems which may or may not be processed by those systems. Seems a strong handed approach.

An alternative approach

Wouldn't creating a separate tracker object and sending your event data through it be easier?

I know it would create some additional overhead, but at least the data you are sending to would be reliably stored in just the right account.

As far as the third point you are asking, is it possible for you to share the segment?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme