Skip to main content

How it works: Headless Shopify

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

info

This feature is available only for Pro, Plus and Enterprise customers. For this to work, you also need your headless store and checkout to have the same domain.

How it works

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

Setup requirements

For this solution to work, your store must meet the following criteria:

  • Headless Shopify storefront – Works with any frontend framework (Hydrogen, Next.js, etc.)

  • Checkout has to be on same root domain – Your storefront and checkout must share a domain (e.g., store.domain.com and checkout.domain.com).

warning

Shopify-hosted checkout won’t work – If checkout remains on store.myshopify.com, our tracking script will not function properly and tracking quality will be degraded.

Supported destinations

Once set up, our script enhances tracking for the following server-side integrations:

  • Google Analytics 4 (GA4)

  • Google Ads

  • Meta Conversions API (CAPI)

  • TikTok Events API

  • Pinterest Conversions API

info

This solution complements your storefront tracking by capturing all relevant marketing identifiers that are often missed, ensuring complete and consistent data across both environments.

Supported identifiers

Our advanced tracking script automatically fetches and passes to Littledata servers the following identifiers:

IdentifierDescription
_gaGoogle Analytics client ID
_ga_<Measurement ID>Google Analytics session ID
_gcl_awGoogle Ads click identifier
_gcl_agGoogle Ads gbraid
_gcl_gbGoogle Ads wbraid
_epikPinterest click ID
_ttpTiktok client ID
ttclidTikTok click ID
fbpMeta client ID
fbcMeta click ID
ajs_anonymous_idSegment anonymous ID

What you can track

Here is a full list of events you can track. All these events are tracked server-side, to ensure a complete and more accurate funnel:

Event nameConnection
begin_checkoutGoogle Analytics 4
add_shipping_infoGoogle Analytics 4
add_payment_infoGoogle Analytics 4
purchaseGoogle Analytics 4*
conversionGoogle Ads
Checkout StartedSegment
Checkout Step ViewedSegment
Checkout Step CompletedSegment
Payment Info EnteredSegment
Order completedSegment*
Initiate CheckoutMeta Conversions API
Add Payment InfoMeta Conversions API
PurchaseMeta Conversions API*
CheckoutPinterest Conversions API
Initiate CheckoutTiktok Events API
Add Payment InfoTiktok Events API
Complete PaymentTiktok Events API*

*Includes subscriptions, upsells, drafts and orders from 3rd party integrations