Load the script on your page
Download /sdk/v1/tag.js and serve it with your application. Include a deferred script tag with data-config-id pointing to a public JSON configuration element. The script injects the QA interface; no browser extension is needed.
The configuration contains projectKey, environment, endpoint, consent and, for server rendering, visitorId, config and assignments. Private server credentials must remain on the backend.
Public script configuration
<script type="application/json" id="varypilot-config">
{"projectKey":"YOUR_PUBLIC_PROJECT_KEY","environment":"development","endpoint":"YOUR_HTTPS_ENDPOINT","consent":false}
</script>
<script defer src="/sdk/v1/tag.js" data-config-id="varypilot-config"></script>Connect consent and conversions
Call varypilot('consent', true) only after analytics consent, and varypilot('consent', false) when it is withdrawn. Google consent default/update entries in dataLayer and the varypilot_consent event are supported. No historical conversion events are replayed.
After a successful action, call varypilot('event', 'add_to_cart'). The browser records only consented events outside QA. For server-rendered integrations, the first consent grant reloads the page so PHP and the browser use the same visitor and rendered variation.
Use one assignment across the stack
Evaluate the experiment with the PHP SDK before rendering. Pass the public configuration and selected assignment to the script. The inspector displays both values and flags a mismatch.
Personalized product responses must bypass shared page caches. Keep the original template as the fallback if configuration or admission is unavailable. The ecommerce integration is restricted to product pages.
Open a local QA session
Local ecommerce QA is enabled by APP_ENV=local and VARYPILOT_QA_ENABLED=true. Production QA uses a scoped preview created by an owner or admin in the dashboard. A preview URL contains an opaque bearer token with an immutable draft snapshot, an allowed origin and a 1, 4 or 24-hour expiry. Treat the link as private. Revoke it in the same preview panel; open pages revalidate every minute.
Select Original or Product V2 to reload the PHP-rendered page. Reset removes the forced variation while retaining QA. Exit QA clears the override and reloads normally. The override cookie is scoped to this project and environment and expires after one hour; it is shared by tabs on this origin.
QA suppresses Varypilot visitor admission, exposures, conversions and Varypilot forwarding to Google. Closing the panel does not exit QA. Independent analytics tags are unaffected. The PHP SDK validates the preview before rendering; the browser strips its token from the address bar. Use a no-referrer policy on preview responses.
Edit a draft on the page
Open the visual editor from a draft variation. Select a page element, then change text, image or link URL, visibility or an allowed style. Apply and undo locally; Save draft sends declarative operations back to the authenticated dashboard. Saving does not publish. Local QA without an editor session can export changes as JSON.
Changes are scoped by CSS selectors. Form fields, editable inputs, private elements and cross-origin frames are excluded. Arbitrary JavaScript, HTML and CSS URLs are not supported. The editor can be full screen or docked to the page.
Forward events to Google Analytics
Forwarding is off by default. Enable gtag or dataLayer in Integration, or call varypilot('googleAnalytics', {mode:'gtag', sendTo:'G-YOUR-ID'}). Grant consent through your consent manager before forwarding. For dataLayer mode, configure matching triggers in Google Tag Manager. Avoid forwarding events already tracked independently.
The Events and Transactions tabs show queued, accepted, suppressed and forwarded diagnostics for the current session. Forwarded means handed to Google, not confirmed delivered. Currency values are converted from Varypilot minor units to Google major units. Incoming Google events and outgoing events are marked to prevent loops. QA never forwards.
Manage the tag
Integration shows immutable configuration versions and requested versus delivered state. Republish rebuilds the current environment configuration. Rollback creates a new version from a compatible prior snapshot and cannot restore paused or completed experiments. The script stays installed while configuration updates independently.
Configuration unavailable
An empty list means no published configuration is available. Check the project, environment, delivery status and allowed origin. The product page retains the original template when the service is unavailable.