Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Sep 24, 2024
1 parent f95ddef commit 42762e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugin-server/src/utils/db/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export function timeoutGuard(
}
}, timeout)
}

// campaign params - automatically added by posthog-js here https://github.com/PostHog/posthog-js/blob/master/src/utils/event-utils.ts
export const camapignParams = new Set([
// When changing this set, make sure you also make the same changes in:
// - taxonomy.tsx (CAMPAIGN_PROPERTIES)
// - posthog-js event-utils.ts (CAMPAIGN_PARAMS)
export const campaignParams = new Set([
'utm_source',
'utm_medium',
'utm_campaign',
Expand All @@ -75,11 +76,12 @@ export const camapignParams = new Set([
'rdt_cid', // reddit
])

export const initialCampaignParams = new Set(Array.from(camapignParams, (key) => `$initial_${key.replace('$', '')}`))
export const initialCampaignParams = new Set(Array.from(campaignParams, (key) => `$initial_${key.replace('$', '')}`))

export const initialCampaignParamsDefault = Object.fromEntries(Array.from(initialCampaignParams, (key) => [key, null]))

// when changing this set, be sure to update the frontend as well (taxonomy.tsx (eventToPersonProperties))
// When changing this set, make sure you also make the same changes in:
// - taxonomy.tsx (PERSON_PROPERTIES_ADAPTED_FROM_EVENT)
export const eventToPersonProperties = new Set([
// mobile params
'$app_build',
Expand All @@ -98,7 +100,7 @@ export const eventToPersonProperties = new Set([
'$referring_domain',
'$referrer',

...camapignParams,
...campaignParams,
])
export const initialEventToPersonProperties = new Set(
Array.from(eventToPersonProperties, (key) => `$initial_${key.replace('$', '')}`)
Expand Down

0 comments on commit 42762e8

Please sign in to comment.