Skip to content

Set up A/B testing with tags

Tag the script with the variant a visitor is in:

<script
defer
src="https://hub.madinco.com/script.js"
data-website-id="YOUR_WEBSITE_ID"
data-tag="variant-b"
></script>

Every event from that script carries the tag, so you can compare outcomes between variants in Event reports. Assigning visitors to a variant and keeping that assignment stable across visits is up to your own code — the tag just carries it into the analytics.