Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't get it to work on the server #40

Open
jerocosio opened this issue Mar 16, 2016 · 1 comment
Open

I can't get it to work on the server #40

jerocosio opened this issue Mar 16, 2016 · 1 comment

Comments

@jerocosio
Copy link

Hi, I would like to know if anyone has been able to use this amazing package on the server, I already tried running it using two different calls:

                analytics.track({
                    userId: Meteor.userId(),
                    event: 'Added Product',
                    properties: {
                        id: producto._id,
                        sku: producto._id,
                        name: producto.nombre,
                        price: producto.precio,
                        quantity: cantidadProducto,
                    }
                });

and

analytics.track('Added Product', {
                    id: producto._id,
                    sku: producto._id,
                    name: producto.nombre,
                    price: producto.precio,
                    quantity: cantidadProducto,
                    category: categoria.nombre
                });

but with both of them I get the same error:

Exception while invoking method 'sumarProducto' { stack: 'TypeError: Object [object Object] has no method \'track\'\n at [object Object].Meteor.methods.actualizarStock (server/metodosCarritoUsuario.js:121:15)\n at [object Object].methodMap.(anonymous function) (packages/meteorhacks_kadira/lib/hijack/wrap_session.js:164:1)\n at maybeAuditArgumentChecks (livedata_server.js:1698:12)\n at livedata_server.js:1611:18\n at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)\n at [object Object]._.extend.apply (livedata_server.js:1610:45)\n at [object Object]._.extend.call (livedata_server.js:1553:17)\n at [object Object].Meteor.methods.sumarProducto (server/metodosCarritoUsuario.js:59:10)\n at [object Object].methodMap.(anonymous function) (packages/meteorhacks_kadira/lib/hijack/wrap_session.js:164:1)\n at maybeAuditArgumentChecks (livedata_server.js:1698:12)',

Is there anything I'm doing wrong?

Thanks in advance.

@mitiaptest
Copy link

 + Same issue but if you add analytics.load('YOUR_WRITE_KEY') then its working. Do we really need to configure this on client and server both ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants