0.3.4 • Published 5 years ago

g-analytics v0.3.4

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Install

npm install g-analytics

Usage

Create Client instance

var Client = require("g-analytics");
var client = new Client("UA-XXXX-Y", {
  poolSize: 10
});

trackingId

Tracking ID for Google Analytics in format UA-XXXX-Y

Options

poolSize

For high load applications it's a good idea to reuse connections to Google Analytics server instead of creation a new one for each Hit/Event/etc.., so this option set maximium parallel connections to analytics servers.

Send info to google analytics

This lib doesn't have methods for different analytics stats types, so it has only one method send, which does all work to send data to analytics server:

client.send({
  "t": "pageview",
  "cid": 123456,
  "dh": "host.com",
  "dp": "/"
});

More Google Analytics parameters you can see here: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cs.

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

6 years ago

0.3.1

9 years ago

0.3.0

10 years ago

0.2.0

10 years ago