Common Hydrogen Issues: Solutions and Workarounds

When migrating to Hydrogen, there are a number of small issues to consider, which Fueled has seen brands forget about until after they go live. Here’s a list of gotchas that brands should plan for when migrating to Hydrogen.

Client-Side URL Redirects

For Shopify Liquid Storefronts, you can set up server-side redirects. If a shopper hits an old URL, Shopify automatically renders the new URL as part of the response.

With Hydrogen, these redirects are typically handled client-side. For example, if someone clicks a link to shop.example.com/product/xyz, that URL will load, and then redirect to www.example.com/product/xyz.

These redirects can break attribution. For example, Google Analytics (and even Shopify Analytics) will see the referring URL as shop.example.com/product/xyz, not the URL of the advertisement or external link that sent the traffic to your website. This will lead to a high level of traffic being attributed as “Direct.”

Where Do Client-Side Redirects Impact Hydrogen Sites?

This issue can surface in a number of places:

  1. Google Merchant Center and Other Catalog Feeds For some reason, when you migrate to Hydrogen, Shopify uses the checkout URL for the product URL in its built-in integrations with Google Merchant Center, Facebook Catalog, TikTok Catalog, and so forth.

    There is no solution for this out of the box. Brands really need to leverage a dedicated Product Feed Management tool like Feedonomics, GoDataFeed, or DataFeedWatch.

  2. Klaviyo’s Product Catalog The same issue impacts Klaviyo’s built-in Shopify product catalog. However, you can email Klaviyo support, and they can resolve the issue on their end.

  3. New Product URL Paths A lot of merchants are excited to launch SEO-friendly product URLs that include human-friendly variant names as URL paths and search strings, as opposed to the standard Shopify Liquid URL pattern of /product-name?variant=1234567.

    However, you need to make sure that the old URL paths are still routed to the new product URLs to avoid 404 errors. Again, be mindful of client-side redirects that can break attribution.

  4. Site Map URLs Note: You will also need to consider these URL pattern changes in your Hydrogen site map.

Shopify Analytics Cookies

Legacy: _shopify_y and _shopify_s

Older Hydrogen storefronts identified visitors and sessions with the _shopify_y (unique visitor) and _shopify_s (session) cookies. On Hydrogen, these were set client-side in the browser rather than by a server response. As a result:

  • Safari's tracking prevention (ITP) could expire them after 7 days of inactivity, unlike the longer-lived server-set cookies on Liquid storefronts.
  • They weren't a reliable persistent identifier for ID graphs or long attribution windows.

Shopify is deprecating _shopify_y and _shopify_s for Hydrogen and asked Hydrogen storefronts to migrate by April 30, 2026. Storefronts that haven't migrated keep working, but visitor and session attribution in Shopify Analytics won't be reliable.

Current: server-set, HTTP-only cookies

Hydrogen now gets analytics and consent cookies from the Storefront API through a proxy on your storefront's own domain. Shopify describes these as HTTP-only cookies, set by the server rather than by browser JavaScript. Hydrogen 2025.7.1 added support for the new _shopify_analytics and _shopify_marketing HTTP-only cookies, while staying backward compatible with the legacy cookies.

To migrate, follow Shopify's Migrate Hydrogen analytics tracking guide:

  • On Oxygen: upgrade to the latest minor release of your Hydrogen version line (the fix covers 2024.7 through 2025.7). No server changes are needed.
  • On other hosts: upgrade, and use Hydrogen's createRequestHandler as your server entry point. It sets up the Storefront API proxy, so the cookies are set on your storefront's domain.
  • Custom headless builds: see Shopify's custom setup guide.

If your code reads _shopify_y or _shopify_s directly, for example to pass a visitor ID to a third-party tool, switch to Hydrogen's getTrackingValues utility. It returns uniqueToken and visitToken, which replace the old _y and _s values.

Because consent is also tracked with these cookies, make sure your consent banner works with the proxy. See Consent Management.

Fueled's approach: Fueled has worked with Pack to set its own server-side cookie for its ID graph to extend attribution windows. Brands can generate and set their own server-side cookies too, with a little server code.

For Shopify Liquid Storefronts, the website experience and checkout are managed on the same subdomain. This isn't always the case with Hydrogen sites, as described above.

As a result:

  • Developers need to ensure that any first-party cookies they set themselves are set on the root domain, not the subdomain for the site, so they're readable on both the storefront and checkout.
  • With legacy _shopify_y tracking, a cookie scoped to the wrong domain could break Shopify Analytics' tracking between the content site and checkout. The Storefront API proxy sets Shopify's newer cookies on your storefront domain for you.

localStorage Variables

localStorage variables are set per subdomain. They do not support cross-subdomain use cases. This needs to be considered for JavaScript libraries that use localStorage variables.

Solution: Extra steps need to be taken to pass data server-side to support localStorage variable data being passed between www.* and shop.*.

Attribution

This article was written by Fueled, Pack's partner and a leading agency specializing in collecting and organizing 1st-party eCommerce customer data. For more information, visit their homepage.

Was this page helpful?