Single-page apps
Install once at the application root. The pixel observes browser history changes; callpageView() for routing mechanisms it cannot observe. Do not reload the script for every component render. Query-only changes on the same path do not generate another page view, but a new creator ss code can still record a click.
Checkout handoff
CapturegetVisitorId() and optional getAdvertisingContextAsync() before creating the checkout. Persist them against your internal checkout ID on the server. After verifying the payment callback’s signature and paid state, retrieve those saved values and build the Orders API request from authoritative order data. Use an order ID stable across webhook retries and refunds.
When consent is withdrawn, clear attribution metadata from your pending checkout as appropriate. If the checkout provider cannot preserve an ID or join back to your server session, that checkout cannot reliably attribute the order. Resolve that handoff before launching a commission campaign.
Shopify and headless storefronts
Shopify app installation, product sync, fulfillment, and signed order webhooks are separate from the generic pixel. Do not submit app-managed Shopify orders through the custom-store Orders API. For an authorized headless Shopify integration,shopifyCartAttributes(existingAttributes) preserves existing attributes and adds sideshift_visitor_id. Save the resulting attributes with your existing Storefront API client before redirecting to checkout; check API errors. Update them again on consent withdrawal to clear the visitor value. This helper does not install the Shopify app or establish cross-domain advertising context by itself.