@threekit/analytics
Advanced tools
Comparing version 0.1.88 to 0.1.91
@@ -131,6 +131,5 @@ import { ARStage, type AssetOption, Configuration, type Context, OptionInteractionType, OptionsType, type QuizOption, ShareType, type ThreekitAuthProps, type ValueOption, VisualInteractionType } from '@threekit/rest-api'; | ||
}): void; | ||
addToCart({ configurationId, cartCustomId, eventSubType, assetId, configuration, itemPrice, itemCount, itemName, itemCustomId, orderId, orderCustomId, orderDetails, orderPrice, customerId, customerCustomId, customerDetails }: { | ||
addToCart({ configurationId, cartCustomId, assetId, configuration, itemPrice, itemCount, itemName, itemCustomId, orderId, orderCustomId, orderDetails, orderPrice, customerId, customerCustomId, customerDetails }: { | ||
configurationId?: string; | ||
cartCustomId?: string; | ||
eventSubType?: string; | ||
assetId?: string; | ||
@@ -150,5 +149,4 @@ configuration?: Configuration; | ||
}): void; | ||
purchase({ configurationId, eventSubType, orderId, orderCustomId, orderDetails, orderPrice, cart, purchaseCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }: { | ||
purchase({ configurationId, orderId, orderCustomId, orderDetails, orderPrice, cart, purchaseCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }: { | ||
configurationId?: string; | ||
eventSubType?: string; | ||
orderId?: string; | ||
@@ -173,5 +171,4 @@ orderCustomId?: string; | ||
}): void; | ||
quote({ configurationId, eventSubType, orderId, orderCustomId, orderDetails, orderPrice, cart, quoteCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }: { | ||
quote({ configurationId, orderId, orderCustomId, orderDetails, orderPrice, cart, quoteCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }: { | ||
configurationId?: string; | ||
eventSubType?: string; | ||
orderId?: string; | ||
@@ -196,5 +193,4 @@ orderCustomId?: string; | ||
}): void; | ||
lead({ configurationId, eventSubType, orderId, orderCustomId, orderDetails, orderPrice, leadCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }: { | ||
lead({ configurationId, orderId, orderCustomId, orderDetails, orderPrice, leadCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }: { | ||
configurationId?: string; | ||
eventSubType?: string; | ||
orderId?: string; | ||
@@ -201,0 +197,0 @@ orderCustomId?: string; |
@@ -7,4 +7,2 @@ import { errorToString } from '@threekit/diagnostics'; | ||
import { getUserId } from './getUserId.js'; | ||
const cSessionStartStageName = 'Session Start'; | ||
const cSessionEndStageName = 'Session End'; | ||
export class Session { | ||
@@ -32,3 +30,2 @@ auth; | ||
this.tryCatchBlock(() => { | ||
this.stage({ stageName: cSessionStartStageName }); | ||
if (window !== undefined) { | ||
@@ -39,3 +36,2 @@ // add beforeunload listener | ||
this.isEnded = true; | ||
this.stage({ stageName: cSessionEndStageName }); | ||
} | ||
@@ -269,3 +265,2 @@ }); | ||
: undefined; | ||
const sessionDuration = roundTo((new Date().getTime() - this.sessionStart.getTime()) / 1000, 3); | ||
const event = { | ||
@@ -278,3 +273,2 @@ ...this.getCommonEventProperties({ | ||
previousStageDuration2, | ||
sessionDuration: stageName === cSessionEndStageName ? sessionDuration : undefined, | ||
eventType: Event2Type.Stage | ||
@@ -364,3 +358,3 @@ }; | ||
} | ||
addToCart({ configurationId, cartCustomId, eventSubType, assetId, configuration, itemPrice, itemCount = 1, itemName, itemCustomId, orderId, orderCustomId, orderDetails, orderPrice, customerId, customerCustomId, customerDetails }) { | ||
addToCart({ configurationId, cartCustomId, assetId, configuration, itemPrice, itemCount = 1, itemName, itemCustomId, orderId, orderCustomId, orderDetails, orderPrice, customerId, customerCustomId, customerDetails }) { | ||
this.tryCatchBlock(() => { | ||
@@ -373,3 +367,2 @@ const event = { | ||
eventType: Event2Type.AddToCart, | ||
eventSubType, | ||
itemName, | ||
@@ -392,3 +385,3 @@ itemCustomId, | ||
} | ||
purchase({ configurationId, eventSubType, orderId, orderCustomId, orderDetails, orderPrice, cart, purchaseCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }) { | ||
purchase({ configurationId, orderId, orderCustomId, orderDetails, orderPrice, cart, purchaseCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }) { | ||
this.tryCatchBlock(() => { | ||
@@ -401,3 +394,2 @@ const event = { | ||
eventType: Event2Type.Purchase, | ||
eventSubType, | ||
configurationId, | ||
@@ -417,3 +409,3 @@ orderId, | ||
} | ||
quote({ configurationId, eventSubType, orderId, orderCustomId, orderDetails, orderPrice, cart, quoteCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }) { | ||
quote({ configurationId, orderId, orderCustomId, orderDetails, orderPrice, cart, quoteCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }) { | ||
this.tryCatchBlock(() => { | ||
@@ -426,3 +418,2 @@ const event = { | ||
eventType: Event2Type.Quote, | ||
eventSubType, | ||
configurationId, | ||
@@ -442,3 +433,3 @@ orderId, | ||
} | ||
lead({ configurationId, eventSubType, orderId, orderCustomId, orderDetails, orderPrice, leadCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }) { | ||
lead({ configurationId, orderId, orderCustomId, orderDetails, orderPrice, leadCustomId, assetId, configuration, customerId, customerCustomId, customerDetails }) { | ||
this.tryCatchBlock(() => { | ||
@@ -451,3 +442,2 @@ const event = { | ||
eventType: Event2Type.Lead, | ||
eventSubType, | ||
configurationId, | ||
@@ -454,0 +444,0 @@ orderId, |
{ | ||
"name": "@threekit/analytics", | ||
"version": "0.1.88", | ||
"version": "0.1.91", | ||
"type": "module", | ||
@@ -9,7 +9,7 @@ "main": "dist/index.js", | ||
"@threekit/diagnostics": "*", | ||
"@threekit/rest-api": "^0.1.88", | ||
"@threekit/rest-api": "^0.1.91", | ||
"uuid": "^9.0.1" | ||
}, | ||
"sideEffects": false, | ||
"gitHead": "5d87649303ca61e1178eed4a150016e06326801c" | ||
"gitHead": "ea2524a9fd447499ae46d6cd2a8514e836ea3c20" | ||
} |
@@ -54,5 +54,2 @@ import { errorToString } from '@threekit/diagnostics'; | ||
const cSessionStartStageName = 'Session Start'; | ||
const cSessionEndStageName = 'Session End'; | ||
export class Session { | ||
@@ -93,4 +90,2 @@ public auth: ThreekitAuthProps; | ||
this.tryCatchBlock(() => { | ||
this.stage({ stageName: cSessionStartStageName }); | ||
if (window !== undefined) { | ||
@@ -101,3 +96,2 @@ // add beforeunload listener | ||
this.isEnded = true; | ||
this.stage({ stageName: cSessionEndStageName }); | ||
} | ||
@@ -453,6 +447,2 @@ }); | ||
: undefined; | ||
const sessionDuration = roundTo( | ||
(new Date().getTime() - this.sessionStart.getTime()) / 1000, | ||
3 | ||
); | ||
@@ -466,4 +456,2 @@ const event: StageEvent = { | ||
previousStageDuration2, | ||
sessionDuration: | ||
stageName === cSessionEndStageName ? sessionDuration : undefined, | ||
eventType: Event2Type.Stage | ||
@@ -634,3 +622,2 @@ }; | ||
cartCustomId, | ||
eventSubType, | ||
assetId, | ||
@@ -652,3 +639,2 @@ configuration, | ||
cartCustomId?: string; | ||
eventSubType?: string; | ||
assetId?: string; | ||
@@ -675,3 +661,2 @@ configuration?: Configuration; | ||
eventType: Event2Type.AddToCart, | ||
eventSubType, | ||
itemName, | ||
@@ -698,3 +683,2 @@ itemCustomId, | ||
configurationId, | ||
eventSubType, | ||
orderId, | ||
@@ -713,3 +697,2 @@ orderCustomId, | ||
configurationId?: string; | ||
eventSubType?: string; | ||
orderId?: string; | ||
@@ -741,3 +724,2 @@ orderCustomId?: string; | ||
eventType: Event2Type.Purchase, | ||
eventSubType, | ||
configurationId, | ||
@@ -761,3 +743,2 @@ orderId, | ||
configurationId, | ||
eventSubType, | ||
orderId, | ||
@@ -776,3 +757,2 @@ orderCustomId, | ||
configurationId?: string; | ||
eventSubType?: string; | ||
orderId?: string; | ||
@@ -804,3 +784,2 @@ orderCustomId?: string; | ||
eventType: Event2Type.Quote, | ||
eventSubType, | ||
configurationId, | ||
@@ -824,3 +803,2 @@ orderId, | ||
configurationId, | ||
eventSubType, | ||
orderId, | ||
@@ -838,3 +816,2 @@ orderCustomId, | ||
configurationId?: string; | ||
eventSubType?: string; | ||
orderId?: string; | ||
@@ -858,3 +835,2 @@ orderCustomId?: string; | ||
eventType: Event2Type.Lead, | ||
eventSubType, | ||
configurationId, | ||
@@ -861,0 +837,0 @@ orderId, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
183533
1955
Updated@threekit/rest-api@^0.1.91