Install the pixel
Add this script to the<head> of each store page. Replace the example values with the values from SideShift.
Consent
The pixel waits for consent before it creates a visitor ID or sends events. Connect it to your consent manager:data-consent="granted" on the script. Do not set it before consent is granted. Revoking consent clears the visitor cookie and stops new events and pending retries.
The pixel automatically records the initial page view after consent. It also records a creator click when the landing URL contains a valid SideShift ss parameter. Keep that parameter when redirecting between landing pages.
The pixel observes pushState, replaceState, and popstate in single-page apps. For other routing mechanisms, call window.sideshift.pageView() after a route change. A page view is deduplicated by page path for the current document.
Automatic product views
Adddata-auto-tracking="true" if your product pages contain Product JSON-LD with a productID or sku. The pixel reads that product data and records the view. Use the manual methods below for cart and checkout events.
If your JSON-LD uses SKU identifiers, use the same identifiers in your order line items. For explicit control, leave automatic tracking off and call productViewed yourself.
Capture identity at checkout
After consent and script readiness, capture identity when creating your checkout:ss_vid_YOUR_STORE_ID, with a lifetime of up to 30 days. The creator attribution window remains seven days. Revoking consent clears the pixel’s cookie and stored advertising context and stops its new calls and retries. Apply consent changes to any checkout metadata you persist as well.
Content Security Policy
Allow the installation origin inscript-src and connect-src. A verified custom domain changes that origin. Managed advertising additionally loads an advertising SDK after consent; see advertising measurement for its external domain. Do not weaken your entire CSP with a wildcard to install the pixel.
Custom tracking domain
In the store’s Tracking tab, open Custom tracking domain. Use a subdomain of the authorized storefront, such astrack.example.com for example.com.
- Enter the tracking hostname.
- Add the ownership TXT record shown by SideShift to your DNS provider.
- Check the connection. SideShift will show the routing and verification records required for that hostname.
- Add those records and check again until the domain is verified.
- Copy the updated installation snippet. Its script and browser-event requests use your tracking domain.