Skip to content

Commit

Permalink
Merge pull request #6 from managed-components/gclid-fix
Browse files Browse the repository at this point in the history
get and set gclid on every pageview
  • Loading branch information
ad-astra-via authored Jul 1, 2024
2 parents cdf94eb + 64bc63b commit 868e13d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,6 @@ export const eventHandler = async (
// u_nplug: 3
// u_nmime: 4

if (settings.conversionLinker) {
// only handle conversion linker if gclid query param exists
if (client.url.searchParams.get('gclid')) {
conversionLinkerHandler(event, settings)
}
}

if (client.url.searchParams.get('_gl')) {
try {
const gclaw = atob(
Expand Down Expand Up @@ -139,6 +132,7 @@ export const eventHandler = async (

export default async function (manager: Manager, settings: ComponentSettings) {
manager.addEventListener('pageview', event => {
conversionLinkerHandler(event, settings)
eventHandler('pageview', event, settings)
})
manager.addEventListener('conversion', event => {
Expand Down

0 comments on commit 868e13d

Please sign in to comment.