okgrow / analytics Goto Github PK
View Code? Open in Web Editor NEWUNMAINTAINED! - Complete Google Analytics, Mixpanel, KISSmetrics (and more) integration for Meteor
Home Page: https://atmospherejs.com/okgrow/analytics
License: MIT License
UNMAINTAINED! - Complete Google Analytics, Mixpanel, KISSmetrics (and more) integration for Meteor
Home Page: https://atmospherejs.com/okgrow/analytics
License: MIT License
i'm using FlowRouter for routing, trying to log each time it deals with a route (simulating "page loads")
var pageLoadTracking = function( context ){
analytics.page(context.route)
}
FlowRouter.triggers.enter([pageLoadTracking])
when i do this, the browser chokes and throws this error
Error: Exception from Tracker recompute function:
> Before: 2858ms (diff: 2858ms)
at usePostMessage (setimmediate.js:111)
at setimmediate.js:140
at meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:415
at meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:1086
reporters.js?1434055913401:67 Error: RangeError: Maximum call stack size exceeded
at new Boolean (native)
at Boolean.toString (native)
at 7.module.exports (http://localhost:3000/packages/okgrow_analytics.js?bf33fbe0c5894de7177a754bf4c090a67b7fe529:59:2270)
at clone (http://localhost:3000/packages/okgrow_analytics.js?bf33fbe0c5894de7177a754bf4c090a67b7fe529:59:11544)
at clone (http://localhost:3000/packages/okgrow_analytics.js?bf33fbe0c5894de7177a754bf4c090a67b7fe529:59:11638)
at clone (http://localhost:3000/packages/okgrow_analytics.js?bf33fbe0c5894de7177a754bf4c090a67b7fe529:59:11638)
at clone (http://localhost:3000/packages/okgrow_analytics.js?bf33fbe0c5894de7177a754bf4c090a67b7fe529:59:11638)
at clone (http://localhost:3000/packages/okgrow_analytics.js?bf33fbe0c5894de7177a754bf4c090a67b7fe529:59:11638)
at clone (http://localhost:3000/packages/okgrow_analytics.js?bf33fbe0c5894de7177a754bf4c090a67b7fe529:59:11638)
at clone (http://localhost:3000/packages/okgrow_analytics.js?bf33fbe0c5894de7177a754bf4c090a67b7fe529:59:11638)
as soon as i take the FlowRouter.triggers.enter
code out, all is good in the world.
We are using accounts-ui-bootstrap-3 package.
The example apps need some work, at least:
/
route is missingHi!
I am getting this error:
GET http://www.google-analytics.com/analytics.js net::ERR_BLOCKED_BY_CLIENT
Do you know why does it happen or how to solve it?
Thanks a lot!
I added this package to my site and ran analytics.debug() in the console.
When I jump from page to page, I'm getting data such as this:
properties: {
name: "howToPlay",
path: "/transfers",
...
}
This is data I get when I go from the transfers page to the howToPlay page. (The path for the howToPlay page is "/howToPlay". And the page for the transfers page is "/transfers").
I'm working with Mixpanel and trying to identify users in the app. While running the analytics.debug()
function, I can see the identify
method being called properly, however, no identity/people data is showing up in Mixpanel (although moving between pages does show up).
This appears to apply to both accounts-password
users and accounts-<service>
users.
Looking at the package code, it looks like there's only support for accounts-password
users. Specifically this line:
var userEmail = user.emails && user.emails[0] ? user.emails[0].address : 'n/a';
Would it be possible to get support for oAuth users added? This would require a little refactor that would look at the Meteor.user().services.<service>.email
key as well.
I wouldn't be able to do it immediately, but if this is something you'd be open to a PR on, let me know :)
I understand this behaviour is desired when accounts-base is used, but in our case we want a little bit of extra control over it. Constant "Signed in" events are when the user first loads the page, which makes sense in Meteor, but does pollute the data a bit.
I would prefer to be able to turn this off through a configuration.
We should trim out the non-relevant parts of analytics.js, it's modular and we only care about a small number of the integrations.
It should be possible to split this into multiple packages, e.g. okgrow:analytics-google, okgrow:analytics-mixpanel, etc.
I haven't investigated but we could probably split out the integrations from analytics.js into separate packages.
Note that I've tested it and we would only save about 40k currently. Less if you use more than one integration.
The SSR release of FlowRouter should be added.
Let's say I wanted to exclude the route /admin/*
- is that possible? If so, how?
hey
I added your package to my project and configured Meteor.settings to include a GA key
However, once the package is added, my app is broken
I get this warning in console (I have iron:router):
Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?
I know your code calls this.next(), but something seems to be broken
Anyway, the program execution gets cut and its indication is parts of my app produce errors (unknown variables etc)
I don't really know how we can help each other with that, as I can't isolate the problem
UPDATE:
the minute I opened the issue, I think I figured where the problem is...
in my project, I use a transform function for my users collection, which leads to various code executions
My guess would be your package runs first, calling Meteor.user() and in turn invokes the transform function. As your package runs before other init code is executed, this leads to complications
The workaround may not be trivial (tinkering with load order, if possible at all), so I think it should be made clear to other people
Meteor.settings is available on the client, is there a specific reason to keep analyticsSettings in public?
Seems like router calls analytics.page(page.name, page);
before initializing analytics. Is it ok to fix it with timeout?
Meteor.setTimeout(function(){
analytics.page(page.name, page);
}, 500);```
We log sign in and sign out, but sign up would also be great to log
Is there a way to specify a different tracking ID for android and IOS apps?
Thanks.
hey @tsemana,
following specific requirements in my project, I've decided to write my own analytics wrapper (which also includes a server-side analytics-node wrapper, btw)
Naturally, I've mentally borrowed basic ideas from your project, such as running a page track within an onRun event (originally suggested by the Iron Router author, of course)
However, I've realized that page tracks are inaccurate, as the recorded url & path in a page track call are actually of the preceding url to the one you track
to fix that, I've wrapped the page track in a Tracker.afterFlush:
Router.onRun(function() {
var router = this;
Tracker.afterFlush(function() { analytics.page(router.route.getName()); // etc });
this.next();
})
this way, it's guaranteed the right url is recorded
Can't update this package. I get the following message:
The following top-level dependencies were not updated to the very latest version available:
* okgrow:analytics 0.4.3 (1.0.1 is available)
I tried the suggested action with meteor add okgrow:analytics
and got this message:
okgrow:analytics without a version constraint has already been added.
What could the version constrain be coming from?
I am on Meteor 1.2.1 and have all other packages updated as well.
I have included okgrow:analytics in my meteor project. Using the right Segment.io appKey, I can see all the tracked events in the Segment debugger in real time. great.
Amplitude integration is enabled in the Segment dashboard.
But I can not see any events reported in Amplitude. It keeps saying "no data".
If I deactivate the okgrow:analytics package, and include the Segment javascript initialization code manually, everything's ok : the events are properly transmitted to Amplitude.
I'll keep this working solution for now, but if anyone has an idea, I'm interested.
Thanks.
hey guys,
thanks for the convenient package. quick question: i need to anonymize the IP through ga('set', 'anonymizeIp', true);
in google analytics. can I do that using this package? if yes, how and where would be the best place?
I've set up a dedicated userId view in Google Analytics (GA), yet I haven't been able to see any activity from logins and logouts even though the package automatically calls identify with the userId. I suspect this is because analytics.js doesn't automatically send any user info to GA on identify. Has anyone managed to do this?
I'm also using the GA debugger extension for Chrome, and it looks like the uid is never being sent.
The user should be able to customize which routes are tracked.
I'm getting this logged to console on app startup. Is this just debug code that was never removed?
=> Started proxy.
=> Started MongoDB.
I20150311-10:26:22.472(-4)? This should not show
=> Started your app.
Hello:
Despite following the instructions and placing the trackingID inside a "public" block in my settings.json, I still get an error when developing on my local in the browser console:
Missing analyticsSettings in Meteor.settings.public
However, the tracking seems to work just fine in production. This is my settings.json block:
"public":{
"analyticsSettings":{
"Google Analytics":{
"trackingId":"UA-XXXXXXXX-X"
}
}
},
See kadirahq/fast-render#12 (comment) and higher.
Basically, needs a this.ready() somewhere in the server/publication. I'll try to figure out exactly where :)
Currently we use Segment's open source analytics.js library, which I don't think would work server side. I haven't investigated how we would make it work but it would be great to be able to log events on the server side too.
I use some redirects in certain situations and I don't want these to come up as two page views. Another situation where you might not want to count page views is admin pages.
https://github.com/okgrow/analytics/blob/master/lib/server/publications.js
The publications page is a serious issue for anyone who requests data because of this issue:
meteor/meteor#3764
I can't request anything from 'services.facebook' or 'services.instagram' at all because of this.
It breaks the avatar package, as well as blocking me from being able to get social info other than email generally. This is a big problem. Until Meteor fixes this, please add an explanation to your main page to add a publish request.
This commit (651ce8e) and associated tag (1.0.2) are not included in any branch. @pauldowman I never ran into this before. Can we just make a new commit on master
bumping the version?
How would I configure for the 2 facebook integrations in segment?
I don't know if it is possible, but if it is, what whould be the entry format of the analyticsSettings object in settings.json.
analytics.js-integration-facebook-conversion-tracking
analytics.js-integration-facebook-custom-audiences
Hi folks,
are there plans (is it possible) to use the package on the meteor server side?
I am having a small (webhook) API, exposed for mailgun and I want to track some events on ga.
Does this make sense, has anyone tried this?
BR, Carsten
I'm playing with adding the revenue
property to events along with Mixpanel, however, no revenue data is showing up on Mixpanel. Is this passed along? Note: I'm adding Mixpanel directly through the package and not adding it to Segment. An example event:
analytics.track( 'Made a purchase', {
revenue: 149.00
});
The event does show up on Mixpanel, but just as an event for the user. The revenue data shows up in the event data but is not acknowledged by Mixpanel's revenue feature. Any thoughts?
Could we get support for flow-router as well?
Hi,
Firstly, great package - thanks a lot for making it.
I'm using the package with Flow Router 2.0.0 as per the PR I submitted so apologies in advance if this issue is specific to that although I think it might apply to older versions of Flow Router too.
There seem to be two issues/bugs:
I'm basing the above on what analytics.debug chucks out.
I've managed to patch both of these issues by wrapping the reporting code in a timeout:
Meteor.setTimeout(function() {
if (context.route && context.route.name) {
analytics.page(context.route.name);
} else {
analytics.page(context.path);
}
}, 500);
But that seems a bit hacky! I was just wondering if anyone else had any ideas as to how to resolve the issue?
Thanks,
Tom
i added the okgrow:analytics package and updated my settings.json using the example provided, but i'm getting an error when running my app.
Error: analytics.initialize is not a function
TypeError: analytics.initialize is not a function
at http://localhost:3000/packages/okgrow_analytics.js?bf33fbe0c5894de7177a754bf4c090a67b7fe529:36:15
at runStartupCallbacks (http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:785:22)
at HTMLDocument.ready (http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:787:3)
settings.json
"public" : {
"analyticsSettings": {
"Mixpanel": {
"token": "<my_token_here>",
"people": true
}
}
}
meteor list
...
okgrow:analytics 0.3.0 Complete Google Analytics, Mixpanel, KISSmetrics (and more) integration for Meteor
...
meteor --version
Meteor 1.1.0.2
settings.json contains
{
"public": {
....
"analyticsSettings": {
"Google Analytics": {"trackingId": "XXXXX"}
}
},
...
}
I start meteor with
meteor --settings config/settings.json
no error messages
when I start
meteor shell
and type
analytics.debug()
I get
ReferenceError: analytics is not defined
Just a proposal:
ANALYTICS_ MIXPANEL_TOKEN="..."
ANALYTICS_ GA_KEY="..."
Testing
I am new to meteor stuff as well as analytics so sorry if I dont get some common sense stuff here :)
SO I am trying to create a server side event to track the signup through facebook and google and if done with password than password.
I have installed okgrow package and when I try to track the properties I am unable to track services(fb or google) and roles which are user properties.
Also the major issue I guess is the error which says mixpanel is undefined on the terminal.
This all I am trying to do it on server side in package.js. I have properly set the api.use and files for server to access.
below is the code and the error I am facing.
function my_analytics() {
Accounts.onLogin(function(user){
if(!user)
return
mixpanel.register('user',{
'$email': user.email[0].address,
'roles': user.profile.roles
"services": user.services
});
})
}
Meteor.startup(function(){
my_analytics();
})
I20151028-19:46:33.319(5.5)? Exception in onLogin callback: ReferenceError: mixpanel is not defined
I20151028-19:46:33.320(5.5)? at packages/my:package/server.js:18:1
I20151028-19:46:33.320(5.5)? at runWithEnvironment (packages/meteor/dynamics_nodejs.js:108:1)
I20151028-19:46:33.320(5.5)? at packages/meteor/dynamics_nodejs.js:121:1
I20151028-19:46:33.320(5.5)? at packages/accounts-base/accounts_server.js:87:1
I20151028-19:46:33.323(5.5)? at [object Object]..extend.each (packages/callback-hook/hook.js:102:1)
I20151028-19:46:33.323(5.5)? at successfulLogin (packages/accounts-base/accounts_server.js:86:1)
I20151028-19:46:33.323(5.5)? at attemptLogin (packages/accounts-base/accounts_server.js:258:1)
I20151028-19:46:33.323(5.5)? at [object Object].Meteor.methods.login (packages/accounts-base/accounts_server.js:411:1)
I20151028-19:46:33.324(5.5)? at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1)
I20151028-19:46:33.324(5.5)? at packages/ddp/livedata_server.js:648:1
I20151028-19:46:34.067(5.5)? Exception in onLogin callback: ReferenceError: mixpanel is not defined
I20151028-19:46:34.067(5.5)? at packages/my:package/server.js:18:1
I20151028-19:46:34.067(5.5)? at runWithEnvironment (packages/meteor/dynamics_nodejs.js:108:1)
I20151028-19:46:34.068(5.5)? at packages/accounts-base/accounts_server.js:87:1
I20151028-19:46:34.068(5.5)? at [object Object]..extend.each (packages/callback-hook/hook.js:102:1)
I20151028-19:46:34.067(5.5)? at packages/meteor/dynamics_nodejs.js:121:1
I20151028-19:46:34.068(5.5)? at successfulLogin (packages/accounts-base/accounts_server.js:86:1)
I20151028-19:46:34.068(5.5)? at attemptLogin (packages/accounts-base/accounts_server.js:258:1)
I20151028-19:46:34.069(5.5)? at [object Object].Meteor.methods.login (packages/accounts-base/accounts_server.js:411:1)
I20151028-19:46:34.069(5.5)? at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1)
I20151028-19:46:34.069(5.5)? at packages/ddp/livedata_server.js:648:1
This is a test
I don't know if I missed a step or something but has anyone had any issues with Google taking a while to recognize tracking is installed?
When I run the analytics debugging Chrome extension I see the initialization of ga
and the creation of a tracker all with the proper ID. I see the events being fired off but my dashboard still shows nothing and says it's not installed.
Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' http://www.google-analytics.com https://www.google-analytics.com http://cdn.mxpnl.com https://cdn.mxpnl.com".
This causes a problem with meteorhacks:fast-render package. i made a pull request to fix this problem
This may or may not be an issue, as I haven't actually started using the package yet. The reason being that we were looking at using Flurry, which requires different projects (and API keys) for different mobile platforms. We are currently building our Meteor app for iOS and Android, which means I have a unique Flurry project and API key for each.
I saw that @pauldowman mentioned something about potentially being able to configure Analytics via JS in another issue (#3), which I think would address this scenario since we could configure the package on startup based on whether it was an Android or iOS client.
And if there is another solution I'm just not seeing please let me know. Thanks!
The publish Users function, uses the following projection:
{fields: { 'services.facebook.email': 1,
'services.google.email': 1,
'services.github.email': 1 }});
https://github.com/okgrow/analytics/blob/master/lib/server/publications.js
For example, if I had to get services.facebook.<some other attribute>
I need to get additional fields for my user record, so this publish wipes them out.
Is there some way to workaround this please?
Hi, i'm using your plugin with IR and the Accounts Core EnsureSignedIn plugin. In my instance of okgroup:analytics, i've noticed that every router interaction seems to send a 'signedIn' track event to mixpanel. The result is that in my mixpanel event log, i'm seeing a large volume of signedIn events (shown below) repeatedly displayed whenever a route changes. Is this by design?
When using multiply:iron-router-progress (a very popular package) each page request sends multiple analytics requests.
Before I was using your package, I also had this problem. I made an analytics request in Router.onAfterAction and onAfterAction was being called multiple times (usually 2 or 3) per page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.