SDK Installation
Script tag
Section titled “Script tag”Add this to the shared layout, in <head>. et snippet <site> --text prints the same tags with your site id filled in.
<script> window.AB_CONFIG = { base: "https://api.endlesstesting.ai", domainId: "your-site-id" };</script><script async data-cfasync="false" src="https://api.endlesstesting.ai/api/sdk.js"></script>The data-cfasync="false" attribute tells Cloudflare’s Rocket Loader to skip the SDK. Without it, Rocket Loader rewrites the <script> tag and the SDK never runs on sites using that feature (silent breakage: you will see no events in the dashboard).
How it works
Section titled “How it works”- SDK loads and calls the allocation API for the current page URL
- Thompson sampling selects the best variant for each running test
- DOM changes are applied (text swaps, element modifications)
- Impressions are tracked automatically
- Clicks and conversions are tracked based on your conversion metrics configuration
No flicker
Section titled “No flicker”The SDK applies changes quickly after page load. For critical pages (e.g., paid traffic landing pages), you can configure blocking mode:
<script> window.AB_CONFIG = { base: "https://api.endlesstesting.ai", blockUntilVariants: true };</script><script src="https://api.endlesstesting.ai/api/sdk.js" async data-cfasync="false"></script>With blockUntilVariants: true, the page waits for variant allocation before rendering. Use false (default) for non-blocking behavior.