From a31db380b6c58c821acda708231caaedf53d4cb8 Mon Sep 17 00:00:00 2001 From: Yair Dovrat Date: Fri, 12 Apr 2024 15:17:12 +0200 Subject: [PATCH] in case of pageview return early --- src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index c11164c..00e4abe 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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() } @@ -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'