@cmpsr/analytics
Advanced tools
Comparing version 0.4.2-canary-20241121113939 to 0.4.2-canary-20241121114832
@@ -7,3 +7,3 @@ import { Identify, Group, Track } from 'types'; | ||
constructor(config: MetaConfig); | ||
revenue: (price: any, quantity: any, type: any, currency?: string) => void; | ||
revenue: (type: any, price: any, quantity: any, productId?: string, currency?: string) => void; | ||
identify: Identify; | ||
@@ -10,0 +10,0 @@ track: Track; |
@@ -35,4 +35,4 @@ "use strict"; | ||
_define_property(this, "fbq", void 0); | ||
_define_property(this, "revenue", function(price, quantity, type) { | ||
var currency = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "USD"; | ||
_define_property(this, "revenue", function(type, price, quantity) { | ||
var productId = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "1", currency = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "USD"; | ||
if (type.toLowerCase() !== "new") { | ||
@@ -43,3 +43,3 @@ _this.fbq("track", "InitiateCheckout", { | ||
{ | ||
id: "1", | ||
id: productId, | ||
quantity: quantity | ||
@@ -56,3 +56,3 @@ } | ||
{ | ||
id: "1", | ||
id: productId, | ||
quantity: quantity | ||
@@ -59,0 +59,0 @@ } |
@@ -22,5 +22,5 @@ export interface IIdentifyTraits { | ||
export type Track = (eventName: string, traits?: ITrackTraits) => void; | ||
export type Revenue = (price: number, quantity: number, type: string) => void; | ||
export type Revenue = (type: string, price: number, quantity: number, productId?: string | number, currency?: string) => void; | ||
export interface IUser { | ||
anonymousId: string; | ||
} |
@@ -10,3 +10,3 @@ { | ||
}, | ||
"version": "0.4.2-canary-20241121113939", | ||
"version": "0.4.2-canary-20241121114832", | ||
"author": "Steve Cox <stevejcox@me.com>", | ||
@@ -13,0 +13,0 @@ "license": "MIT", |
53635