Skip to main content
POST
cURL

Event payload structure

Every request posts one event in the same envelope. All fields are snake_case. The full request body:

Top-level fields

The event object

The context object

All context keys are snake_case on the wire. Unknown keys are accepted but only the fields marked as persisted below are stored on the event; anything else is discarded at ingestion.
Shopify’s web pixel emits context in camelCase (userAgent, cookieEnabled, characterSet). The headless API is snake_case: a body sent with navigator.userAgent is rejected with "navigator.user_agent" is required, and camelCase fields like characterSet pass validation but are silently dropped. Convert the pixel context to snake_case before posting.
What changes per event is event.name, event.type, and where the payload lives:
  • Standard events — Shopify standard (pixel) events. type: "standard", payload in event.data.
  • Glood search events — custom attribution events emitted by the Glood search app. type: "custom", payload in event.custom_data.track.

Standard search events

Any Shopify standard event can be forwarded: page_viewed, product_viewed, collection_viewed, cart_viewed, search_submitted, product_added_to_cart, product_removed_from_cart, checkout_started, checkout_completed, and the other checkout events. event.data carries the standard event’s payload as defined by Shopify. Some standard events (page_viewed) have an empty data by design — their information lives in event.context.document.
search_submitted

Glood search events

Custom attribution events use type: "custom" and carry a track object under event.custom_data. All track fields are optional; always send request_id (from the search response) when you have it — it ties the interaction back to the serve. The examples below show event.name and event.custom_data — the rest of the envelope is identical to the one above.

glood:search_result_rendered

Send when search results are rendered / enter the viewport. products lists the rendered results; include filters when the result set was rendered with facets applied:

glood:search_result_clicked

Send when a result is clicked. products carries the clicked product; include the filters active at click time:

glood:search_filter_appeared

Send when the filter UI is rendered for a result set. filters lists the facets shown, with value: null while nothing is selected:

glood:search_filter_updated

Send when a facet is applied or changed. filters carries the full current selection (not the delta):
The same track shape is used by the other custom search events (glood:instant_search_triggered, glood:instant_search_rendered, glood:image_search_triggered, glood:image_search_results_rendered, glood:search:add_to_cart) — see the event.name enum in the schema for the full list.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-shop
string
required

Shopify store URL. Resolves the shop for the request (headless does not accept ?shop=).

Example:

"shop.myshopify.com"

Body

application/json

Request body

Storefront / personalization event ingestion. Shop is taken from the x-shop header (not the body). Requires channel and at least one of visitor_id / client_id.

channel
enum<string>
required

Originating storefront channel.

Available options:
HYDROGEN,
HEADLESS,
MOBILE
event
object
required

The event envelope.

session_id
string

Browsing-session id (the unit of funnel + attribution analytics). Optional; the server generates a uuid when absent, but send a stable one per visit for accurate analytics.

visitor_id
string

Anonymous persistent visitor UID. At least one of visitor_id / client_id is required.

client_id
string

Client/device id (persists across sessions). At least one of visitor_id / client_id is required.

customer_id
string

Shopify customer id when logged in.

page_type
string

Page type the event fired from.

page_url
string

URL the event fired from.

cart_identifier
string

Cart token/key identifier.

cart
object

Cart state at event time.

customer
object

Customer info at event time.

customer_privacy
object

Customer consent flags.

Response

Event accepted

Event ingestion acknowledgement.

ok
enum<boolean>

Indicates the event was accepted.

Available options:
true