# Tracking on headless Shopify stores

## How tracking works on headless stores

Headless stores can always track referrals via affiliate coupon codes. This works automatically without any code additions. However, to track standard affiliate links, you must install our tracking code and meet the conditions below.

## Key requirement for link tracking

Before setting up link tracking for a headless store, please ensure that your checkout page runs on a subdomain of your main store's domain.

{% hint style="info" %}
For example, if your store domain is `abc.com`, your checkout page must look like `checkout.abc.com`. If it redirects to a completely different domain, link tracking cannot be supported.
{% endhint %}

## Step-by-step setup guide

1\) Reach out to the BixGrow support team to request your custom tracking code.

2\) Our development team will send you a unique JavaScript (JS) code snippet for your store.

3\) Insert the given JS code into the source code of your headless store.

Once the code is successfully added, your BixGrow affiliate links will track all referral traffic and sales normally.

<br>


---

# 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://docs.bixgrow.com/affiliate-links/tracking-on-headless-shopify-stores.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.
