Coder Social home page Coder Social logo

Comments (6)

istian avatar istian commented on July 17, 2024

@sandromartis ,

Did you get this working? I'm also curious how to do GA metris using this module.

Thanks

from universal-analytics.

sandromartis avatar sandromartis commented on July 17, 2024

@istian ,

Mhm, I think the syntax I posted in the comment above was correct. So in my case 'cm1' is the custom metric with index 1 on Google Analytics. My problem was that I have set the scope of the metric to "Product" and I didn't receive any data. Dunno why, I'm not really a Google Analytics crack. If I remember this correctly, I started receiving data after I changed the scope to 'Hit'.
Nonetheless, I decided to use a different service for collecting my custom stats, because GA didn't really fit my purpose, or maybe I just don't really understand how these custom metrics and the scopes work.

I hope I can help you with this.

Best,
Sandro

from universal-analytics.

jtillmann avatar jtillmann commented on July 17, 2024

First of all I think the syntax is correct as well.

Second, make sure what @sandromartis said above: Set up the metric in Google Analytics and in most cases you want the "Hit" scope.

"Product" scope is only necessary/possible in ecommerce transactions.

from universal-analytics.

istian avatar istian commented on July 17, 2024

actually, I just want to know the syntax for sending custom dimension. I'm new and still trying to understand how to use this library. I assume that sending custom dimension syntax would be:

var totalUsers = 410;
visitor.event({
    ....
    cd1: <my own value>
}, function (err) {
// …
});

from universal-analytics.

jtillmann avatar jtillmann commented on July 17, 2024

Looks good, make sure to send event category (ec) and action (ea) to make it a valid event.

from universal-analytics.

istian avatar istian commented on July 17, 2024

Thank you guys!

@sandromartis , I already hijacked this thread :)

from universal-analytics.

Related Issues (20)

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.