Code Monkey home page Code Monkey logo

analytics's Issues

Server-Side Console Logging

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.

analytics.initialize is not a function ?

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
      }
    }
  }

FlowRouter doesn't track first pageview

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);```

package causes client errors

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

Iron Router EnsureSignedIn Issue?

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?

screen shot 2015-04-28 at 11 23 45

How can I send the userId to Google Analytics?

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.

Version constraint - Can't update okgrow:analytics 0.4.3

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:analyticsand 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.

Is revenue tracked?

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?

Can't get Google to recognize tracking

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.

Exception in onLogin callback: ReferenceError: mixpanel is not defined

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

ga anonymize IP

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?

Make the automated user tracking optional

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.

Allow server-side analytics

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.

problem with Amplitude integration in Segment

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.

Support for oAuth users

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 :)

maximum call stack size exceeded -- using FlowRouter.triggers.enter

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.

analytics not defined

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

Initialisation/timing issues?

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:

  1. On initial page load analytics.js doesn't seem to have initialised and so the first page view isn't tracked.
  2. Moving between routes the previous URL is sometimes reported as the current URL.

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

wrong page tracking

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

Data seems to be one page behind

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

Publication Conflicts With User Services Publications - Breaks App For Facebook

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.

Using Analytics Package with Flurry and Multiple API Keys

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!

ga on server side for webhooks API

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

Fix example apps

The example apps need some work, at least:

  1. The / route is missing
  2. They need accounts-password, accounts-facebook, accounts-google and accounts-github to test identify

Error on Local Environment

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"
         }
      }
   },

Allow adding only specific 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.