Socket
Socket
Sign inDemoInstall

@abskmj/google-analytics-tracker

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @abskmj/google-analytics-tracker

This has a functionality to pass client details to GA server for geographic and other demographics.


Version published
Maintainers
1
Created

Readme

Source

Google Analytics Tracker for Nodejs

This has a functionality to pass client details to GA server for geographic and other demographics.

         client ip & ua                 client ip & ua
CLIENT ------------------ NODE SERVER ------------------- GA SERVER

Traditional Server side GA trackers

         client ip & ua                 server ip & ua
CLIENT ------------------ NODE SERVER ------------------- GA SERVER

All the tracking requests to GA server is via node server. Hence, geographic demograhics will have server details only.

Example

var options = {
    debug: true
};

var tracker = require('@abskmj/google-analytics-tracker')('UA-XXXXXXXX-X', options);

var event = {
    category: 'click',
    action: 'search',
    label: 'google',
    value: 10
};

var override = {
    ip: '2XX.X.1X3.X'
};

tracker.trackEvent(event, override, function (error, response) {
    console.log(response.body);
});

FAQs

Last updated on 26 Jun 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc