UNPKG

@comparaonline/event-tracker

Version:

This library it's an interface between any frontend application and some event tracking platforms, currently Snowplow and Tag Manager.

17 lines (16 loc) 468 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.trackToHeap = trackToHeap; function trackToHeap(event) { if (typeof window.heap !== 'object') { console.warn("heap wasn't initialized, failed to track an event push"); return; } if (typeof window.heap.track !== 'function') { console.warn("Can't track events to heap, failed to track an event push"); return; } window.heap.track(event.name, event.data); }