What the app embed does
The app embed is a JavaScript file that Arktic adds to every page of your storefront through Shopify’s Theme App Extension system. It is responsible for:- Generating and persisting visitor IDs (
spt_vidcookie) - Reading experiment config and bucketing visitors into variants
- Applying variant experiences (redirects, theme previews, content injection, price updates)
- Tracking events: PAGE_VIEW, ADD_TO_CART, INITIATE_CHECKOUT
- Writing cart attributes for order attribution
Enabling the embed
- In your Shopify Admin, go to Online Store → Themes
- On your live theme, click Customize
- In the Theme Editor, click the App embeds icon in the left sidebar (the puzzle piece icon)
- Find Arktic in the list
- Toggle it on
- Click Save in the top-right corner
App embeds are a native Shopify feature and do not require editing any theme code. The embed is added to your theme’s
<head> automatically by Shopify when you toggle it on.Verifying it is working
Method 1: Check the Get Started page
After enabling the embed, visit any page on your storefront. Then return to the Arktic dashboard and open Get Started. Step 1 shows a green checkmark once the dashboard receives its first event from your store — this usually takes less than 30 seconds after your first page visit.Method 2: Check the browser console
Open your storefront in a browser, then open the browser’s developer tools (F12 or Cmd+Opt+I on Mac) and go to the Console tab. Type:undefined, the embed is not loading.
Also check:
Method 3: Check the Network tab
In your browser developer tools, go to Network and filter byevents. After loading a page on your store, you should see a POST request to /api/events. If you see it, events are firing correctly.
Performance impact
The embed script is designed to be as non-blocking as possible:- Served from Shopify’s CDN — the script is part of a Shopify Theme App Extension, so it is hosted and delivered by Shopify’s own infrastructure, not Arktic’s servers
- Inline config — experiment configuration is injected as a JavaScript variable during Liquid rendering, so no API call is needed to fetch config on the client
- Synchronous bucketing — variant assignment happens synchronously before
DOMContentLoaded, preventing any flash of the wrong variant - Async event sending — all analytics events are sent via
navigator.sendBeacon, which is non-blocking and does not delay page interactions - Safety timeout — if the script takes longer than 2 seconds to complete (e.g. due to a network issue), the page is automatically revealed to the visitor regardless
Multiple themes
The app embed must be enabled separately on each theme you use. If you have:- A live theme with the embed enabled
- A development or duplicate theme for testing
The embed and theme previewing
When you use Shopify’s theme preview feature (?preview_theme_id=...), the theme app extension from the embed will not run unless the embed is also enabled on the preview theme. This is expected behaviour — Shopify’s theme preview loads the target theme’s own app embeds, not the live theme’s.
For Arktic’s own theme tests, the embed handles this internally by running the variant assignment before the theme preview redirect fires, then preserving the assignment in the spt_asgn cookie.
Troubleshooting
The embed is toggled on butwindow.__SPT_VID__ is undefined
- Make sure you saved in the Theme Editor after toggling on
- Try a hard refresh (Cmd+Shift+R / Ctrl+Shift+R) on the storefront
- Check whether a browser extension (ad blocker, privacy blocker) is blocking the script. Test in an incognito window with all extensions disabled.
- Check the Network tab for any failed requests to Shopify’s CDN
- Check the Network tab for a POST to
/api/events. If it is failing with a 4xx or 5xx error, contact support. - Check the browser console for JavaScript errors from Arktic scripts
- Check whether you recently switched or published a new theme. The embed needs to be re-enabled on the new theme.
- Check whether a theme update removed the app embed setting. Go through the Enable steps again.