@cmpsr/analytics
Advanced tools
Comparing version 0.4.2-canary-20241121114832 to 0.4.2-canary-20241121212108
@@ -11,3 +11,3 @@ import { Identify, Group, Page, Track } from 'types'; | ||
reset: () => void; | ||
revenue: () => void; | ||
revenue: (price: any, quantity: any, type: any) => void; | ||
} |
@@ -129,5 +129,9 @@ "use strict"; | ||
}); | ||
_define_property(this, "revenue", function() {}); | ||
_define_property(this, "revenue", function(price, quantity, type) { | ||
var amplitude = window.amplitude; | ||
var event = new amplitude.Revenue().setPrice(price).setQuantity(quantity).setRevenueType(type); | ||
amplitude.revenue(event); | ||
}); | ||
var amplitude = (0, _loadAmplitude.loadAmplitude)(); | ||
amplitude.init(config.apiKey); | ||
}; |
@@ -7,3 +7,3 @@ import { Identify, Group, Track } from 'types'; | ||
constructor(config: MetaConfig); | ||
revenue: (type: any, price: any, quantity: any, productId?: string, currency?: string) => void; | ||
revenue: (price: any, quantity: any, type: any, productId?: string, currency?: string) => void; | ||
identify: Identify; | ||
@@ -10,0 +10,0 @@ track: Track; |
@@ -35,3 +35,3 @@ "use strict"; | ||
_define_property(this, "fbq", void 0); | ||
_define_property(this, "revenue", function(type, price, quantity) { | ||
_define_property(this, "revenue", function(price, quantity, type) { | ||
var productId = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "1", currency = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "USD"; | ||
@@ -38,0 +38,0 @@ if (type.toLowerCase() !== "new") { |
@@ -22,5 +22,5 @@ export interface IIdentifyTraits { | ||
export type Track = (eventName: string, traits?: ITrackTraits) => void; | ||
export type Revenue = (type: string, price: number, quantity: number, productId?: string | number, currency?: string) => void; | ||
export type Revenue = (price: number, quantity: number, type: string, productId?: string | number, currency?: string) => void; | ||
export interface IUser { | ||
anonymousId: string; | ||
} |
@@ -10,3 +10,3 @@ { | ||
}, | ||
"version": "0.4.2-canary-20241121114832", | ||
"version": "0.4.2-canary-20241121212108", | ||
"author": "Steve Cox <stevejcox@me.com>", | ||
@@ -13,0 +13,0 @@ "license": "MIT", |
53877
1468