Common issues
Typical technical problems with the ABlyft snippet and how to solve them.
Find your symptom, check the cause, apply the fix. Turn on debug mode first, because the console output usually names the reason directly.
The snippet does not start
The snippet stops silently in these situations. Some print a message in the console, even without debug mode.
| Situation | Console message | Fix |
|---|---|---|
| A second snippet is on the page | ABlyft aborting - first snippet already initialized | Include the snippet only once per page, also when you use a tag manager |
| The page is inside an iFrame | ABlyft aborting - running in Iframe | Enable Allow in iFrames in the project settings if this is intended |
| The visitor opted out | none | Open the page with ?ablyft_opt_out=false, see Opt out |
| Do Not Track is enabled in the browser and the project respects it | ABlyft # stops because client's doNotTrack is enabled | Turn Do Not Track off in the browser for testing, or review the setting under Settings → Data Protection & Compliance |
The browser is rated as a bot (user agent contains for example bot, google, crawler, spider) | Rated as Bot- Exiting (debug mode) | Use a normal browser. Automated test tools with such a user agent are ignored |
| The general prerequisite rules are not met | General Prerequisite Rules NOT met (debug mode) | Check the rules in Settings → Prerequisites |
Run only on ablyft.reInit() is enabled | none | Call ablyft.reInit() when your application is ready |
| The Visual Editor session is active | Visual Editor Mode activated (debug mode) | Close the editor tab or clear the session storage |
The snippet is outdated
You published a change, but the page still behaves as before.
- Wait for the Publishing … indicator in the top bar to disappear.
- Allow for the cache time. See Snippet settings.
- Compare
ablyft.get('data').revisionwith Snippet revision in Settings → Snippet. If they differ, the browser still uses an old copy. Reload the page with a hard refresh. - Check that you load the right file: an environment with a sub-snippet
has its own file, such as
…/s/12345678-staging.js. - If your own server or a CDN sits in front of the snippet, make sure it does not cache the file for longer.
While debug mode is on, snippet caching is turned off, which is helpful while you test.
Flicker
Flicker means visitors briefly see the original page before the variation appears.
- Load the snippet synchronously and as early as possible in the
<head>, before large scripts and stylesheets. Avoidasyncfor the snippet. See Embed the snippet. - Keep the Anti-flicker mode at Use built-in mode (Settings → Snippet). The snippet then hides the page right after it started and shows it again after all experiments have been applied, after 2 seconds at the latest.
- If the page stays blank for 2 seconds, an experiment waits for something that does not happen (for example an element that never appears). Check the console for errors.
- With Use your own custom mode, ABlyft does not hide anything. You have to hide and show the page yourself.
- Slow changes caused by a long chain of redirects or by content that loads late cannot be fully hidden. Ask your developer to check the load order.
Selectors do not find elements
Variation changes use CSS selectors. If an element is not on the page yet, ABlyft waits and applies the change when it appears. For your own code, use the same approach:
ablyftTools.waitForElement('.promo-banner', function (element) {
element.textContent = 'Free shipping today';
});Check selectors in the console with document.querySelectorAll('your selector'). Selectors that include generated class
names change with each release of your website. See Dynamic content.
JavaScript errors in experiment or variation code
Code of the project, of an experiment and of a variation is run by the snippet. An error in it is caught, so your website keeps working, but the rest of this code does not run.
- In debug mode, the error appears in the console as
ABlyft # ERROR on EXPERIMENT <id>: <message>(orVARIATION). - JavaScript rules for environments, pages and audiences that throw an error count as not matched. The console shows
JS RULEwith the message. - Test the rule or the code in the console to find the faulty line.
Subscribe to the ablyftError event to report these errors to your own monitoring, see
Verify the integration.
Consent blocks tracking
If your project uses Prerequisites for tracking (for example a consent rule), ABlyft keeps data in memory and sends no events until the rule is met. Symptoms:
- Visitors get a new assignment on each page view, or experiments do not stay stable.
- No events appear in the Live Log, and
Tracking Prerequisite Rules NOT metshows in the console.
Check that your consent manager calls enableTrackingConsent and read the state with ablyft.get('trackingConsentEnabled').
See Consent manager.
Single-page applications
If experiments only work on the first page and not after navigation, the page is not checked again. Use a page with
the trigger URL Change, enable Use SPA features in the project settings, or activate pages with
ablyft.push({ eventType: 'activatePage', pageId: … }). See
SPA navigation.
A goal is not measured
- Check the goal in preview mode with
ablyft.get('pingedGoals'): if the goal appears, it fires correctly. - Click goals: the CSS selector must match the clicked element or one of its parents, and the goal must be assigned to an active page. Also check for JavaScript errors on the page, because they can stop other scripts.
- Custom and revenue goals: the
eventNamemust be identical to the API name of the goal. See Custom goals. - Goal counted once: goals with the counting method One are sent only once per variation and visitor. To test again,
delete the
ablyft_tgoalsentry in the configured storage (see Storage & privacy). - Another domain: if the goal is on a different domain, configure External tracking domains, see Snippet settings.
The visitor keeps seeing the same variation
That is intended. The assignment is saved in the configured storage (ablyft_exps, see
Storage & privacy), and the visitor stays in the same variation.
For tests, use a private window or delete the website data. Use ?ablyft_set_bucketing=… only if you must set an assignment by
hand, see URL parameters.
Still stuck?
Contact ABlyft support. Please send the URL of the page, the project and experiment ID, the output of
ablyft.get('data') and the console output with debug mode turned on.
Next steps
- Verify the integration
- Preview & Live Log
- Troubleshooting guides for non-technical checks