Skip to content

Commit

Permalink
in case of pageview return early
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-astra-via committed Apr 12, 2024
1 parent 1553f0d commit a31db38
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ export const eventHandler = async (
console.error(e)
}
}
if (eventType === 'pageview') {
return
}

if (client.get('_gcl_aw')) {
query.gclaw = client.get('_gcl_aw')?.split('.').pop()
}
Expand All @@ -113,9 +117,7 @@ export const eventHandler = async (
const params = new URLSearchParams({ ...query, ...payload }).toString()

let baseURL = ''
if (eventType === 'pageview') {
return
} else if (eventType === 'remarketing') {
if (eventType === 'remarketing') {
baseURL = 'https://www.google.com/pagead/1p-user-list'
} else {
baseURL = 'https://www.googleadservices.com/pagead/conversion'
Expand Down

0 comments on commit a31db38

Please sign in to comment.