URL Test Integration Code
A URL Test requires a one-time Hackle JavaScript SDK integration. You need to insert the integration code below into the HTML of the page you want to integrate in order to initialize the SDK.
If the SDK is already integrated on the page, no additional code work is required.
<!-- Add inside the head of the existing code -->
<script src="https://cdn2.hackle.io/npm/@hackler/javascript-sdk@12.2.1/lib/index.browser.umd.min.js"></script>
<script>
window.hackleClient = Hackle.createInstance("YOUR_BROWSER_SDK_KEY");
</script><!-- Example for versions below 11.26.0 -->
<script src="https://cdn2.hackle.io/npm/@hackler/javascript-sdk@11.25.2/lib/index.browser.umd.min.js"></script>
<script>
window.hackleClient = Hackle.createInstance("YOUR_BROWSER_SDK_KEY", {
auto_track_page_view: true,
});
</script>Anti-flicker Code for URL Tests
Due to the nature of URL Tests, when a user first enters the target URL (Option A) page, the Option A page may be briefly displayed before redirecting to Option B, C, etc.
Since exposing the Option A page can affect the test results, you can add code that hides the screen until the URL Test distribution and page navigation are fully completed.
Last updated