Splitworthy documentation
JavaScript snippet
Add the real browser bundle to an ownership-verified website.
Load settings before the script
Replace YOUR_PUBLIC_SITE_ID with the site_ identifier from your verified website. The API origin below is the platform origin, not your own website origin. Check release availability first: the 0.5.0 published asset was unavailable at the last check.
Place both scripts early in the document head, without async or defer. Add the nonce or hash required by your CSP. Do not load this automatic bundle alongside a programmatic SDK instance or the React provider on the same page.
<script>
window.TestwellConfig = {
siteId: "YOUR_PUBLIC_SITE_ID",
api: "https://wordpress-experiment-hub.lovable.app",
consentRequired: true
};
</script>
<script src="https://wordpress-experiment-hub.lovable.app/sdk/0.5.0/testwell.js"></script>Public browser methods
window.testwell and window.expcon are compatibility aliases. The automatic bundle exposes grantConsent, revokeConsent, trackGoal and destroy. It does NOT expose getVariation or recordExposure; developer-controlled rendering needs the programmatic source SDK or React adapter.
trackGoal returns whether a configured custom goal matched locally, not confirmation that the server recorded a conversion. No valid prior exposure means no attributed conversion.
window.testwell?.grantConsent();
// Only after the application confirms a real successful action:
window.testwell?.trackGoal("signup_completed");
// Consent withdrawal:
window.testwell?.revokeConsent();
// When permanently removing the integration:
window.testwell?.destroy();Text delivery and single-page navigation
The target must be unique and match the expected original text and element kind. Unsupported or ambiguous matches leave the original unchanged. Only a safe explicit target ID may receive bounded protection; the entire page is never hidden.
Configuration and text delivery use a 350ms window. Late-rendered content may be excluded rather than changed seconds later. pushState, replaceState and popstate pathname changes trigger fresh configuration. Query/hash-only navigation does not. Sensitive query strings are not sent in event payloads.
Configuration is uncached and refreshes every 30 seconds in foreground sessions. Network failure restores changed DOM text. Background timer throttling means the platform stop is not an exact 30-second wall-clock guarantee.