diff --git a/src/index.ts b/src/index.ts index 123d26c..a3594b0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,4 @@ import { - Client, ComponentSettings, Manager, MCEvent, diff --git a/src/requestBuilder.ts b/src/requestBuilder.ts index 2994beb..2d6cef6 100644 --- a/src/requestBuilder.ts +++ b/src/requestBuilder.ts @@ -65,7 +65,7 @@ function getToolRequest( // Determine if the session is engaged to set the 'seg' value const pageviewCounter = parseInt(client.get('pageviewCounter') || '0') const conversionCounter = parseInt(client.get('conversionCounter') || '0') - let engagementDuration = parseInt(client.get('engagementDuration') || '0') + const engagementDuration = parseInt(client.get('engagementDuration') || '0') // Session will be marked engaged if longer than 10 seconds, has at least 1 conversion event, and 2 or more pageviews if ( diff --git a/src/utils.ts b/src/utils.ts index 8712645..92313e7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,4 @@ -import { Client, MCEvent } from "@managed-components/types" +import { Client, MCEvent } from '@managed-components/types' export const flattenKeys = (obj: { [k: string]: unknown } = {}, prefix = '') => Object.keys(obj).reduce((acc: { [k: string]: unknown }, k) => { @@ -59,7 +59,7 @@ export const countPageview = (client: Client) => { // conversion events in session counter export const countConversion = (event: MCEvent) => { - const {client} = event + const { client } = event let conversionCounter = parseInt(client.get('conversionCounter') || '0') || 0 if (conversionCounter === 0 && event.payload.conversion) { client.set('conversionCounter', '1', { scope: 'session' }) @@ -69,4 +69,4 @@ export const countConversion = (event: MCEvent) => { scope: 'session', }) } -} \ No newline at end of file +}