Count a shopper funnel step (measuring window)
const url = 'https://api.tryyoursize.com/v1/funnel_events';const options = { method: 'POST', headers: { 'TYS-Publishable-Key': '<TYS-Publishable-Key>', 'Content-Type': 'application/json' }, body: '{"event":"size_used","product":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryyoursize.com/v1/funnel_events \ --header 'Content-Type: application/json' \ --header 'TYS-Publishable-Key: <TYS-Publishable-Key>' \ --data '{ "event": "size_used", "product": "example" }'Key: publishable (pk_test_… / pk_live_…), from an origin registered for the key.
The measuring window reports the one funnel step no other request shows: the shopper chose a size (“Use this size”). The Platform counts it server-side, cookieless and aggregated: no identifier is sent or stored, no person profile is made; the event carries only the store, the product category, the language, the device class and the surface. The product is used to find its category and is never stored. Always 204 (also when analytics are off).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”A shopper funnel step reported by the measuring window. No identifier, body data or size: only which step.
object
The product (SKU) the size is for; only used to find its category, never stored.
Responses
Section titled “Responses”Counted (or dropped when analytics are off)
Invalid request
Every error has this shape. error is a human-readable message, status the HTTP status. code is stable and machine-readable; doc_url links its explanation; request_id identifies the request (also in the X-Request-ID response header): quote it to support.
object
Stable error code, e.g. invalid_request, unauthorized, reauth_required, payment_required, forbidden, not_found, conflict, unprocessable, rate_limited, internal_error, not_implemented, unavailable, invalid_api_version, idempotency_key_in_use, idempotency_key_reused, invalid_idempotency_key, handle_expired, handle_invalid.
Example
{ "code": "not_found", "doc_url": "https://docs.tryyoursize.com/api/errors/#not_found"}Missing or invalid credentials
Every error has this shape. error is a human-readable message, status the HTTP status. code is stable and machine-readable; doc_url links its explanation; request_id identifies the request (also in the X-Request-ID response header): quote it to support.
object
Stable error code, e.g. invalid_request, unauthorized, reauth_required, payment_required, forbidden, not_found, conflict, unprocessable, rate_limited, internal_error, not_implemented, unavailable, invalid_api_version, idempotency_key_in_use, idempotency_key_reused, invalid_idempotency_key, handle_expired, handle_invalid.
Example
{ "code": "not_found", "doc_url": "https://docs.tryyoursize.com/api/errors/#not_found"}Not allowed
Every error has this shape. error is a human-readable message, status the HTTP status. code is stable and machine-readable; doc_url links its explanation; request_id identifies the request (also in the X-Request-ID response header): quote it to support.
object
Stable error code, e.g. invalid_request, unauthorized, reauth_required, payment_required, forbidden, not_found, conflict, unprocessable, rate_limited, internal_error, not_implemented, unavailable, invalid_api_version, idempotency_key_in_use, idempotency_key_reused, invalid_idempotency_key, handle_expired, handle_invalid.
Example
{ "code": "not_found", "doc_url": "https://docs.tryyoursize.com/api/errors/#not_found"}Was this page helpful?
Thank you. We read every answer.