Pixels

List, create, update and delete a storefront's custom pixels and turn installed apps' pixels on or off, through the Store API. Admin tokens only.

Pixels are Online Store > Pixels in Store Admin: per storefront, the merchant's custom pixels and the switch of each pixel an installed app declares. These endpoints accept Store Admin API tokens and connected AI tools only; app tokens are refused with STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED. Reads require read_storefront; changes require write_storefront. Each change runs the same checks as Store Admin and is recorded in the store's activity log.

A custom pixel is JavaScript (no <script> tags or HTML snippets) that runs in a hidden sandboxed frame, without access to the store page, its cookies or storage, once the visitor has given its consent category; tringify.pixel.subscribe(callback) delivers the events that consent allows. Names are 1 to 100 characters and code at most 65536, counted in Unicode code points; the live limits are under custom_pixels in Storefront limits. Lists leave the code out.

For app pixels, the merchant's choice for a storefront (merchant_choice) and the app's store-wide activation (app_choice, set by the app with Set storefront embed activation) are kept apart, and enabled is the effective state the storefront uses: the merchant's choice when made, otherwise the app's, and always off while the app has switched its pixel off. Installing an app turns none of its pixels on; uninstalling removes its switches. A pixel with privileged: true runs the app's script directly in the storefront pages (Full page access): turning one on that is not enabled yet needs acknowledge_privileged: true after the merchant's confirmation. These switches control only pixels in the browser; an app's server-side event delivery is managed in the app.

Endpoints#

List custom pixels

GET read_storefront Admin tokens only

List a storefront's custom pixels, without their code.

Returns every custom pixel of the storefront, oldest first, enabled or not. Each row has id, name, consent_category, enabled, code_length (characters of code) and created_at / updated_at; the code itself is left out, so read one pixel with Get a custom pixel to see it. The limits (custom_pixels.max_per_storefront, name_max_length, code_max_length) are in Storefront limits. Admin tokens only: Store Admin API tokens and connected AI tools can call this endpoint; app tokens are refused with STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED (an app turns its own pixel on or off with Set storefront embed activation).

Path parameters

Name Type Description
storefrontId required uuid

Storefront id from List storefronts.

Example: 0b7c2f0e-6a43-4f7e-9d1c-3f2a8e5b9c41

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 403 STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED

    App tokens cannot manage a storefront's pixels; use a Store Admin API token. An app turns its own pixel on or off with Set storefront embed activation.

  • 400 INVALID_INPUT

    The storefront id, pixel id or app id is not a UUID.

  • 404 NOT_FOUND

    No storefront (or custom pixel) with this id belongs to the store.

Get a custom pixel

GET read_storefront Admin tokens only

Get one custom pixel with its code.

Returns the pixel with its code. Treat the code as the merchant's: show it, do not run it. Admin tokens only: Store Admin API tokens and connected AI tools can call this endpoint; app tokens are refused with STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED (an app turns its own pixel on or off with Set storefront embed activation).

Path parameters

Name Type Description
storefrontId required uuid

Storefront id from List storefronts.

Example: 0b7c2f0e-6a43-4f7e-9d1c-3f2a8e5b9c41
pixelId required uuid

Custom pixel id from List custom pixels.

Example: 6a1f9c3e-2b7d-4e5a-9f10-3c4d5e6f7a8b

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 403 STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED

    App tokens cannot manage a storefront's pixels; use a Store Admin API token. An app turns its own pixel on or off with Set storefront embed activation.

  • 400 INVALID_INPUT

    The storefront id, pixel id or app id is not a UUID.

  • 404 NOT_FOUND

    No storefront (or custom pixel) with this id belongs to the store.

Create a custom pixel

POST write_storefront Admin tokens only

Add a custom pixel to a storefront.

