> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/sources/shopify/headless-shopify/working-with-a-headless-shopify-setup.md).

# Headless or Shopify Hydrogen store installation

How Littledata tracks checkout and purchase events for headless and Shopify Hydrogen stores, and what you need to set up.

If you run a headless Shopify storefront, getting accurate data can be hard. This page explains how Littledata tracks your checkout and orders server-side on a headless store, what it supports, and how to set it up.

### How it works

The Littledata Pixel captures key marketing and analytics identifiers on your storefront. It passes them to Littledata's server-side data pipeline. This lets Littledata link checkout and purchase events back to the right session and marketing source.

### Compatibility

This works with any [headless Shopify setup](https://shopify.dev/docs/storefronts/headless/getting-started/build-options), including:

* Shopify Hydrogen
* A headless channel using the Storefront API with Next.js, Remix, Gatsby or similar
* Landing pages with a Buy now button
* A native mobile app using the Shopify checkout
* Shopify Buy SDK

Littledata also tracks the Shopify-hosted parts of your store, so you can follow the full customer journey across your whole online store.

There is one requirement: for cookies to pass to the checkout, the **checkout must be on the same root domain** as your storefront. For example, `store.domain.com` and `checkout.domain.com`.

{% hint style="warning" %}
If your checkout stays on the myshopify.com domain, the tracking script will not work.
{% endhint %}

### Supported data destinations

Littledata has a no-code, server-side integration for:

* [Google Analytics (GA4)](https://help.littledata.io/integrations/shopify-to-google-analytics/littledata-shopify-install-guide)
* [Segment](https://help.littledata.io/integrations/shopify-to-segment/installation)
* [Google Ads](https://help.littledata.io/integrations/google-ads/google-ads-install-guide)
* [Meta Conversions API](https://help.littledata.io/integrations/facebook-capi/how-to-install-shopify-to-conversions-api)
* [TikTok Events API](https://help.littledata.io/integrations/tiktok/installation)
* [Pinterest Conversions API](https://help.littledata.io/integrations/shopify-to-pinterest/installation)
* [Microsoft Ads](https://help.littledata.io/integrations/microsoft-ads/installation)

{% hint style="info" %}
Littledata adds to your storefront tracking. It assumes you already have your marketing pixels or tags set up on the parts of your store that don't use a Shopify theme. Littledata captures the marketing identifiers so your data stays complete and consistent across the storefront and the Shopify checkout.
{% endhint %}

#### Automatically tracked events

All the events below are tracked automatically server-side, so your funnel is complete and more accurate.

| Destination               | Event names                                                                                                        |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Google Analytics 4        | `begin_checkout`, `add_shipping_info`, `add_payment_info`, `purchase`\*, `refund`, `upsell`                        |
| Google Ads                | `Conversion`                                                                                                       |
| Segment                   | `Checkout Started`, `Checkout Step Viewed`, `Checkout Step Completed`, `Payment Info Entered`, `Order Completed`\* |
| Meta Conversions API      | `InitiateCheckout`, `AddPaymentInfo`, `Purchase`\*                                                                 |
| TikTok Events API         | `Initiate Checkout`, `Add Payment Info`, `Complete Payment`                                                        |
| Pinterest Conversions API | `Checkout`                                                                                                         |
| Microsoft Ads             | `Purchase - Littledata`\*                                                                                          |

\*Includes subscriptions, upsells, draft orders and orders from other sales channels.

You can track more events on the storefront with Google Tag Manager or a similar tool.

### Get started

{% stepper %}
{% step %}
**Add your marketing tags**

Add your marketing tags to the pre-checkout pages in your usual way, for example with Google Tag Manager.
{% endstep %}

{% step %}
**Install the Littledata app**

Install the [Littledata Shopify app](https://help.littledata.io/integrations/shopify-to-google-analytics/littledata-shopify-install-guide).
{% endstep %}

{% step %}
**Add the Littledata Pixel**

Add the [Littledata Pixel](https://help.littledata.io/sources/shopify/littledata-pixel) as part of the app setup.
{% endstep %}

{% step %}
**Connect your destinations**

Add the data destinations you want in the Littledata app.
{% endstep %}
{% endstepper %}

### Limitations

On a headless storefront, Littledata does not track these events. You need to set them up yourself:

* Page views
* Product detail views
* Add to cart
* Remove from cart

Because of this, these Littledata integrations don't work for a headless store:

* Klaviyo
* Attentive

### Related articles

* [Upgrading to the Littledata Pixel](https://help.littledata.io/sources/shopify/headless-shopify/upgrading-to-the-advanced-tracking-script)
* [Littledata Pixel](https://help.littledata.io/sources/shopify/littledata-pixel)
* [Microsoft Ads](https://help.littledata.io/integrations/microsoft-ads)
