@abskmj/google-analytics-tracker 中文文档教程
Google Analytics Tracker for Nodejs
这具有将客户详细信息传递到 GA 服务器以获取地理和其他人口统计信息的功能。
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
所有对 GA 服务器的跟踪请求都是通过节点服务器进行的。 因此,地理人口统计学将只有服务器详细信息。
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);
});
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);
});