g-analytics
Advanced tools
Comparing version 0.3.0 to 0.3.1
var | ||
Request = require("request"), | ||
_ = require("lodash"); | ||
_ = require("lodash"), | ||
util = require("util"), | ||
EventEmitter = require("events"); | ||
@@ -12,2 +14,3 @@ /** | ||
var Client = function(trackingId, options) { | ||
EventEmitter.call(this); | ||
this._trackingId = trackingId; | ||
@@ -31,10 +34,16 @@ this._analyticsHost = "www.google-analytics.com"; | ||
Client.prototype.send = function(params, cb) { | ||
var self = this; | ||
params.tid = this._trackingId; | ||
params.v = 1; | ||
this._request.post({ | ||
var req = this._request.post({ | ||
url: this._options.protocol + "://" + this._analyticsHost + "/collect", | ||
form: params | ||
}, cb); | ||
req.on("error", function(err) { | ||
self.emit("error", err); | ||
}); | ||
}; | ||
util.inherits(Client, EventEmitter); | ||
module.exports = Client; |
{ | ||
"name": "g-analytics", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Ease to use nodejs google analytics client, which uses Measurement Protocol", | ||
@@ -22,2 +22,5 @@ "main": "index.js", | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/" | ||
}, | ||
"keywords": [ | ||
@@ -24,0 +27,0 @@ "google", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4485
92