Skip to content

Commit

Permalink
useSaveCampaign: track creative
Browse files Browse the repository at this point in the history
  • Loading branch information
mantikoros committed Sep 19, 2024
1 parent 8de86a6 commit 5cb7c8f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web/hooks/use-save-campaign.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { removeNullOrUndefinedProps } from 'common/util/object'
import { useEffect } from 'react'
import { setOnceUserProperty, track } from 'web/lib/service/analytics'

Expand All @@ -8,6 +9,12 @@ export const useSaveCampaign = () => {
if (!campaign) return

setOnceUserProperty('campaign', campaign)
track('view campaign', { campaign })

const creative = urlParams.get('cr')
if (creative) {
setOnceUserProperty('creative', creative)
}

track('view campaign', removeNullOrUndefinedProps({ campaign, creative }))
}, [])
}

0 comments on commit 5cb7c8f

Please sign in to comment.