Skip to content

Instantly share code, notes, and snippets.

@MaksimAbramchuk
Created June 26, 2017 20:11
Show Gist options
  • Save MaksimAbramchuk/ebf16a4fab8438c42bc7387d85aa5fc9 to your computer and use it in GitHub Desktop.
Save MaksimAbramchuk/ebf16a4fab8438c42bc7387d85aa5fc9 to your computer and use it in GitHub Desktop.
const ua = require('universal-analytics');
const bluebird = require('bluebird');
const GOOGLE_ANALYTICS_ID = require('../../config').googleAnalytics.uid;
class GoogleAnalytics {
constructor(uid) {
this._uid = uid;
this._visitor = ua(GOOGLE_ANALYTICS_ID, this._uid, { strictCidFormat: false, });
bluebird.promisifyAll(this._visitor);
}
}
module.exports = GoogleAnalytics;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment