Hi, iam trying to implemnt new cookies banner with Customer privacy setting in hydrogen, I could not find any docs how to implement these changes.
Thanks for any tips !
Topic summary
Developers are struggling to implement Shopify’s customer privacy consent banner in Hydrogen storefronts.
Initial guidance pointed to Shopify’s official documentation and GitHub examples (specifically the GTM example), which require setting environment variables like PUBLIC_STORE_DOMAIN and PUBLIC_STOREFRONT_ID.
However, multiple users report the banner still doesn’t appear despite following these steps.
Key Solution Found:
One user discovered the issue affects those who upgraded from older Hydrogen versions rather than starting fresh. For upgraded projects:
- Follow the standard consent banner documentation for
root.tsxchanges - Additionally implement extra steps from the “Event Tracking” article (framework=hydrogen&extension=typescript section)
- These extra migration steps are necessary for the banner to display correctly
Ongoing Issues:
At least one developer reports the banner won’t appear even in brand new Hydrogen projects created with the latest version, suggesting potential unresolved configuration or setup problems. The discussion remains active with users seeking further troubleshooting help.
Hi @obinecko , you can try follow this example: https://github.com/Shopify/hydrogen/tree/main/examples/gtm#1-enable-customer-privacy–cookie-consent-banner
Thanks for extremply fast response, i was wondering if this could be cause by the theme, iam using hydrogen redirect theme.
Becuase after the implementation of changes, the banner still wont show up
The Hydrogen redirect theme won’t take any effect there. Did you add PUBLIC_STORE_DOMAIN & PUBLIC_STORE_DOMAIN to your Hydrogen storefront environment variables?
Hey there! I am facing a similar issue. I did set up the environment variables but for me the banner still does not appear after following the documentation. Do you have any further hints? Thank you!
Hi, sadly i didnt solve this issue yet, ihave implement CMS, added variables and everything but the consent banner never showed, no matter what I tried. I would have to solve this later, I also checked github repos with examples I have the same code structure as the examples but still no luck ![]()
hopefully you can find the solution, and if you do dont forget to let me know please.
thanks
Hey, I got it working! Happy to share how I did it, hopefully it solves it for you too:
I think, just like me, you upgraded from an older version of Shopify Hydrogen to a newer one. The steps provided in the main article for the Shopify consent banner (https://shopify.dev/docs/storefronts/headless/hydrogen/analytics/consent) applies if you are using the latest version from the start. If you upgraded to the latest version, you need to do extra steps. The extra steps are in the same section under the Event Tracking article (https://shopify.dev/docs/storefronts/headless/hydrogen/analytics/tracking?framework=hydrogen&extension=typescript).
Just do whatever it says there (probably only the root.tsx changes are necessary) and you should be able to see the banner, assuming you did everything else correctly.
wow good job mate !!!
thank you for very clear info will take a look , and hopefully make it work also !
keep up the good job
I have this issue too. My banner shows in liquid themes but not in hydrogen. I also tried creating a brand new empty hydrogen project but it won’t show there either.
Steps to reproduce:
Setup cookie banner in the settings.
Setup new hydrogen:
npm create @Shopify_77 [email removed] – --quickstart
cd hydrogen-quickstart
h2 link
npm run dev