mpanalytics
Version:
Wrapper around google analytics measurement protocol, works both client- and serverside.
24 lines (19 loc) • 420 B
JavaScript
import config from './config.js';
import mpanalytics from '../index.js';
describe('pageview', function () {
var tracker;
beforeEach('create', function () {
tracker = mpanalytics.create({
tid: config.UA,
cid: Math.random() + 'mocha',
})
});
it('send', function (done) {
this.timeout(10 * 1000);
tracker.pageview({
hostname: 'example.com',
page: '/home',
title: 'Home',
}, done);
});
});