@firestitch/analytics
Advanced tools
Comparing version 12.3.9 to 12.3.10
import { Provider } from "./provider"; | ||
export declare class GoogleTagManagerProvider extends Provider { | ||
private _initData; | ||
private _init$; | ||
init(): void; | ||
@@ -16,4 +18,3 @@ pushData(...data: any): void; | ||
private _mapItems; | ||
private _mapTypeEvent; | ||
private _mapEventData; | ||
private _getMapping; | ||
} |
@@ -547,8 +547,22 @@ (function (global, factory) { | ||
function GoogleTagManagerProvider() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this; | ||
_this._initData = []; | ||
_this._init$ = new rxjs.BehaviorSubject(false); | ||
return _this; | ||
} | ||
GoogleTagManagerProvider.prototype.init = function () { | ||
var _this = this; | ||
if (this.containerId) { | ||
var scriptDomain = this.scriptDomain || 'www.googletagmanager.com'; | ||
this.addScript("https://" + scriptDomain + "/gtm.js?id=" + this.containerId); | ||
rxjs.from(this.addScript("https://" + scriptDomain + "/gtm.js?id=" + this.containerId)) | ||
.pipe(operators.switchMap(function () { return rxjs.interval(10); }), operators.take(50), operators.takeWhile(function () { return !_this._init$.getValue(); }), operators.filter(function () { | ||
return _this.window.dataLayer.some(function (item) { return item.event === 'gtm.load'; }); | ||
})) | ||
.subscribe(function () { | ||
_this._init$.next(true); | ||
_this._init$.complete(); | ||
_this._initData.forEach(function (data) { | ||
_this.window.dataLayer.push(data); | ||
}); | ||
}); | ||
this.window.dataLayer = this.window.dataLayer || []; | ||
@@ -574,6 +588,17 @@ this.pushData('js', new Date()); | ||
GoogleTagManagerProvider.prototype.trackEvent = function (type, value, options) { | ||
var data = this._mapEventData(type, value, options); | ||
var event = this._mapTypeEvent(type); | ||
this.window.dataLayer.push({ ecommerce: null }); | ||
this.window.dataLayer.push(Object.assign({ event: event }, data)); | ||
var mapping = this._getMapping(type); | ||
var data = mapping.transform ? | ||
mapping.transform(mapping.type, value) : { | ||
event: type, | ||
value: value, | ||
category: options === null || options === void 0 ? void 0 : options.category, | ||
label: options === null || options === void 0 ? void 0 : options.label, | ||
}; | ||
var dataLayer = this._init$.getValue() ? | ||
this.window.dataLayer : | ||
this._initData; | ||
if (mapping.ecommerce) { | ||
dataLayer.push({ ecommerce: null }); | ||
} | ||
dataLayer.push(data); | ||
}; | ||
@@ -597,4 +622,5 @@ GoogleTagManagerProvider.prototype.setUser = function (data) { }; | ||
}); | ||
GoogleTagManagerProvider.prototype._mapPurchaseEventData = function (value) { | ||
GoogleTagManagerProvider.prototype._mapPurchaseEventData = function (event, value) { | ||
return { | ||
event: event, | ||
ecommerce: { | ||
@@ -610,4 +636,5 @@ transaction_id: value.transactionId, | ||
}; | ||
GoogleTagManagerProvider.prototype._mapBeginCheckoutEventData = function (value) { | ||
GoogleTagManagerProvider.prototype._mapBeginCheckoutEventData = function (event, value) { | ||
return { | ||
event: event, | ||
ecommerce: { | ||
@@ -620,4 +647,5 @@ value: value.total, | ||
}; | ||
GoogleTagManagerProvider.prototype._mapAddToCartEventData = function (value) { | ||
GoogleTagManagerProvider.prototype._mapAddToCartEventData = function (event, value) { | ||
return { | ||
event: event, | ||
ecommerce: { | ||
@@ -630,4 +658,5 @@ value: value.total, | ||
}; | ||
GoogleTagManagerProvider.prototype._mapRemoveFromCartEventData = function (value) { | ||
GoogleTagManagerProvider.prototype._mapRemoveFromCartEventData = function (event, value) { | ||
return { | ||
event: event, | ||
ecommerce: { | ||
@@ -640,4 +669,5 @@ value: value.total, | ||
}; | ||
GoogleTagManagerProvider.prototype._mapAddPaymentEventData = function (value) { | ||
GoogleTagManagerProvider.prototype._mapAddPaymentEventData = function (event, value) { | ||
return { | ||
event: event, | ||
ecommerce: { | ||
@@ -662,42 +692,27 @@ value: value.total, | ||
}; | ||
GoogleTagManagerProvider.prototype._mapTypeEvent = function (type) { | ||
GoogleTagManagerProvider.prototype._getMapping = function (type) { | ||
var _this = this; | ||
var transform; | ||
if (type === exports.EventType.Purcahse) { | ||
return 'purchase'; | ||
type = 'purchase'; | ||
transform = function (event, value) { return _this._mapPurchaseEventData(event, value); }; | ||
} | ||
else if (type === exports.EventType.BeginCheckout) { | ||
return 'begin_checkout'; | ||
type = 'begin_checkout'; | ||
transform = function (event, value) { return _this._mapBeginCheckoutEventData(event, value); }; | ||
} | ||
else if (type === exports.EventType.AddPayment) { | ||
return 'add_payment_info'; | ||
type = 'add_payment_info'; | ||
transform = function (event, value) { return _this._mapAddPaymentEventData(event, value); }; | ||
} | ||
else if (type === exports.EventType.AddToCart) { | ||
return 'add_to_cart'; | ||
type = 'add_to_cart'; | ||
transform = function (event, value) { return _this._mapAddToCartEventData(event, value); }; | ||
} | ||
else if (type === exports.EventType.RemoveFromCart) { | ||
return 'remove_from_cart'; | ||
type = 'remove_from_cart'; | ||
transform = function (event, value) { return _this._mapRemoveFromCartEventData(event, value); }; | ||
} | ||
return type; | ||
return { type: type, transform: transform, ecommerce: !!transform }; | ||
}; | ||
GoogleTagManagerProvider.prototype._mapEventData = function (type, value, options) { | ||
if (type === exports.EventType.Purcahse) { | ||
return this._mapPurchaseEventData(value); | ||
} | ||
else if (type === exports.EventType.BeginCheckout) { | ||
return this._mapBeginCheckoutEventData(value); | ||
} | ||
else if (type === exports.EventType.AddPayment) { | ||
return this._mapAddPaymentEventData(value); | ||
} | ||
else if (type === exports.EventType.AddToCart) { | ||
return this._mapAddToCartEventData(value); | ||
} | ||
else if (type === exports.EventType.RemoveFromCart) { | ||
return this._mapRemoveFromCartEventData(value); | ||
} | ||
return { | ||
value: value, | ||
category: options === null || options === void 0 ? void 0 : options.category, | ||
label: options === null || options === void 0 ? void 0 : options.label, | ||
}; | ||
}; | ||
return GoogleTagManagerProvider; | ||
@@ -704,0 +719,0 @@ }(Provider)); |
import { Provider } from "./provider"; | ||
import { BehaviorSubject, from, interval } from "rxjs"; | ||
import { filter, switchMap, take, takeWhile } from "rxjs/operators"; | ||
import { EventType } from "../enums"; | ||
export class GoogleTagManagerProvider extends Provider { | ||
constructor() { | ||
super(...arguments); | ||
this._initData = []; | ||
this._init$ = new BehaviorSubject(false); | ||
} | ||
init() { | ||
if (this.containerId) { | ||
const scriptDomain = this.scriptDomain || 'www.googletagmanager.com'; | ||
this.addScript(`https://${scriptDomain}/gtm.js?id=${this.containerId}`); | ||
from(this.addScript(`https://${scriptDomain}/gtm.js?id=${this.containerId}`)) | ||
.pipe(switchMap(() => interval(10)), take(50), takeWhile(() => !this._init$.getValue()), filter(() => { | ||
return this.window.dataLayer.some((item) => item.event === 'gtm.load'); | ||
})) | ||
.subscribe(() => { | ||
this._init$.next(true); | ||
this._init$.complete(); | ||
this._initData.forEach((data) => { | ||
this.window.dataLayer.push(data); | ||
}); | ||
}); | ||
this.window.dataLayer = this.window.dataLayer || []; | ||
@@ -24,6 +41,17 @@ this.pushData('js', new Date()); | ||
trackEvent(type, value, options) { | ||
const data = this._mapEventData(type, value, options); | ||
const event = this._mapTypeEvent(type); | ||
this.window.dataLayer.push({ ecommerce: null }); | ||
this.window.dataLayer.push(Object.assign({ event }, data)); | ||
const mapping = this._getMapping(type); | ||
const data = mapping.transform ? | ||
mapping.transform(mapping.type, value) : { | ||
event: type, | ||
value, | ||
category: options === null || options === void 0 ? void 0 : options.category, | ||
label: options === null || options === void 0 ? void 0 : options.label, | ||
}; | ||
const dataLayer = this._init$.getValue() ? | ||
this.window.dataLayer : | ||
this._initData; | ||
if (mapping.ecommerce) { | ||
dataLayer.push({ ecommerce: null }); | ||
} | ||
dataLayer.push(data); | ||
} | ||
@@ -39,4 +67,5 @@ setUser(data) { } | ||
} | ||
_mapPurchaseEventData(value) { | ||
_mapPurchaseEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -52,4 +81,5 @@ transaction_id: value.transactionId, | ||
} | ||
_mapBeginCheckoutEventData(value) { | ||
_mapBeginCheckoutEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -62,4 +92,5 @@ value: value.total, | ||
} | ||
_mapAddToCartEventData(value) { | ||
_mapAddToCartEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -72,4 +103,5 @@ value: value.total, | ||
} | ||
_mapRemoveFromCartEventData(value) { | ||
_mapRemoveFromCartEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -82,4 +114,5 @@ value: value.total, | ||
} | ||
_mapAddPaymentEventData(value) { | ||
_mapAddPaymentEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -104,43 +137,27 @@ value: value.total, | ||
} | ||
_mapTypeEvent(type) { | ||
_getMapping(type) { | ||
let transform; | ||
if (type === EventType.Purcahse) { | ||
return 'purchase'; | ||
type = 'purchase'; | ||
transform = (event, value) => this._mapPurchaseEventData(event, value); | ||
} | ||
else if (type === EventType.BeginCheckout) { | ||
return 'begin_checkout'; | ||
type = 'begin_checkout'; | ||
transform = (event, value) => this._mapBeginCheckoutEventData(event, value); | ||
} | ||
else if (type === EventType.AddPayment) { | ||
return 'add_payment_info'; | ||
type = 'add_payment_info'; | ||
transform = (event, value) => this._mapAddPaymentEventData(event, value); | ||
} | ||
else if (type === EventType.AddToCart) { | ||
return 'add_to_cart'; | ||
type = 'add_to_cart'; | ||
transform = (event, value) => this._mapAddToCartEventData(event, value); | ||
} | ||
else if (type === EventType.RemoveFromCart) { | ||
return 'remove_from_cart'; | ||
type = 'remove_from_cart'; | ||
transform = (event, value) => this._mapRemoveFromCartEventData(event, value); | ||
} | ||
return type; | ||
return { type, transform, ecommerce: !!transform }; | ||
} | ||
_mapEventData(type, value, options) { | ||
if (type === EventType.Purcahse) { | ||
return this._mapPurchaseEventData(value); | ||
} | ||
else if (type === EventType.BeginCheckout) { | ||
return this._mapBeginCheckoutEventData(value); | ||
} | ||
else if (type === EventType.AddPayment) { | ||
return this._mapAddPaymentEventData(value); | ||
} | ||
else if (type === EventType.AddToCart) { | ||
return this._mapAddToCartEventData(value); | ||
} | ||
else if (type === EventType.RemoveFromCart) { | ||
return this._mapRemoveFromCartEventData(value); | ||
} | ||
return { | ||
value, | ||
category: options === null || options === void 0 ? void 0 : options.category, | ||
label: options === null || options === void 0 ? void 0 : options.label, | ||
}; | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ29vZ2xlLXRhZy1tYW5hZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2FwcC9wcm92aWRlcnMvZ29vZ2xlLXRhZy1tYW5hZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFFdEMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUlyQyxNQUFNLE9BQU8sd0JBQXlCLFNBQVEsUUFBUTtJQUU3QyxJQUFJO1FBQ1QsSUFBSSxJQUFJLENBQUMsV0FBVyxFQUFFO1lBQ3BCLE1BQU0sWUFBWSxHQUFHLElBQUksQ0FBQyxZQUFZLElBQUksMEJBQTBCLENBQUM7WUFDckUsSUFBSSxDQUFDLFNBQVMsQ0FBQyxXQUFXLFlBQVksY0FBYyxJQUFJLENBQUMsV0FBVyxFQUFFLENBQUMsQ0FBQztZQUN4RSxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsSUFBSSxFQUFFLENBQUM7WUFFcEQsSUFBSSxDQUFDLFFBQVEsQ0FBQyxJQUFJLEVBQUUsSUFBSSxJQUFJLEVBQUUsQ0FBQyxDQUFDO1lBQ2hDLElBQUksQ0FBQyxRQUFRLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxXQUFXLEVBQUUsRUFBRSxTQUFTLEVBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQyxDQUFDO1NBQzVFO0lBQ0gsQ0FBQztJQUVNLFFBQVEsQ0FBQyxHQU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2FydCkge1xuICAgICAgdHlwZSA9ICdyZW1vdmVfZnJvbV9jYXJ0JztcbiAgICAgIHRyYW5zZm9ybSA9IChldmVudDogc3RyaW5nLCB2YWx1ZTogYW55KSA9PiB0aGlzLl9tYXBSZW1vdmVGcm9tQ2FydEV2ZW50RGF0YShldmVudCwgdmFsdWUpO1xuICAgIH1cblxuICAgIHJldHVybiB7IHR5cGUsIHRyYW5zZm9ybSwgZWNvbW1lcmNlOiAhIXRyYW5zZm9ybSB9O1xuICB9XG59Il19 |
@@ -34,2 +34,2 @@ import { NavigationEnd } from "@angular/router"; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvdmlkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYXBwL3Byb3ZpZGVycy9wcm92aWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsYUFBYSxFQUFVLE1BQU0saUJBQWlCLENBQUM7QUFFeEQsT0FBTyxFQUFFLE1BQU0sRUFBRSxJQUFJLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUk5QyxNQUFNLE9BQWdCLFFBQVE7SUFhNUIsWUFDWSxTQUFtQixFQUNuQixPQUEwQixFQUMxQixPQUFlO1FBRmYsY0FBUyxHQUFULFNBQVMsQ0FBVTtRQUNuQixZQUFPLEdBQVAsT0FBTyxDQUFtQjtRQUMxQixZQUFPLEdBQVAsT0FBTyxDQUFRO1FBRXpCLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLElBQUksQ0FDdEIsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUNQLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLEtBQUssWUFBWSxhQUFhLENBQUMsQ0FDaEQ7YUFDRSxTQUFTLENBQUMsQ0FBQyxLQUFvQixFQUFFLEVBQUU7WUFDbEM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yaXB0KTtcbiAgICB9KTtcbiAgfVxuXG4gIHB1YmxpYyBhcHBlbmRIZWFkKGVsKSB7XG4gICAgZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2hlYWQnKVswXS5hcHBlbmRDaGlsZChlbCk7XG4gIH1cbn0iXX0= |
import * as i0 from '@angular/core'; | ||
import { InjectionToken, Injectable, Inject, Directive, Input, NgModule } from '@angular/core'; | ||
import { of, Subject, fromEvent } from 'rxjs'; | ||
import { skip, filter, take, takeUntil } from 'rxjs/operators'; | ||
import { BehaviorSubject, from, interval, of, Subject, fromEvent } from 'rxjs'; | ||
import { skip, filter, switchMap, take, takeWhile, takeUntil } from 'rxjs/operators'; | ||
import * as i1 from '@angular/router'; | ||
@@ -171,6 +171,21 @@ import { NavigationEnd } from '@angular/router'; | ||
class GoogleTagManagerProvider extends Provider { | ||
constructor() { | ||
super(...arguments); | ||
this._initData = []; | ||
this._init$ = new BehaviorSubject(false); | ||
} | ||
init() { | ||
if (this.containerId) { | ||
const scriptDomain = this.scriptDomain || 'www.googletagmanager.com'; | ||
this.addScript(`https://${scriptDomain}/gtm.js?id=${this.containerId}`); | ||
from(this.addScript(`https://${scriptDomain}/gtm.js?id=${this.containerId}`)) | ||
.pipe(switchMap(() => interval(10)), take(50), takeWhile(() => !this._init$.getValue()), filter(() => { | ||
return this.window.dataLayer.some((item) => item.event === 'gtm.load'); | ||
})) | ||
.subscribe(() => { | ||
this._init$.next(true); | ||
this._init$.complete(); | ||
this._initData.forEach((data) => { | ||
this.window.dataLayer.push(data); | ||
}); | ||
}); | ||
this.window.dataLayer = this.window.dataLayer || []; | ||
@@ -192,6 +207,17 @@ this.pushData('js', new Date()); | ||
trackEvent(type, value, options) { | ||
const data = this._mapEventData(type, value, options); | ||
const event = this._mapTypeEvent(type); | ||
this.window.dataLayer.push({ ecommerce: null }); | ||
this.window.dataLayer.push(Object.assign({ event }, data)); | ||
const mapping = this._getMapping(type); | ||
const data = mapping.transform ? | ||
mapping.transform(mapping.type, value) : { | ||
event: type, | ||
value, | ||
category: options === null || options === void 0 ? void 0 : options.category, | ||
label: options === null || options === void 0 ? void 0 : options.label, | ||
}; | ||
const dataLayer = this._init$.getValue() ? | ||
this.window.dataLayer : | ||
this._initData; | ||
if (mapping.ecommerce) { | ||
dataLayer.push({ ecommerce: null }); | ||
} | ||
dataLayer.push(data); | ||
} | ||
@@ -207,4 +233,5 @@ setUser(data) { } | ||
} | ||
_mapPurchaseEventData(value) { | ||
_mapPurchaseEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -220,4 +247,5 @@ transaction_id: value.transactionId, | ||
} | ||
_mapBeginCheckoutEventData(value) { | ||
_mapBeginCheckoutEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -230,4 +258,5 @@ value: value.total, | ||
} | ||
_mapAddToCartEventData(value) { | ||
_mapAddToCartEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -240,4 +269,5 @@ value: value.total, | ||
} | ||
_mapRemoveFromCartEventData(value) { | ||
_mapRemoveFromCartEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -250,4 +280,5 @@ value: value.total, | ||
} | ||
_mapAddPaymentEventData(value) { | ||
_mapAddPaymentEventData(event, value) { | ||
return { | ||
event, | ||
ecommerce: { | ||
@@ -272,42 +303,26 @@ value: value.total, | ||
} | ||
_mapTypeEvent(type) { | ||
_getMapping(type) { | ||
let transform; | ||
if (type === EventType.Purcahse) { | ||
return 'purchase'; | ||
type = 'purchase'; | ||
transform = (event, value) => this._mapPurchaseEventData(event, value); | ||
} | ||
else if (type === EventType.BeginCheckout) { | ||
return 'begin_checkout'; | ||
type = 'begin_checkout'; | ||
transform = (event, value) => this._mapBeginCheckoutEventData(event, value); | ||
} | ||
else if (type === EventType.AddPayment) { | ||
return 'add_payment_info'; | ||
type = 'add_payment_info'; | ||
transform = (event, value) => this._mapAddPaymentEventData(event, value); | ||
} | ||
else if (type === EventType.AddToCart) { | ||
return 'add_to_cart'; | ||
type = 'add_to_cart'; | ||
transform = (event, value) => this._mapAddToCartEventData(event, value); | ||
} | ||
else if (type === EventType.RemoveFromCart) { | ||
return 'remove_from_cart'; | ||
type = 'remove_from_cart'; | ||
transform = (event, value) => this._mapRemoveFromCartEventData(event, value); | ||
} | ||
return type; | ||
return { type, transform, ecommerce: !!transform }; | ||
} | ||
_mapEventData(type, value, options) { | ||
if (type === EventType.Purcahse) { | ||
return this._mapPurchaseEventData(value); | ||
} | ||
else if (type === EventType.BeginCheckout) { | ||
return this._mapBeginCheckoutEventData(value); | ||
} | ||
else if (type === EventType.AddPayment) { | ||
return this._mapAddPaymentEventData(value); | ||
} | ||
else if (type === EventType.AddToCart) { | ||
return this._mapAddToCartEventData(value); | ||
} | ||
else if (type === EventType.RemoveFromCart) { | ||
return this._mapRemoveFromCartEventData(value); | ||
} | ||
return { | ||
value, | ||
category: options === null || options === void 0 ? void 0 : options.category, | ||
label: options === null || options === void 0 ? void 0 : options.label, | ||
}; | ||
} | ||
} | ||
@@ -314,0 +329,0 @@ |
{ | ||
"name": "@firestitch/analytics", | ||
"version": "12.3.9", | ||
"version": "12.3.10", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
256673
2211