Quickstart
Install the snippet in five steps and check that ABlyft is loaded correctly.
This page shows the shortest path from a new project to a verified integration. It takes about 10 minutes.
Step 1: Find your snippet
- Open your project in ABlyft.
- Go to Settings → Snippet.
- Copy the code from Implementation (base snippet). The same page shows your Project/Snippet ID.
The code looks like this (12345678 stands for your project ID):
<script src="https://cdn.ablyft.com/s/12345678.js"></script>Step 2: Add it to your website
Paste the snippet into the <head> of every page you want to test, as early as possible. All options (asynchronous
loading, Google Tag Manager, sub-snippets) are described in Embed the snippet.
Step 3: Publish
You normally do not need to do anything: ABlyft publishes automatically when your project changes, and creates the first snippet when the project is created. If you want to be sure, check Last published on Settings → Snippet. Details: Publishing.
Step 4: Verify the installation
- Open your website with
?ablyft_check=truein the URL and, in the browser console, runablyft.get('data'). If you see your project ID, the snippet is loaded. All checks are described in Verify the integration. - Open the Live Log of your project in ABlyft to see events arrive while you use your website.
ABlyft does not check automatically whether the snippet is installed. The console check and the Live Log are the quickest ways to find out.
Step 5: Create a test goal
Create a goal that you can trigger on purpose, to prove that events reach ABlyft.
-
Create a goal of type Custom with an API Name, for example
test-goal(see Configure goals). -
Attach it to an experiment.
-
Trigger it from the browser console or from your code:
window.ablyft = window.ablyft || []; window.ablyft.push({ eventType: 'custom', eventName: 'test-goal' }); -
Check the Live Log. More on goals: Custom goals.
Events need a bucketed visitor
The snippet only sends events when the visitor is part of at least one experiment. If nothing arrives, make sure an experiment is running (or in preview) on the page you test.