Tracking

Headless Shopify: what it is, when it makes sense, examples

Headless Shopify explained: Hydrogen, Oxygen and the Storefront API, when going headless pays off, what it costs in tracking and apps, and how to track it.

·8 min read·By the ROASaurus team

Key takeaways
  • Headless Shopify means a custom frontend that talks to Shopify through its APIs, while Shopify keeps running products, carts, checkout and orders.
  • Shopify's own stack is Hydrogen to build the storefront, Oxygen to host it and the Storefront API for the data; Oxygen is included on paid plans, so Shopify Plus is not required.
  • It pays off when a store has a concrete need a theme cannot meet and a development team to maintain it; for most stores a theme is cheaper and simpler.
  • Tracking does not come with it: theme app embeds do not run, so storefront events and the cart link to the order have to be built in.

Headless Shopify means you build your own storefront, the part shoppers see, and connect it to Shopify through Shopify's APIs. Shopify keeps running the products, inventory, cart, checkout and orders. It makes sense when your store needs something a Shopify theme cannot do, such as a highly interactive frontend, content from another system or one backend behind several apps, and you have developers to maintain it. For most stores, a theme does the job at a lower cost.

This guide explains what headless means on Shopify, why brands do it, what it costs in apps and tracking, whether you need Shopify Plus, Shopify's own headless stack, examples of what headless stores build, and how to keep tracking reliable.

What is headless Shopify?

A normal Shopify store renders its pages from a theme, written in Shopify's Liquid template language and hosted by Shopify. In a headless store, the "head", meaning the frontend, is separate. Developers build it in a JavaScript framework, and it fetches products, collections, search results and the cart from Shopify through the Storefront API. When the shopper checks out, the storefront hands them over to Shopify's checkout.

Custom frontendReact, Hydrogen or another framework, on your own hosting or Oxygen.
Storefront APIProducts, collections, search and the cart.
Shopify checkoutPayment, taxes, shipping.
Shopify adminOrders, inventory, customers, apps.
In a headless setup, only the storefront is custom. Checkout and order handling stay on Shopify.

Shopify headless commerce: is it worth it?

Headless gives you complete control over the frontend, and makes every frontend feature your own work. A theme store gets breadcrumbs, upsells, reviews, search and multi-currency switching from the theme or an app in minutes. A headless store gets them when a developer builds them against the API. Whether that trade is worth it depends on one question: do you have a concrete problem a theme cannot solve, and the team to keep solving it?

Reasons it can be worth it
  • A frontend a theme cannot deliver
  • Content from another system, such as a headless CMS
  • One backend behind a website, an app and other channels
  • Full control over speed and page structure
Reasons it often is not
  • Every feature becomes custom work
  • Many apps depend on the theme and stop working
  • Tracking must be rebuilt
  • Small changes need a developer
Headless solves specific problems. It is not an upgrade every store should make.

Why brands go headless on Shopify

  • An interactive frontend. Product configurators, single-page shopping, instant variant switching and app-like navigation are easier in a JavaScript framework than in a theme.
  • Speed under their own control. A team with frontend developers can tune every component, load only what a page needs and serve pages from the edge.
  • Content from elsewhere. Brands whose editors work in a headless CMS can combine that content with Shopify products on any page structure they want.
  • Several channels on one backend. A website, a mobile app, an in-store screen or a kiosk can all read the same products and carts.
  • Logic per market. Localized content, page structures and rules per country beyond what a single theme handles comfortably.
  • Integration with other systems. Stores that are one part of a larger stack, with an ERP or a custom app, get more control over how the pieces fit.

What are the drawbacks?

  • Every feature is custom. Features a theme or app gives you out of the box have to be built and tested.
  • App gaps. Many Shopify apps add their features through theme app extensions or storefront scripts. Without a theme, some stop working and only some offer an API alternative.
  • Tracking does not come with it. Events that a theme and its app embeds send automatically must be built in; see the tracking section below.
  • Developer dependency. A new banner or a holiday landing page can need a developer, unless editors work in a CMS that the frontend reads.
  • Higher cost of ownership. Development, hosting outside Oxygen, a CMS and ongoing maintenance add up, year after year.

