okgrow / analytics

UNMAINTAINED! - Complete Google Analytics, Mixpanel, KISSmetrics (and more) integration for Meteor
https://atmospherejs.com/okgrow/analytics
MIT License
213 stars 61 forks source link

Custom Event Tracking #194

Closed mozfet closed 6 years ago

mozfet commented 6 years ago

Hi,

Got auto analytics working perfectly, but I am struggling making a customer event and linking it to a Google Analytics Goal.

I'm using Meteor 1.5.5.2, okgrow:analytics@3.0.1 (Atmosphere), "@okgrow/auto-analytics": "^1.0.2", (NPM). On the client I import the package ``import { analytics } from '@okgrow/auto-analytics';```.

Inside an autorun (reactive code in a node fiber), I detect the payment document's state change that I want to track, then I call:

analytics.track('Buy Credits', {
  Category: 'Payments',
  Action: 'Buy',
  Label: 'Credits',
  Value: payment.credits
});

I've attached a screenshot of my goal setup in Google Analytics. I've read the docs, and I think my call looks right... screen shot 2017-10-05 at 10 19 31 pm

I've used analytics.debug() for more info and it seems that okgrow is receiving and it looks ok as well... screen shot 2017-10-05 at 10 13 31 pm

I've also used the Google Tag manager. The tag manager does not pick up my event, but the auto events are detected instantly.

My conclusion is the event is going to okgrow, but not from okgrow to Google Analytics...

Am I doing something wrong? Or is this a bug? I do not know...

RichardLitt commented 6 years ago

Thanks @mozfet. We'll take a look as soon as we can.

cfnelson commented 6 years ago

@mozfet If you are seeing the event logging with analytics.debug() then it is being captured by ga and is working.

I would suggest that there is something wrong with the setup on google. There is no Google Tag Manager integration with this package. The segment docs might be able to help you out here & here.

There is also a new release of auto-analytics and a new version of this package is about to be released aswell.

mozfet commented 6 years ago

I could not get it working and decided to drop GA altogether and built a simple builtin mongodb collection based tracker without any external dependencies.

RichardLitt commented 6 years ago

Thanks for letting us know, @mozfet. Sorry to hear we weren't able to get this working for you!

If you run into issues with your local tracker, later, please do feel free to come back and we can see if we can help more. This does work for others, so it's likely there was something in your setup that we haven't documented properly as an issue to look for.

mozfet commented 6 years ago

Thanks for the support.

Actually... this whole incident has been a blessing in disguise! We now have a near perfect privacy policy. No ads. No tracking. No Google. No nothing but ExpertBox.com (alpha testers wanted for our brand new concept in knowledge automation). Only users and their data - its actually a business differentiator. Really good privacy!

My in-house tracking system is working perfectly, it needs some more work for deeper insights, but after only 3 days of work it's looking stellar and I can do exactly what I want with it.

It is really simple. Every event I want to track, insert a document into a mongodb collection and publish that collection only to admin users. Then in admin, I have a blaze template instance autorun reading the new tracks and adding it responsively to a chart using chart.js. Easy (ok medium difficulty getting reactive charts working) Peasy, no external web service dependencies.

This is what a $100 per month budget DevOps monitor looks like. Top left is our built-in tracking system, bottom left is Meteor Galaxy, and right to is a primary and secondary mLab MongoDB nodes on my cluster. screen shot 2017-10-10 at 12 48 46 pm

RichardLitt commented 6 years ago

@mozfet Pretty cool! Thanks for explaining your system now. Good luck going forward. If you do implement some sort of tracking system that requires okgrow/analytics, we'll still be here. :)