mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
move category pageview to controllers
so topic views are tracked as category views
This commit is contained in:
@@ -14,8 +14,6 @@ var pageViews = 0;
|
||||
var uniqueIPCount = 0;
|
||||
var uniquevisitors = 0;
|
||||
|
||||
var isCategory = /^(?:\/api)?\/category\/(\d+)/;
|
||||
|
||||
new cronJob('*/10 * * * * *', function () {
|
||||
Analytics.writeData();
|
||||
}, null, true);
|
||||
@@ -52,15 +50,6 @@ Analytics.pageView = function (payload) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (payload.path) {
|
||||
var categoryMatch = payload.path.match(isCategory);
|
||||
var cid = categoryMatch ? parseInt(categoryMatch[1], 10) : null;
|
||||
|
||||
if (cid) {
|
||||
Analytics.increment(['pageviews:byCid:' + cid]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.writeData = function (callback) {
|
||||
|
||||
Reference in New Issue
Block a user