Popular Platforms
Step-by-step instructions for the most common website builders. Find your platform below and follow its guide.
In every example, replace YOUR_SNIPPET_KEY with your real key from
Project Settings → Snippet. The snippet is two tags: a tiny inline stub and
the async loader. Both are needed, in that order. The stub is what hides the page
before it paints, so pasting only the loader means visitors can see a flash of
your original content. See Anti-Flicker.
WordPress
There are two good ways to install on WordPress. The plugin method is easier and doesn't touch your theme files.
Method 1: Using a plugin (recommended)
Install the 'Insert Headers and Footers' plugin
In your WordPress admin, go to Plugins → Add New. Search for "Insert Headers and Footers" and install the plugin by WPBeginner, then activate it.
Open the plugin settings
Go to Settings → Insert Headers and Footers.
Paste the snippet
In the Scripts in Header box, paste your A vs B snippet tag and click Save.
Method 2: Editing header.php
Open the theme editor
Go to Appearance → Theme File Editor (or Appearance → Editor on newer versions). If you don't see this menu, your host may have disabled it; use the plugin method instead.
Open header.php
In the file list on the right, click header.php, the file
that outputs your theme's <head>.
Paste the snippet
Find the opening <head> tag and paste your snippet tag
right after it, as early as possible. Click Update File.
Editing a parent theme's header.php directly means your change is wiped out
on the next theme update. Use a child theme or the plugin method to make it
permanent.
Shopify
Open your theme's code
In your Shopify admin, go to Online Store → Themes. Next to your active theme, click the ... menu and choose Edit code.
Open theme.liquid
In the file browser on the left, open Layout → theme.liquid. This file wraps every page in your storefront.
Paste the snippet
Find the opening <head> tag and paste your snippet tag on
the very next line, before any other scripts.
Save
Click Save. The snippet is now live on your storefront.
Here's where it goes in theme.liquid:
<head> <!-- A vs B snippet --> <script> window.avsb=window.avsb||{};window.avsb.q=window.avsb.q||[]; window.avsb.ready=window.avsb.ready||function(f){window.avsb.q.push(f)}; window.avsb.on=window.avsb.on||function(n,f){var t=['on',n,f];window.avsb.q.push(t);return function(){t[0]=null}}; window.avsb.consent=window.avsb.consent||{set:function(s){window.avsb.q.push(['consent.set',s])},get:function(){return{}}}; window.avsb.track=window.avsb.track||{};['event','segment','purchase','cart'].forEach(function(m){window.avsb.track[m]=window.avsb.track[m]||function(a,b){window.avsb.q.push(['track.'+m,a,b])}}); (function(){window.avsb._t0=Date.now();window.avsb._df=fetch('https://cdn.avsb.cloud/YOUR_SNIPPET_KEY/datafile.json').catch(function(){});var d=document,e=d.documentElement,s=d.currentScript,a=s&&s.getAttribute('data-avsb-timeout'),t=a==null?3000:+a;if(!(t>0)||window.avsb.version)return;e.style.opacity='0';e.style.pointerEvents='none';window.avsb._t=setTimeout(function(){e.style.removeProperty('opacity');e.style.removeProperty('pointer-events')},t)})(); </script> <script src="https://cdn.avsb.cloud/snippet.js?id=YOUR_SNIPPET_KEY" data-avsb="YOUR_SNIPPET_KEY" async></script> {{ content_for_header }} ...Webflow
Open Project Settings
In the Webflow Designer, click the W logo in the top left, then go to Project Settings.
Go to the Custom Code tab
Click the Custom Code tab.
Paste in the Head Code section
In the Head Code box, paste your snippet tag. Webflow injects
this into the <head> of every page.
Save and publish
Click Save Changes, then publish your site. The snippet is only active on the published site, not in the Designer preview.
Squarespace
Open Code Injection
Log in to Squarespace and go to Settings → Advanced → Code Injection.
Paste in the Header section
In the Header box, paste your snippet tag. Squarespace puts
everything here into the <head> of all pages.
Save
Click Save. The snippet is now active.
Code Injection is only available on Squarespace's Business and Commerce plans, not the Basic plan.
Wix
Open Settings
In your Wix dashboard, click Settings in the left menu.
Go to Custom Code
Under Advanced, click Custom Code.
Add new custom code
Click + Add Custom Code and paste your snippet tag in the code box.
Set placement
Set Place Code in to Head, and Add Code to Pages to All Pages (or pick specific pages if you prefer).
Apply and publish
Click Apply, then publish your site. The snippet is now live.