Do you need Shopify Plus to go headless?

No. According to Shopify's developer documentation, Oxygen, Shopify's hosting for Hydrogen storefronts, is available at no extra charge on paid Shopify plans, and you enable it by installing the Hydrogen sales channel. Development stores and trial plans can use it too, with deployments that need a store login. Shopify Plus adds things that matter to some headless stores, such as more checkout customization and more stores under one organization, so a large headless project may still end up on Plus. Check Shopify's plan pages for the features your build needs.

What are Hydrogen, Oxygen and the Storefront API?

PartWhat it isDo you need it?
Storefront APIShopify's API for products, collections, search and the cart, which hands the shopper off to checkoutYes, for any headless Shopify store
HydrogenShopify's headless toolkit for building a storefront in a JavaScript frameworkNo, but it saves work: carts, analytics and SEO helpers are built in
OxygenShopify's hosting for Hydrogen storefronts, deployed from GitHub or your own CINo; you can host on another platform instead
Shopify's own headless stack. Many headless stores use the Storefront API with another framework and host.

Hydrogen and Oxygen, or another stack?

Hydrogen on OxygenAnother framework and host
Shopify building blocksCart, analytics, customer accounts and SEO helpers includedBuild or add them yourself
HostingIncluded on paid plans, deploys from GitHubYour own contract and setup
Shopify analytics eventsBuilt into Hydrogen's analyticsSend them yourself
Freedom of choiceShopify's toolkit and conventionsAny framework, host and CMS

Examples: what headless Shopify stores build

Headless stores usually solve one of a few recognizable problems. These are the patterns, by type of store:

  • Fashion with a fast catalog. Instant variant switching and filters without page reloads, with image-heavy product pages tuned for phones.
  • Content-led lifestyle brands. Editorial pages from a headless CMS mixed with shoppable products, on a page structure the editors design.
  • Configurable products. Furniture, bikes or tech with a configurator that builds the variant step by step and shows the price live.
  • Personalized products. Beauty or nutrition brands with a quiz that leads to a product set, then a subscription.
  • Several storefronts, one backend. A website and a mobile app, or several regional sites, reading the same products, carts and customers.
  • Brands inside a larger platform. Shopify runs only the cart and checkout behind a product or service that lives elsewhere.

How to tell if a store runs headless Shopify

  • Page source: a theme store loads its theme assets from Shopify's CDN; a headless store loads a framework bundle from its own domain.
  • Network tab: a headless store's browser calls the Storefront API for products and the cart.
  • Checkout: both kinds hand the shopper to Shopify's checkout, which is the clearest sign the backend is Shopify.

Is headless Shopify right for your business?

Go headless whenStay with a theme when
A specific feature or experience is impossible or very slow in a themeYour needs are met by a theme and apps
You have frontend developers, in house or on contract, for the long termChanges are made by the store team without a developer
Content lives in another system and must shape the pagesProducts and pages live in Shopify
Several channels need the same products and cartsThe website is the only storefront
You budget for ongoing development, not just the launchBudget goes to products and marketing
The cost of headless is mostly ongoing: development, hosting outside Oxygen, a CMS and maintenance.

Many stores that consider headless for speed or design get there with a well-built theme instead. The pages every Shopify store needs, Shopify SEO and how to grow Shopify sales cover what a theme store can do.

How to build reliable tracking in a headless setup

In a theme store, tracking apps add their scripts through theme app embeds, and Shopify's checkout runs app pixels. In a headless store, the checkout part still works, because checkout stays on Shopify. The storefront part does not: theme app embeds do not run, so page views, product views, add to cart and the link from the visit to the order have to be built in.

  1. Send storefront events from your frontend

    Page viewed, product viewed and added to cart, with one consistent structure. In Hydrogen, subscribe to its analytics events instead of writing your own.

  2. Write the visitor id to the cart

    Add the visitor id and the click ids to the cart attributes, so the Shopify order can be linked to the ad click.

  3. Keep checkout and purchases on Shopify

    The checkout pixel and the order webhooks work the same as in a theme store, so purchases are sent from the order data.

  4. Send purchases server-side

    Use the same event id in the browser and on the server, so each platform keeps one copy.

  5. Follow consent

    Read Shopify's Customer Privacy API, which Hydrogen loads with its consent settings, before storing ids or firing pixels.

