From f2ee2ee31f1f647ff816898d681c2e9613295050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Gaudencio=20do=20R=C3=AAgo?= Date: Thu, 26 Sep 2024 11:31:20 -0300 Subject: [PATCH] Fix posthog pageview event (#883) * fix pageview event * Lint --- posthog/components/PostHog.tsx | 2 +- shopify/loaders/ProductListingPage.ts | 4 ++-- vtex/loaders/product/extend.ts | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/posthog/components/PostHog.tsx b/posthog/components/PostHog.tsx index 2c46f846f..12b28a1b9 100644 --- a/posthog/components/PostHog.tsx +++ b/posthog/components/PostHog.tsx @@ -27,7 +27,7 @@ const snippet = () => { // Flags and additional dimentions const props: Record = {}; const trackPageview = () => - globalThis.window.posthog?.capture("pageview", props); + globalThis.window.posthog?.capture("$pageview", props); // Attach pushState and popState listeners const originalPushState = history.pushState; if (originalPushState) { diff --git a/shopify/loaders/ProductListingPage.ts b/shopify/loaders/ProductListingPage.ts index 0997cee8d..6986070f8 100644 --- a/shopify/loaders/ProductListingPage.ts +++ b/shopify/loaders/ProductListingPage.ts @@ -217,9 +217,9 @@ export const cacheKey = (props: Props, req: Request): string | null => { startCursor, sort, }); - + url.searchParams.forEach((value, key) => { - if(!key.startsWith("filter.")) return; + if (!key.startsWith("filter.")) return; searchParams.append(key, value); }); diff --git a/vtex/loaders/product/extend.ts b/vtex/loaders/product/extend.ts index 1c201f30c..4fb47a50e 100644 --- a/vtex/loaders/product/extend.ts +++ b/vtex/loaders/product/extend.ts @@ -17,7 +17,6 @@ export interface Props { * @description Adds brand information to products, useful for Intelligent Search loaders. */ brands?: boolean; - products: Product[]; }