Skip to content

Commit

Permalink
init useShopifyCookies to true
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpprieto committed Aug 29, 2024
1 parent 59015cc commit 073464b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/hydrogen/src/analytics-manager/ShopifyAnalytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ export function ShopifyAnalytics({
onReady: () => setPrivacyReady(true),
});

const hasUserConsent = privacyReady ? canTrack() : false;

// set up shopify_Y and shopify_S cookies
useShopifyCookies({hasUserConsent, domain, checkoutDomain});
useShopifyCookies({
hasUserConsent: privacyReady ? canTrack() : true, // must be initialized with true
domain,
checkoutDomain
});

useEffect(() => {
if (init.current) return;
Expand Down

0 comments on commit 073464b

Please sign in to comment.