More on the server side in server-side tracking on Shopify and in the glossary. The BFCM tracking checklist and Klaviyo tracking on Shopify apply to headless stores as well.

Tracking a headless store with ROASaurus

For Hydrogen and other headless Shopify storefronts, ROASaurus provides a small ES module that the storefront loads in the browser, with no npm package. Checkout stays on Shopify, where the ROASaurus app pixel tracks checkouts and purchases as in a theme store, and orders still arrive through Shopify's order webhooks.

Loading the ROASaurus module in a headless storefront
const {createRoasaurus} = await import('https://app.roasaurus.com/headless@1.js');
const roasaurus = createRoasaurus({ storeKey: 'YOUR_STORE_KEY' });

// Hydrogen 2026-10 and later: add ROASaurus to the analytics bus
roasaurus.addToBus(window.Shopify.analytics);

The module sends page views, product views and add to cart, and ROASaurus forwards them to your ad platforms with the same event ids as their browser pixels. It also gives you the cart attributes to write: the visitor id, the click ids and the market. Storefronts without Hydrogen can let the module write them through the Storefront API before checkout. It follows Shopify's Customer Privacy API, so events wait until the shopper's choice is known. The steps are in Hydrogen and headless storefronts.

The ROASaurus Mac app showing Tracking health: a card per destination, Purchase accuracy per day for Meta, GA4 and TikTok, and accuracy per payment method. Fictional demo store, simulated data.
The ROASaurus iPhone app showing Tracking health: a card per destination, Purchase accuracy per day for Meta, GA4 and TikTok, and accuracy per payment method. Fictional demo store, simulated data.
After launch, compare per platform the Purchase events expected from your orders with the events accepted. In ROASaurus: Data quality › Overview. Public demo with a fictional store and simulated data.

You add the ad platforms under Connections › Tracking & destinations, and every server delivery is listed under Data quality › Deliveries. The free tracking audit checks what a live store sends, and server-side tracking lists every platform.

Sources

  1. Shopify Dev Docs: Headless
  2. Shopify Dev Docs: Hydrogen and Oxygen fundamentals
  3. Shopify Dev Docs: Storefront API

In ROASaurus

Keep reading

ShopifyAbout us and contact pages for a Shopify storeWhat to put on a Shopify about us page and contact page, templates to adapt, how to create both in Shopify, and claims that backfire with shoppers.MarketingBFCM tracking checklist: can you trust your ad results?A Black Friday tracking checklist: test a real purchase, find duplicate conversions, choose which orders count, check consent and judge ads on profit.MarketingHow the Klaviyo Shopify integration tracks eventsHow Klaviyo collects Shopify data: order events, Checkout Started, onsite events, how it identifies visitors, where coverage ends and how to set it up.

FAQ

Questions, answered

More answers in the FAQ and the help center.

What is headless Shopify?

A setup where you build your own storefront and connect it to Shopify through the Storefront API. Shopify keeps running products, carts, checkout and orders.

What is Shopify Hydrogen?

Shopify's headless toolkit for building a storefront in a JavaScript framework, with carts, analytics and SEO helpers built in.

What is Shopify Oxygen?

Shopify's hosting for Hydrogen storefronts. It is enabled by installing the Hydrogen sales channel and is included at no extra charge on paid Shopify plans.

Do I need Shopify Plus to go headless?

No. The Storefront API and Oxygen are available on paid plans. Some features that large headless projects use, such as more checkout customization, are tied to Shopify Plus.

Is headless Shopify cheaper than a theme store?

Usually not. You pay for building every frontend feature and for maintaining it, and often for a CMS and hosting outside Oxygen. It pays off only when it solves a problem a theme cannot.

Who is headless Shopify best suited for?

Stores with a concrete need a theme cannot meet, such as a configurator, content from another system or several channels on one backend, and a development team for the long term.

Can I tell whether a store is headless just by visiting it?

Often. A headless store loads a framework bundle from its own domain and calls the Storefront API from the browser, then hands the shopper to Shopify's checkout.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. Free plan, no credit card.