# Custom Data Sources

Custom Data Sources let you enrich events with Shopify metafields and browser data.

Use them when the default Shopify event payload is not enough.

## Why use Custom Data Sources?

* Send a product `material` metafield to GA4.
* Use a customer `loyalty_tier` metafield in Klaviyo.
* Capture a cookie or local storage value for event enrichment.

## Set up Custom Data Sources

{% stepper %}
{% step %}

### Configure metafields

Go to **Settings → Custom Data Sources**.

<figure><img src="/files/CNGObjzDf6UeA2XpdtX9" alt=""><figcaption></figcaption></figure>

You will see **Customers**, **Products**, and **Product Variants**.

Littledata discovers available namespaces and keys automatically.

Select the metafields you want to expose in mappings.

<figure><img src="/files/QAU1wa6ztm4XkF3SpbUP" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure browser data

In **Browser data**, add the cookie keys or local storage keys you want.

The Littledata tracking pixel will collect those values on supported events.

<figure><img src="/files/j7Q8hda2zEc72eAOigsV" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### Use the fields in mappings

After setup, these fields appear in the source dropdown of the mapping editor.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
If new metafields do not appear yet, use **Refresh metafields**.
{% endhint %}

## Supported metafield types

| Owner type       | Shopify object      | Available on events                           |
| ---------------- | ------------------- | --------------------------------------------- |
| Products         | Product metafields  | `product_viewed`, `add_to_cart`, order events |
| Product variants | Variant metafields  | Order events, `add_to_cart`                   |
| Customers        | Customer metafields | Order events, customer events                 |

## Browser data

Browser data is collected by the Littledata tracking pixel on client-side events.

Supported sources are **Cookies** and **Local storage**.

{% hint style="info" %}
Browser data is only available on client-side events, such as `page_view` and `add_to_cart`.
{% endhint %}

## Refresh metafields

{% stepper %}
{% step %}

### Start a refresh

Go to **Custom Data Sources** and click **Refresh metafields**.
{% endstep %}

{% step %}

### Wait for discovery

Littledata starts a new bulk operation.

New metafields usually appear within a few minutes.
{% endstep %}
{% endstepper %}


---

# 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/event-customiser/custom-data-sources.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.
