Integrate ABlyftInstallation

Snippet settings

Settings that control how the ABlyft snippet is built and delivered, and related project settings.

The snippet settings control how your project's snippet is built and delivered to your visitors. You find them in your project under Settings → Snippet.

The page has two columns. On the left are the settings, on the right is the output: your snippet code, its details and the sub-snippets of your environments.

Overview

SettingDefaultWhat it does
Cache expiration (ttl)1 minuteHow long the snippet may be cached before it is fetched again
Anti-flicker modeUse built-in modePrevents visitors from seeing the original page before a variation is applied
Minify JavaScriptOnReduces the size of your custom code
Data layer watchingInterceptHow the snippet detects new data layer events
Include jQuery–Deprecated

The settings in General Settings are marked as deprecated in the app. Some of them, such as the cache expiration, are managed by ABlyft support and cannot be changed in the form.

Cache expiration (ttl)

Defines for how long the snippet counts as fresh. During this time, a visitor's browser may use its cached copy instead of fetching the snippet again.

Option
Disable CachingThe snippet is always loaded from the CDN
1 MinuteRecommended, default
2 Minutes
5 Minutes

This setting is read-only in the app. If you want to change it, contact ABlyft support.

Changes are not instant

After you publish a change, visitors whose browser has a cached snippet receive the new version only after the cache expiration has passed. With the default of one minute this takes at most about a minute.

While debug mode is on, caching is turned off.

Anti-flicker mode

Flicker means that visitors briefly see the original page before a variation is applied. Choose how you want to prevent it:

  • Use built-in mode (default): The snippet hides the page (visibility: hidden on the <html> element) right after it has loaded and shows it again as soon as all experiments have been applied, or after 2 seconds at the latest, whichever comes first.
  • Use your own custom mode: The snippet does not hide the page. Use this if you handle flicker yourself, for example with your own script in the <head>.

For the best result, load the snippet synchronously and as early as possible in the <head>, see Embed the snippet.

Minify JavaScript

When enabled (default), ABlyft minifies the JavaScript that you added to the project: project code, helper code, and the code of experiments and variations. This reduces the file size of your snippet.

Check the effect in Snippet size (before gzip) on the right side of the page.

Data layer watching

Defines how the snippet detects new entries in your data layer. It applies to the dataLayer Event audience rules and to watchDataLayerEntry().

MethodBehavior
Intercept (default)The snippet wraps dataLayer.push and reacts immediately to every new entry
PollingThe snippet checks the data layer every 500 ms. Choose this if other scripts replace dataLayer.push

Include jQuery

The jQuery settings (Include jQuery) are deprecated and are not described further.

Snippet output

The right side of the page shows:

  • Implementation (base snippet): the code to place on your site. Click it to copy. See Embed the snippet.
  • Project/Snippet ID and Snippet version (the snippet version is managed by ABlyft)
  • Snippet revision, Last published and Snippet size (before gzip), see Check the state of your snippet
  • Sub-Snippets: one snippet for each environment that has Create a sub-snippet enabled, see Sub-snippets

Publishing

ABlyft publishes your snippet automatically whenever something relevant changes, including the settings on this page. See Publishing. The new version reaches your visitors once the cache expiration has passed.

Further settings with an effect on the snippet are located elsewhere in the project settings.

SettingWhereEffect
Debug modeSettings → Project SettingsConsole output, caching off
Use SPA featuresSettings → Project Settings → Project Activations SettingsEnables Reset-JS and page triggers for single-page apps, see SPA navigation
Run only on ablyft.reInit()Same sectionThe snippet only starts when your code calls ablyft.reInit()
Allow in iFramesSame sectionLets the snippet run inside iFrames
Automatically clean up bucketingSame sectionRemoves experiments that were archived within the last 6 months from the visitor's stored bucketing, so that it does not grow too large
Publication webhooksSettings → Project SettingsNotifies your systems after each publication
External tracking domainsSettings → Project SettingsPasses the variation assignment to another domain, see below
PrerequisitesSettings → PrerequisitesRules for showing variations and for starting tracking, see Consent manager
Data Protection & ComplianceSettings → Data Protection & ComplianceBrowser storage, Do Not Track and cookie settings, see Storage & privacy

Publication webhooks

Publication webhooks let ABlyft notify your systems after every publication, for example to back up or version the snippet, to keep a local copy on your own server, or to send a team notification.

After each publication, ABlyft sends an HTTP POST request (form data) to every URL that you configured. The request contains these fields:

FieldDescription
team_idID of your team
project_idID of the project
snippet_revisionRevision number of the published snippet
snippet_scriptThe complete JavaScript snippet. Only included if Include JS is enabled

Your endpoint should answer within 3 seconds. The User-Agent of the request is ABlyft Publication Webhook.

To receive and store the snippet on your own server, see the receiver example in Self-hosting the snippet.

You can trigger the webhooks without changing anything, see Publish manually: Test webhooks.

External tracking domains

If your tracking happens on another domain (not just a subdomain), enter it under External tracking domains. ABlyft then passes the variation assignment to that domain through a URL parameter. The name of this parameter is ablyft_set_bucketing by default and can be changed in Bucketing handover query parameter.

Advanced settings

The fields custom snippet, tracker URL and asset URL (under Data Protection & Compliance → Custom Settings) are read-only and can only be changed by ABlyft support.

On this page