Reputation: 662
I can't figure out why there's a quite significant (~30%) difference between new visits figure I get from Mixpanel and GA. Here's how I implemented this metrics with Mixpanel:
if(!mixpanel.get_property("First visit")) {
mixpanel.register_once({ "First visit": $.now() });
mixpanel.track("Visit");
}
Is there anything wrong with this code? Is there any better way to do it? I want to implement a signup funnel with mixpanel (first visit -> sign up form -> sign up), but can't afford tracking every single visit, so I track just the first one. Though daily "Visit" events differ by 30% from New Visitors from Analytics and spoils the funnel.
Upvotes: 4
Views: 615
Reputation: 598
Your code functioning correctly(i've checked) Well the difference is due the way both services track users
Google Analytics relies exclusively on keeping track of users via a cookie (the average time of a cookie expires in 30 days).
With Mixpanel, you can utilize a user_id or any other id that makes sense for your business which will always last longer than a cookie.
Here are the differences in mixpanel and google analytics https://mixpanel.com/help/questions/articles/how-is-mixpanel-different-than-google-analytics
How to improve your first user setup in mixpanel; https://blog.mixpanel.com/2015/01/06/community-tip-tracking-first-time-users/
Hope this will help you
Upvotes: 2