> For the complete documentation index, see [llms.txt](https://docs.zigpoll.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zigpoll.com/embed/poll-metadata/special-variables.md).

# Special Variables

Some metadata has special meaning with the Zigpoll dashboard.

```
shopify_customer_id
```

If **shopify\_customer\_id** is passed it will connect the underlying Shopify customer information to the response.

```
shopify_order_id
```

If **shopify\_order\_id** is passed it will connect the underlying Shopify customer information to the response.

```
order_amount
```

If **order\_amount** is passed it will pass through a value to the response. This value will be used to add additional metrics like Revenue and Average Order Value to the Zigpoll dashboards.

### Automatic Shopify metadata

On Shopify surfaces (checkout, Thank You, Order Status, and customer account surveys), Zigpoll attaches these metadata keys automatically — you can use them in template variables, segments, and exports:

| Key                      | Value                                                                                |
| ------------------------ | ------------------------------------------------------------------------------------ |
| `shopify_customer_email` | The customer's email                                                                 |
| `shopify_customer_phone` | The customer's phone number                                                          |
| `shopify_order_total`    | The order total                                                                      |
| `shopify_currency_code`  | The order's currency code                                                            |
| `shopify_line_items`     | The order's line item titles, comma-separated                                        |
| `shopify_market`         | The buyer's country code (formerly the Shopify Market handle, deprecated by Shopify) |
| `shopify_country_code`   | The buyer's country code                                                             |
| `browser-language`       | The buyer's language (e.g. `fr`)                                                     |
| `browser-locale`         | The buyer's region-qualified locale (e.g. `fr-CA`)                                   |

These keys are also available as [template variables](/questions/template-variables.md) in your question copy.

### Order journey and shipment metadata

When a response is tied to a Shopify order (through `shopify_order_id`, or automatically on the Thank You and Order Status surfaces), Zigpoll also pulls the order's customer journey and shipment details from Shopify and adds them to the response a few minutes after it is submitted:

| Key                                                                   | Value                                                 |
| --------------------------------------------------------------------- | ----------------------------------------------------- |
| `daysToConversion`                                                    | Days between the customer's first visit and the order |
| `landingPage`                                                         | The page the customer first landed on                 |
| `referrerUrl`                                                         | The site that referred the customer                   |
| `source`, `sourceType`, `sourceDescription`                           | Where the visit came from, as Shopify classifies it   |
| `referralCode`                                                        | A referral code attached to the visit, if any         |
| `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content` | UTM parameters from the visit that led to the order   |
| `shopify_tracking_company`                                            | The shipping carrier or carriers                      |
| `shopify_tracking_number`                                             | The shipment tracking number or numbers               |
| `shopify_tracking_url`                                                | The shipment tracking link or links                   |

Only keys with a value are written. A survey completed before a carrier is assigned adds no tracking keys, and Zigpoll checks again about three minutes after submission to catch fulfillments created in the meantime. Multiple shipments are comma-separated.

### Reported attribution metadata

When a survey has an attribution question ("How did you hear about us?"), Zigpoll reads the respondent's answer, including an "Other" write-in and any follow-up question the answer leads to, and adds these keys to the response. They are written about a minute after a completed response and up to ten minutes after a partial one. There is nothing to set up: a question counts as an attribution question when three or more of its fixed answer options read as distinct channels, in any language.

| Key                    | Value                                                                                                                                                                                       | Present                                                                                                                                                     |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `attribution_channel`  | The channel the respondent reported, one value from the list below                                                                                                                          | On every response that answered the attribution question                                                                                                    |
| `attribution_source`   | A normalized name for what the respondent named, such as `The Daily`, `@somehandle`, `Wirecutter` or `ChatGPT`. For a write-in that matches no channel, the cleaned-up text of the write-in | Only when the answer names something. Never on surveys in anonymous mode, and never for answers longer than 40 characters, email addresses or phone numbers |
| `attribution_channels` | The channels picked, comma-separated                                                                                                                                                        | Only when a multi-select attribution question had more than one distinct channel picked. `attribution_channel` is then `multiple`                           |

`attribution_channel` is always one of: `ai_assistant`, `tiktok`, `instagram`, `facebook`, `youtube`, `pinterest`, `snapchat`, `reddit`, `linkedin`, `x`, `podcast`, `social`, `search`, `influencer`, `marketplace`, `email`, `sms`, `tv_streaming`, `radio`, `press`, `affiliate_or_review`, `direct_mail`, `out_of_home`, `online_ad`, `event`, `retail_store`, `professional_referral`, `existing_customer`, `gift`, `word_of_mouth`, `community`, `online`, `other`, `unknown`, `multiple`. A write-in that matches none of the channels is `other`, and an answer that names nothing ("don't remember") is `unknown`.

These keys are reserved. Zigpoll sets them itself, and any value your page or embed code sends under a key starting with `attribution_` is ignored.

Like other response metadata, the keys appear in CSV exports as `Survey Metadata: attribution_channel` and `Survey Metadata: attribution_source`, in the Reporting API, and in every integration that receives response metadata. If a survey has more than one attribution question, the first one in the survey's order is used. Responses collected before this was released don't have the keys unless Zigpoll support backfills them for your account. See [How do I find out how customers heard about my store?](/tutorials/attribution-surveys.md) for setting up the question and its follow-ups.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zigpoll.com/embed/poll-metadata/special-variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
