@comparaonline/event-tracker
Version:
This library it's an interface between any frontend application and some event tracking platforms, currently Snowplow and Tag Manager.
21 lines (20 loc) • 517 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.track = track;
var _abtasty = require("./abtasty");
var _heap = require("./heap");
const ENABLED_TRACKERS = ['abtasty', 'heap'];
function track(event) {
if (typeof window === 'undefined') {
console.warn("window hasn't initialized");
return;
}
if (ENABLED_TRACKERS.includes('abtasty')) {
(0, _abtasty.trackToABTasty)(event);
}
if (ENABLED_TRACKERS.includes('heap')) {
(0, _heap.trackToHeap)(event);
}
}