# How to use Customer metafields as userID for Segment

### Why use customer metafields?

Customer metafields can be used by companies that have custom non-Shopify identifier for their customers, for example a **Single Sign-On** (**SSO) system** that unifies the customer identifiers across multiple apps or sites.

### How do I link the customer metafield definition with Littledata?

After you've created the customer metafield definition, go to the **Littledata dashboard**, click on the **Segment** connection settings , and open the **Tracking Customisation** tab. Here you’ll find the **User ID** setting:

![](/files/vLbRppu08m13nTTPFE6q)

{% hint style="info" %}
When you select this setting, no `userId` will be sent on client-side events because Customer metafields can’t be accessed from the web page.
{% endhint %}

Select **Customer metafield**. After you choose this option, an input field will appear where you can enter the **namespace** and **key** from your Customer metafield definition:

![See where to define the Customer metafield](/files/EGHy0EICyCWceofJmrDT)

After you save the setting, all server-side events sent by Littledata will include the **userId** property using the value from your Shopify customer metafield.

![Validate Customer metafield change](/files/kKbNOaIsnpzvwQzUo5OB)

![Segment raw event including the new Customer metafield definition](/files/R8MdMYPYPpx0FuhwQ797)

### Troubleshooting

To use this feature, make sure the Customer metafield is created and defined in Shopify, then enter the same namespace and key in the Littledata app.

If the metafield is not created in Shopify but you enable it in Littledata, the **userId** will still be sent - but only on server-side events - and will fall back to the **Shopify customer ID**.

To link the metafield to your customers, you must add a value for that metafield on each customer profile you want associated with the identifier. For example:

![Customer profile linked to metafield](/files/pfTuQ6EPocQMUZ05YtWB)


---

# 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/integrations/shopify-to-segment/customer-metafields-as-userid-for-segment.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.