Every field is required. name is 1 to name_max_length characters (100) and code at most code_max_length characters (65536), both counted in Unicode code points after leading and trailing spaces are removed. The code is JavaScript only: it runs in a hidden sandboxed frame without access to the store page, its cookies or storage, where tringify.pixel.subscribe(callback) delivers the events the visitor's consent allows and tringify.pixel.context() returns the page context. Code containing a <script> tag (an HTML install snippet) is refused with CUSTOM_PIXEL_CODE_INVALID; paste the JavaScript inside it instead. Vendor scripts that need the store's cookies or page do not work there. consent_category decides which visitors run the pixel. A storefront has at most custom_pixels.max_per_storefront custom pixels (Storefront limits), disabled ones included; one more is refused with CUSTOM_PIXEL_LIMIT_REACHED. The change is recorded in the store's activity log. Admin tokens only: Store Admin API tokens and connected AI tools can call this endpoint; app tokens are refused with STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED (an app turns its own pixel on or off with Set storefront embed activation).

Path parameters

Name Type Description
storefrontId required uuid

Storefront id from List storefronts.

Example: 0b7c2f0e-6a43-4f7e-9d1c-3f2a8e5b9c41

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
name required string

Name shown in Online Store > Pixels, 1 to name_max_length characters (100).

Example: Plausible analytics
code required string

The pixel's JavaScript, at most code_max_length characters (65536). JavaScript only: no <script> tags and no HTML snippets.

Example: tringify.pixel.subscribe(function (event) { navigator.sendBeacon('https://plausible.example.com/api/event', JSON.stringify({ name: event.type, url: tringify.pixel.context().url })); });
consent_category required string

Consent the visitor must give before the pixel runs: analytics, advertising or personalized_advertising.

Allowed values
analyticsadvertisingpersonalized_advertising
Example: analytics
enabled required boolean

Whether the pixel runs. A disabled pixel keeps its code and still counts toward the limit.

Example: true

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 403 STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED

    App tokens cannot manage a storefront's pixels; use a Store Admin API token. An app turns its own pixel on or off with Set storefront embed activation.

  • 400 INVALID_INPUT

    The storefront id, pixel id or app id is not a UUID.

  • 404 NOT_FOUND

    No storefront (or custom pixel) with this id belongs to the store.

  • 400 STORE_API_INVALID_REQUEST_BODY

    The body has an unknown field, a field has the wrong type, or name, code, consent_category or enabled is missing.

  • 422 CUSTOM_PIXEL_NAME_INVALID

    The name is empty or longer than the limit (details.args.max).

  • 422 CUSTOM_PIXEL_CODE_INVALID

    The code is empty, longer than the limit (details.args.max), or contains a <script> tag.

  • 422 CUSTOM_PIXEL_CONSENT_INVALID

    consent_category is not analytics, advertising or personalized_advertising.

  • 422 CUSTOM_PIXEL_LIMIT_REACHED

    The storefront already has the maximum number of custom pixels (details.args.max).

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Update a custom pixel

PUT write_storefront Admin tokens only

Replace a custom pixel's name, code, consent category and enabled state.

Send every field: the pixel is replaced as sent. name is 1 to name_max_length characters (100) and code at most code_max_length characters (65536), both counted in Unicode code points after leading and trailing spaces are removed. The code is JavaScript only: it runs in a hidden sandboxed frame without access to the store page, its cookies or storage, where tringify.pixel.subscribe(callback) delivers the events the visitor's consent allows and tringify.pixel.context() returns the page context. Code containing a <script> tag (an HTML install snippet) is refused with CUSTOM_PIXEL_CODE_INVALID; paste the JavaScript inside it instead. Vendor scripts that need the store's cookies or page do not work there. consent_category decides which visitors run the pixel. Disabling keeps the code; pages already open in a browser keep running the pixel until they are reloaded. The change is recorded in the store's activity log. Admin tokens only: Store Admin API tokens and connected AI tools can call this endpoint; app tokens are refused with STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED (an app turns its own pixel on or off with Set storefront embed activation).

