# Headless or Shopify Hydrogen store installation

If you're running a **headless Shopify storefront**, ensuring accurate data collection can be challenging. Littledata’s Shopify app, including the **Littledata Pixel**, provides seamless, server-side tracking that works alongside your existing setup—so you get reliable analytics and marketing data, no matter how your store is built.

{% hint style="info" %}
This feature is available only for **Pro, Plus and Enterprise** customers. You also need your headless store and Shopify checkout to share the same domain.
{% endhint %}

## How it works

Littledata's Pixel ensures seamless and accurate tracking for headless Shopify stores by capturing key marketing and analytics identifiers and securely passing them to our server-to-server data pipeline. This allows us to correctly attribute customer actions across sessions and devices, ensuring reliable server-side tracking.

## Compatibility

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

* Shopify Hydrogen
* Headless channel using Storefront API and Next.js, Remix, Gatsby etc
* Landing pages with a Buy Now button
* Native mobile app using Shopify checkout
* Shopify Buy SDK

Since Littledata also tracks the Shopify storefront, the complete customer journey can be tracked across your whole online store.

The only limitation is that for cookies to be passed to the checkout, the **checkout must be on same root domain** – e.g., `store.domain.com` and `checkout.domain.com`.

{% hint style="warning" %}
If the checkout remains on myshopify.com domain, our tracking script will not function.
{% endhint %}

## Supported data destinations

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

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

{% hint style="info" %}
Littledata complements your storefront tracking, and assumes you already have the marketing pixels or tags set up on the parts of your store not using a Shopify theme. By capturing all relevant marketing identifiers, we ensure complete and consistent data across the storefront and the Shopify checkout.
{% endhint %}

### Automatically tracked events

All the events below are tracked **automatically server-side**, to ensure a complete and more accurate funnel.

| Connection                | 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      | `Initiate Checkout`, `Add Payment Info`, `Purchase`\*                                                              |
| Tiktok Events API         | `Initiate Checkout`, `Add Payment Info`, `Complete Payment`                                                        |
| Pinterest Conversions API | `Checkout`                                                                                                         |

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

You can track further events on the storefront using Google Tag Manager or similar.

## Getting started

To ensure accuracy tracking across your store and checkout you will need to:

1. Add the marketing tags in your usual way (e.g. using Google Tag Manager) to the pre-checkout pages
2. Install Littledata's [Customer Tracking app](/integrations/shopify-to-google-analytics/littledata-shopify-install-guide.md)
3. Add the [Littledata Pixel](/sources/shopify/littledata-pixel.md) as part of the app setup
4. Add your chosen data destinations in a few clicks

That's it! No code, no infrastructure to maintain and no broken marketing attribution.

## Limitations

Currently the following events are *not tracked* by Littledata on a headless storefront, and you would need to implement them manually:

* Page Views
* Product Detail Views
* Add to Cart
* Remove from Cart

This means that the following Littledata's integrations will not yet work for a headless store:

* Klaviyo
* Attentive

We intend to reduce these limitations over the coming months.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.littledata.io/sources/shopify/headless-shopify/working-with-a-headless-shopify-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
