@firestitch/analytics
Advanced tools
Comparing version 12.3.7 to 12.3.8
@@ -16,3 +16,4 @@ import { Provider } from "./provider"; | ||
private _mapItems; | ||
private _mapTypeEvent; | ||
private _mapEventData; | ||
} |
@@ -574,4 +574,5 @@ (function (global, factory) { | ||
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: type }, data)); | ||
this.window.dataLayer.push(Object.assign({ event: event }, data)); | ||
}; | ||
@@ -655,2 +656,20 @@ GoogleTagManagerProvider.prototype.setUser = function (data) { }; | ||
}; | ||
GoogleTagManagerProvider.prototype._mapTypeEvent = function (type) { | ||
if (type === exports.EventType.Purcahse) { | ||
return 'purchase'; | ||
} | ||
else if (type === exports.EventType.BeginCheckout) { | ||
return 'begin_checkout'; | ||
} | ||
else if (type === exports.EventType.AddPayment) { | ||
return 'add_payment_info'; | ||
} | ||
else if (type === exports.EventType.AddToCart) { | ||
return 'add_to_cart'; | ||
} | ||
else if (type === exports.EventType.RemoveFromCart) { | ||
return 'remove_from_cart'; | ||
} | ||
return type; | ||
}; | ||
GoogleTagManagerProvider.prototype._mapEventData = function (type, value, options) { | ||
@@ -657,0 +676,0 @@ if (type === exports.EventType.Purcahse) { |
@@ -25,4 +25,5 @@ import { Provider } from "./provider"; | ||
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: type }, data)); | ||
this.window.dataLayer.push(Object.assign({ event }, data)); | ||
} | ||
@@ -98,2 +99,20 @@ setUser(data) { } | ||
} | ||
_mapTypeEvent(type) { | ||
if (type === EventType.Purcahse) { | ||
return 'purchase'; | ||
} | ||
else if (type === EventType.BeginCheckout) { | ||
return 'begin_checkout'; | ||
} | ||
else if (type === EventType.AddPayment) { | ||
return 'add_payment_info'; | ||
} | ||
else if (type === EventType.AddToCart) { | ||
return 'add_to_cart'; | ||
} | ||
else if (type === EventType.RemoveFromCart) { | ||
return 'remove_from_cart'; | ||
} | ||
return type; | ||
} | ||
_mapEventData(type, value, options) { | ||
@@ -122,2 +141,2 @@ if (type === EventType.Purcahse) { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ29vZ2xlLXRhZy1tYW5hZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2FwcC9wcm92aWRlcnMvZ29vZ2xlLXRhZy1tYW5hZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFFdEMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUlyQyxNQUFNLE9BQU8sd0JBQXlCLFNBQVEsUUFBUTtJQUU3QyxJQUFJO1FBQ1QsSUFBSSxJQUFJLENBQUMsV0FBVyxFQUFFO1lBQ3BCLE1BQU0sWUFBWSxHQUFHLElBQUksQ0FBQyxZQUFZLElBQUksMEJBQTBCLENBQUM7WUFDckUsSUFBSSxDQUFDLFNBQVMsQ0FBQyxXQUFXLFlBQVksY0FBYyxJQUFJLENBQUMsV0FBVyxFQUFFLENBQUMsQ0FBQztZQUN4RSxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsSUFBSSxFQUFFLENBQUM7WUFFcEQsSUFBSSxDQUFDLFFBQVEsQ0FBQyxJQUFJLEVBQUUsSUFBSSxJQUFJLEVBQUUsQ0FBQyxDQUFDO1lBQ2hDLElBQUksQ0FBQyxRQUFRLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxXQUFXLEVBQUUsRUFBRSxTQUFTLEVBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQ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mVGcm9tQ2FydCkge1xuICAgICAgcmV0dXJuIHRoaXMuX21hcFJlbW92ZUZyb21DYXJ0RXZlbnREYXRhKHZhbHVlKTtcbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgdmFsdWUsXG4gICAgICBjYXRlZ29yeTogb3B0aW9ucz8uY2F0ZWdvcnksXG4gICAgICBsYWJlbDogb3B0aW9ucz8ubGFiZWwsXG4gICAgfSBhcyBhbnk7XG4gIH1cbn0iXX0= |
@@ -192,4 +192,5 @@ import * as i0 from '@angular/core'; | ||
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: type }, data)); | ||
this.window.dataLayer.push(Object.assign({ event }, data)); | ||
} | ||
@@ -265,2 +266,20 @@ setUser(data) { } | ||
} | ||
_mapTypeEvent(type) { | ||
if (type === EventType.Purcahse) { | ||
return 'purchase'; | ||
} | ||
else if (type === EventType.BeginCheckout) { | ||
return 'begin_checkout'; | ||
} | ||
else if (type === EventType.AddPayment) { | ||
return 'add_payment_info'; | ||
} | ||
else if (type === EventType.AddToCart) { | ||
return 'add_to_cart'; | ||
} | ||
else if (type === EventType.RemoveFromCart) { | ||
return 'remove_from_cart'; | ||
} | ||
return type; | ||
} | ||
_mapEventData(type, value, options) { | ||
@@ -267,0 +286,0 @@ if (type === EventType.Purcahse) { |
{ | ||
"name": "@firestitch/analytics", | ||
"version": "12.3.7", | ||
"version": "12.3.8", | ||
"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
246460
2163