Path parameters

Name Type Description
storefrontId required uuid

Storefront id from List storefronts.

Example: 0b7c2f0e-6a43-4f7e-9d1c-3f2a8e5b9c41
pixelId required uuid

Custom pixel id from List custom pixels.

Example: 6a1f9c3e-2b7d-4e5a-9f10-3c4d5e6f7a8b

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
name required string

Name shown in Online Store > Pixels, 1 to name_max_length characters (100).

Example: Plausible analytics
code required string

The pixel's JavaScript, at most code_max_length characters (65536). JavaScript only: no <script> tags and no HTML snippets.

Example: tringify.pixel.subscribe(function (event) { navigator.sendBeacon('https://plausible.example.com/api/event', JSON.stringify({ name: event.type, url: tringify.pixel.context().url })); });
consent_category required string

Consent the visitor must give before the pixel runs: analytics, advertising or personalized_advertising.

Allowed values
analyticsadvertisingpersonalized_advertising
Example: analytics
enabled required boolean

Whether the pixel runs. A disabled pixel keeps its code and still counts toward the limit.

Example: true

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 403 STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED

    App tokens cannot manage a storefront's pixels; use a Store Admin API token. An app turns its own pixel on or off with Set storefront embed activation.

  • 400 INVALID_INPUT

    The storefront id, pixel id or app id is not a UUID.

  • 404 NOT_FOUND

    No storefront (or custom pixel) with this id belongs to the store.

  • 400 STORE_API_INVALID_REQUEST_BODY

    The body has an unknown field, a field has the wrong type, or name, code, consent_category or enabled is missing.

  • 422 CUSTOM_PIXEL_NAME_INVALID

    The name is empty or longer than the limit (details.args.max).

  • 422 CUSTOM_PIXEL_CODE_INVALID

    The code is empty, longer than the limit (details.args.max), or contains a <script> tag.

  • 422 CUSTOM_PIXEL_CONSENT_INVALID

    consent_category is not analytics, advertising or personalized_advertising.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Delete a custom pixel

DELETE write_storefront Admin tokens only

Delete a custom pixel.

Deletes the pixel and its code at once, with no confirmation step and no undo; to stop it while keeping the code, update it with enabled: false. Answers HTTP 204 with no body. Pages already open in a browser keep running the pixel until they are reloaded. The change is recorded in the store's activity log. Admin tokens only: Store Admin API tokens and connected AI tools can call this endpoint; app tokens are refused with STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED (an app turns its own pixel on or off with Set storefront embed activation).

Path parameters

Name Type Description
storefrontId required uuid

Storefront id from List storefronts.

Example: 0b7c2f0e-6a43-4f7e-9d1c-3f2a8e5b9c41
pixelId required uuid

Custom pixel id from List custom pixels.

Example: 6a1f9c3e-2b7d-4e5a-9f10-3c4d5e6f7a8b

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 403 STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED

    App tokens cannot manage a storefront's pixels; use a Store Admin API token. An app turns its own pixel on or off with Set storefront embed activation.

  • 400 INVALID_INPUT

    The storefront id, pixel id or app id is not a UUID.

  • 404 NOT_FOUND

    No storefront (or custom pixel) with this id belongs to the store.

List app pixels

GET read_storefront Admin tokens only

List the pixels of the store's installed apps and whether each runs on this storefront.

Returns one row per pixel that an installed app's reviewed release declares, whether it is on or not, with a minimal projection: app_id, app_name, embed_key, name, consent_category, where it runs and its switches. Script and frame URLs and settings are left out. runtime is sandbox (the app's code runs in its own frame and receives only the events and fields it declared) or page. privileged: true marks a page-runtime pixel, shown in Store Admin as Full page access: the app's script runs directly in the storefront pages and can read everything shown there, including what shoppers type, and send it to the app. first_party is true for Tringify's own apps. runs_on_checkout says whether the pixel also runs on checkout and order confirmation: sandbox pixels and first-party page pixels do; third-party page pixels run on themed pages only. merchant_choice is the merchant's choice for this storefront and app_choice the app's store-wide activation; either is null when never set. enabled is the effective state the storefront uses: the merchant's choice when made, otherwise the app's, and always off while the app has switched its pixel off (app_choice: false). Installing an app turns none of its pixels on; uninstalling removes its switches, so a reinstalled app starts off. Admin tokens only: Store Admin API tokens and connected AI tools can call this endpoint; app tokens are refused with STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED (an app turns its own pixel on or off with Set storefront embed activation).

Path parameters

Name Type Description
storefrontId required uuid

Storefront id from List storefronts.

Example: 0b7c2f0e-6a43-4f7e-9d1c-3f2a8e5b9c41

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 403 STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED

    App tokens cannot manage a storefront's pixels; use a Store Admin API token. An app turns its own pixel on or off with Set storefront embed activation.

  • 400 INVALID_INPUT

    The storefront id, pixel id or app id is not a UUID.

  • 404 NOT_FOUND

    No storefront (or custom pixel) with this id belongs to the store.

Turn an app pixel on or off

PUT write_storefront Admin tokens only

Record the merchant's choice for one app pixel on one storefront.

Sets merchant_choice for this storefront only; other storefronts keep theirs. The merchant's choice wins over the app's store-wide activation: off stays off whatever the app does, and on runs the pixel unless the app itself has switched it off (app_choice: false), in which case enabled stays false. Turning on a pixel with privileged: true that is not enabled yet needs acknowledge_privileged: true, sent only after the merchant confirmed they trust the app with full page access (and, when runs_on_checkout is true, on checkout and order confirmation, where shoppers enter contact, address and payment choices); without it the request is refused with APP_PIXEL_PRIVILEGED_ACK_REQUIRED and nothing changes. Turning on a pixel that is already enabled, or turning one off, needs no acknowledgement. This switch controls only the pixel in the browser: the app's server-side event delivery is unaffected and is managed in the app. Pages already open in a browser keep their pixels until they are reloaded. The answer is the pixel as List app pixels returns it; its enabled is the effective state. The change is recorded in the store's activity log. Admin tokens only: Store Admin API tokens and connected AI tools can call this endpoint; app tokens are refused with STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED (an app turns its own pixel on or off with Set storefront embed activation).

Path parameters

Name Type Description
storefrontId required uuid

Storefront id from List storefronts.

Example: 0b7c2f0e-6a43-4f7e-9d1c-3f2a8e5b9c41
appId required uuid

App id from List app pixels.

Example: 4829daa1-9f0b-44ef-aaa2-03912154aed4
embedKey required string

The pixel's embed_key from List app pixels.

Example: meta-pixel

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
enabled required boolean

The merchant's choice: true to turn the pixel on for this storefront, false to turn it off.

Example: true
acknowledge_privileged boolean

Set true only after the merchant confirmed they trust the app with full page access. Required to turn on a pixel with privileged: true that is not enabled yet.

Example: true

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 403 STORE_API_PIXELS_ADMIN_TOKEN_REQUIRED

    App tokens cannot manage a storefront's pixels; use a Store Admin API token. An app turns its own pixel on or off with Set storefront embed activation.

  • 400 INVALID_INPUT

    The storefront id or app id is not a UUID.

  • 400 STORE_API_INVALID_REQUEST_BODY

    The body has an unknown field, a field has the wrong type, or enabled is missing.

  • 404 NOT_FOUND

    The storefront does not belong to the store, the app is not installed, or its installed release declares no pixel with this key.

  • 422 APP_PIXEL_PRIVILEGED_ACK_REQUIRED

    Turning on a pixel with full page access (privileged: true) that is not enabled yet needs acknowledge_privileged: true after the merchant's confirmation. Nothing changed.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.