Experiments
Make any changes to your website using a simple visual editor.
Experiments (also known as web optimization or web personalization) allow you to make any changes to your website using a simple visual editor without the need deploy a code on your website (What You See Is What You Get editor). Our editor supports changes like adding or removing whole blocks, adding recommendations, inserting weblayers or adjusting colors and fonts in various ways. They also allow you to personalize your website using the data from Bloomreach Engagement by using Jinja. Experiments work on a similar basis as Weblayers – you can create multiple variants, show them only to a specific audience and AB Test them. Experiments automatically track a single event called experiment
when they are applied to your website so you can make further analyses based on the data collected from these events.
You can watch this video to get an overview of the basic features:
Experiments can significantly decrease your time to value as they allow you to make small changes to your website without having to know how to code or rely on your IT department. Moreover, any changes can be AB tested and evaluated right away using the Bloomreach Engagement interface, and you can use the data about your customers and personalize the web for them using Jinja.
What is an experiment
An Experiment is essentially just a list of modifications. This list is ordered – the order of the modification matters, they are applied to the webpage in the exact order from top to bottom. There are multiple available modification types to choose from and they are described later in the section Modification types.
Each Experiment also has a few settings associated with it just like any other campaign. The settings are described in the section Settings.
Create an experiment
You can create a new experiment by going to Campaigns > Experiments > Create new
You will be prompted to enter the URL of the website you want to modify with the Experiment. This might be the homepage of your website or any other page that you wish to adjust. Please note that this does not limit the experiment to this URL; it only serves for setting up the experiment.
Important
The page on the URL you enter must be integrated with the current project before creating the Experiment, otherwise, the Experiment won't work. If you want to preview experiments on websites that are not integrated with your project, you can download our Chrome extension.
After clicking on the Create button, you will be taken to your website and an inline visual editor (called the Experiments editor) will be loaded.
Experiments editor
Now you are in the Experiments editor with the possibility to select and change any element on the website. Let's have a look at each part of the editor now, as it is numbered in the screenshot below.
Number | Name | Description |
---|---|---|
1 | Experiment variants | Create and switch between variants of your Experiment. You can then compare their performance through an AB Test . Read more in section Experiment variants. |
2 | List of modifications | Expands the list of all modifications you made. Clicking on a modification will take you back to the editing menu of that element so you can adjust it again. You can also delete a modification, which will bring that element back to its original state. Read more in section List of modifications. |
3 | Undo / Redo | Undo or redo your changes to the experiment. |
4 | Selector | CSS selector of current modification (or the currently selected element on the page). |
5 | Number of selected elements | Shows the number of selected elements. You can select more elements on the website by holding the SHIFT button while clicking on them. |
6 | Browsing mode | Switch to the "browsing mode" if you need to navigate on the website and access another page. |
7 | Mobile preview | Mobile preview. |
8 | Close the editor | Close the editor and return to Bloomreach Engagement without saving your work. |
9 | Preview | Generates a link to your modified website that you can share with others. Note that this is used only to preview the changes, the Experiment will not be launched. The generated link is valid for 24 hours, after that it expires. |
10 | Save | Exit the visual editor either with or without saving your changes. This will not launch the Experiment yet. In order to do that, you need to exit the visual editor and click Start back in the Bloomreach Engagement application. |
11 | Modification selection | Currently selected element(s) on the page - when clicking on the page (or element(s) modified by selected modification) |
12 | Modifications list | This menu pops up when you click on an element on the website. Each function is explained in section Modifying elements. |
13 | Top level modification selection | Currently selected head/body of the page - when clicking on the part of page page modified by selected modification) |
14 | Top-level selector | It allows you to insert scripts directly into the head or body of the page, instead of inserting them into specific elements. |
Experiment variants
Variants serve as a tool to compare different modifications of the same text, picture, structure, functionality, etc. while comparing it to a control group.
You can modify the variants of the experiment using the variant selector (labeled with number 1 in the previous screenshot). It is possible to duplicate, rename, and delete a variant.
Note
There's always a variant called Control group. This is how your website looks without the changes in any other variant. This variant cannot be changed or deleted.
List of modifications
You can access the list of modified elements and the applied modifications using the Modification list button. Each modification in the list shows the modified elements and the changes made in the modification.
You can hover over a modification to highlight the edited element. You can also click on a modification to change it.
Personalized modifications
When a modification is personalized (it contains Jinja), it will be marked in the modification list.
Please note that these modifications load slower than modifications that are not personalized. This also affects any modifications that are applied after the personalized modifications. If possible, sort your modification list in such a way that all (or as many as possible) non-personalized modifications are placed before the personalized modifications.
Selector
"Selector" is a CSS selector of the current modification (or the currently selected element(s) on the page).
Whenever you are hovering over an element or selecting an element on the webpage, the editor automatically generates a unique selector for that element. If you hold the SHIFT key, you can select multiple elements by clicking, as could be seen in the picture above. The editor then generates a selector that matches all the selected elements.
After selecting an element(s) by clicking on it, you can still edit the auto-generated CSS selector by clicking on the pencil-shaped icon in the top bar. For example, your page may have many different pictures and adjusting all of them would take too much time; select one picture and rewrite the selector in order to select more (or all) elements. You can even write an entirely custom CSS selector to apply modifications to, if you know a little CSS.
Important
When you modify an existing selector or write a custom one, you have to confirm it by hitting the ENTER key.
Unique selectors
Note that when you select an element on the webpage, the Experiments editor always tries to generate a unique CSS selector based on the current elements on the current webpage. However, the editor does not know about elements on the other pages on your website, so this selector might also match some other elements on other webpages (if you don't set up page filters and other targeting). If you want to be 100% sure, either set up filters for the experiment, or use unique IDs for the elements you want to modify on your website. Read more about this in How Experiments work behind the scenes and Experiments for developers.
Saving your work
Confirm your changes by clicking on the Save button in the top menu. You will return back to the Bloomreach Engagement app where you can edit additional settings of the Experiment and set up AB testing.
Important
Because of security concerns, it is not possible to save the experiment directly from the Experiment editor. Therefore, do not just close the browser tab when you click on the Save button. Instead, wait until you are redirected to the Bloomreach Engagement app and it fully loads. You should see a confirmation message Success! Your experiment was successfully saved.
Modifying elements
After clicking on any element, a menu will pop up presenting you with several options on how to modify that element. Different modification types are described separately in section Modification types.
Select parent / child / similar element
Change your current selection to the parent or a child of the currently selected element. You have to understand a little bit of HTML and its structure to use this effectively. Selecting a parent element means going one level up within the website structure. Each element can also contain multiple children and you can select one of them to move down within the website structure.
Modification types
Change
Use this option to change the element visually. You can edit the dimensions, colors, fonts, spacing of the element, etc. You can enter the colors manually (using the hex or RGB color format) or use the color picker. When changing the font, make sure it is loaded onto the website. And finally, the sizes need a number and a unit (for example 43px or 12em). The format you should use is indicated in the fields as a placeholder.
This modification type also allows you to change an image on the website and a link's URL address. In order to do that, you have to first select an image or a link.
If you are advanced, you can switch to the Code tab and modify the HTML of the selected element. You can use Jinja here to personalize the content for the user.
Jinja syntax
The experiments modifications is primarily a Jinja template. Therefore, be careful when modifying elements code, as in some cases minified CSS and html might be interpreted as Jinja.
Note that this modification currently only performs basic replacement of text or HTML of the selected element if you modify the HTML in the Code tab. It is not recommended to use it to modify large chunks of the webpage – always prefer selecting child nodes of the webpage and performing HTML modifications deep in document tree of the webpage. Read more in How Experiments work behind the scenes and Experiments for developers.
Insert
This will open a menu with your Weblayers and HTML Blocks saved in the Asset Manager. In both cases, you can either pick an already existing template or create a new one using the code editor.
See the next section to learn how to go about placing the HTML block on the website.
- Weblayer: Weblayers are campaigns that are shown on the specified pages of your website to a specified audience. They are executed using HTML/CSS/JavaScript. You can use them to show a message to the customer or prompt them to action. Use any Weblayer from your project and display it using Experiments.
- Block: Use any existing HTML Block from your project. HTML blocks in the old form of
[[ paramName ]]
can be tweaked by parameters. - HTML: Write your own custom HTML and use Jinja to personalize it.
Move
Moving an element has two parts. Before selecting an anchor point on the website, you need to select whether you want to place your currently selected element before or after that anchor point. You can also put it inside that anchor point as the first or last child.
Before and after are self-explanatory and also the most-used options — the new content will be placed right before or after the selected element. Using these two options places the new content outside the selected anchor element which means that the new content will not inherit the style of the selected element. If you put the element inside as the first or last child, it will inherit the style of the anchor element. See the screenshot below.
Next, click on the target button and then select the element which you want to use as the anchor point for these settings.
Remove
You can delete the selected element completely. After clicking this button, you can also choose whether you want to leave blank space instead of this element or not.
Run script (advanced - requires the usage of JavaScript)
This modification can be used to run custom code for the selected element(s). You can choose to run your code at different points in time — either immediately when the page loads, after the page is loaded, or once for each selected element.
If your experiment uses a data layer trigger, you can also choose to run your code either the first time or each time the trigger occurs.
The default execute options are:
- immediately even before the page content is loaded – Your code will run once the customer opens the page and the browser starts loading the content. Note that the page content may not yet be fully loaded.
- once for each matched element – Your code will run once for each element selected for this modification. You can get a reference to the element using
this.element
(see below). Note that the code may run multiple times based on the number of selected elements. Make sure to account for this in the code. - on document ready with all matched elements – Your code will run once with all matched elements when the page fully loads. You can access the elements using
this.elements
(see below).
If your experiment uses a data layer trigger, the execute options are:
- immediately, when the triggering event occurs (first trigger only) - Your code will immediately run the first time the data layer trigger event occurs.
- on document ready when the triggering event occurs (first trigger only) - Your code will run the first time the data layer trigger occurs but will wait, if necessary, for the page to be fully loaded.
- once for each matched element (first trigger only) - Your code will run once for each element selected for this modification, the first time the data layer trigger event occurs.
- whenever a triggering event occurs (repeatedly) - Your code will immediately run each time the data layer trigger event occurs and the conditions for the experiment are met.
Note: this option requires the Display setting for the experiment to be Always. - repeatedly for each matched element - Your code will run once for each element selected for this modification, each time the data layer trigger event occurs and the conditions for the experiment are met.
Note: this option requires the Display setting for the experiment to be Always.
The remove function
When you use the Run script modification, you have to specify a custom function which reverts your script. This is utilized in the Experiments Editor (because it reverts the previous modifications to always show the latest version of the edited experiment), and whenever you manually revert an experiment on your page.
If you want to know more about why this is necessary, read the behind the scenes of Experiments.
Your code should return an object with a single function called remove
.. This function will be called by Bloomreach Engagement when the Experiment should be reverted. Use the function to revert any modifications that you performed in the modification. This is crucial for the correct behavior of the experiment, especially if you insert new content into the webpage or modify any existing elements.
For example, if you insert an element into the page, the revert
function that you return from the modification should remove that element.
const element = document.createElement('div')
document.body.appendChild(element)
// other modifications
return {
remove() {
// your revert/undo code
element.remove()
}
}
Using this
in your code
this
in your codeYou can use the special this
keyword in the code to access data provided by Bloomreach Engagement. The data is described in the table below.
Name | Description |
---|---|
this.data and this.params | Contains data about the experiment. You can use either variable but we recommend using this.params because it is more readable in the code. See below for what properties this object has. |
this.params.experiment_id | The ID of the current experiment. |
this.params.experiment_name | The name of the current experiment. |
this.params.variant_id | The AB Test variant that is currently shown to the user. |
this.params.variant_name | The name of the AB Test variant that is currently shown to the user. |
this.element | Reference to the selected HTML element. If multiple elements are selected, only the first one is provided here. Great to use with code that is run once for each matched element. |
this.elements | (Notice the plural form.) An array of references to all selected HTML elements for the modification. |
this.inPreview | This is either true when previewing the experiment in the visual editor or false when running the experiment in production. |
this.sdk | Reference to the Bloomreach Engagement SDK. You can use it, for example, to track events using this.sdk.track('event_name') . |
this.selector | The CSS selector (string) that was used to select the elements. |
Design (AB test settings)
In the Design tab, you can create multiple variants of the Experiment and set up AB Testing. You can also change the preview page URL, change the variant names, and even duplicate them.
You can choose the traffic distribution of your customers in the right-middle part of the page. If you select the Automatic traffic distribution (default setting), Bloomreach Engagement will determine the best performing variants of the Experiment automatically and then prefer these variants over the less performing ones. Contrary to that, Custom traffic distribution allows you to select the percentage of your customers to see each of your variants. Note that both cases allow you to create a control group, which is a group of people who will continue to see your original page for the purpose of a better evaluation.
You can also choose to duplicate your variant.
Settings
You can modify the settings of the Experiment on the Settings tab.
Trigger | Choose whether to trigger the experiment On page load (default) or on a specific Datalayer event (see Enhanced Web Targeting - Triggering for details). |
Conversion goal | The automatic AB test optimization and the automatically generated evaluation report are based on this setting. |
Schedule | You can choose to display the experiment instantly or set a specific time period in which the experiment is shown. |
Show on | Choose on which URLs to show the experiment. |
Show on pages with variables | You can choose to display the experiment only on pages with certain pre-defined variables that you have set up in the project settings. See Enhanced Web Targeting for details. |
JavaScript condition | You can specify custom JavaScript as a condition for displaying the experiment. This code is then executed before the experiment is applied to the page, either by the SDK or by the non-flickering script. Jinja is NOT supported here. For more info see the section below. |
Target devices | Show on any device or only desktop or mobile. |
Display | Set until when you want to keep showing the experiment for each eligible customer. Once: Shown only once for the whole period of running the experiment. This is tracked when the event experiment tracks action=show .Once per visit: Shown only once between a session_start and session_end . Once action=show is tracked, it will be shown again only in the next session.* Always: Will be shown all the time for each visit, each day and after each page refresh even when the user closes the weblayer. This is the default and makes the most sense for experiments |
Category | Choose which consent is required for a customer to see this experiment. Read more about Consents. If you don't use consents yet, you will see the campaign groups setting here. |
Audience | Define your custom audience that will see this experiment. You can use our standard customer and event filters. |
Tip for testing your experiment
For testing purposes, we recommend setting the condition Show on page URL containing to something like
?test
. After you have launched the Experiment, you can simply go towww.yourwebsite.com/?test
, and you will see it in the real environment. You can even send this link to anyone, and it will work until you stop the campaign.
By design, experiments ignore URL fragments. That means that if any
#
character is contained in the URL filter, it will be ignored to retain only the first part of the URL.
Evaluation
Every Experiment has a built-in evaluation dashboard. This dashboard displays common metrics and analyses. If AB testing is enabled for the Experiment, the dashboard will also show you how each variant is performing through funnels and accompanying tables.
If you want to customize the evaluation dashboard, you can save it as a custom dashboard using the menu in the top right corner next to the Save button.
Custom JavaScript condition
You can specify your own JavaScript code as a condition for displaying the experiment. This code is then executed before the experiment is applied to the page, either by the SDK or by the non-flickering script. It should return true
when the experiment should be shown and false
when not.
Jinja is NOT supported here!
The JavaScript condition code has to be synchronous and it has to return a value – your code has to contain a top-level
return
statement. If it does not, your code by default returnsundefined
(that is how JavaScript works) and this is a falsy value – which means that if your code never returns a truthy value, the Experiment will never be displayed!
This code is also provided with data from Bloomreach Engagement in the special this
keyword, similar to the Run script modification. You can use the same variables except this.element
and this.elements
. Read more about the provided data in the section Run modification.
Integration
Now that you have your Experiments set up and prepared for production, read about how to integrate and use Experiments on your website correctly. This is a necessary step to optimize the experience of your Experiments for your users.
Troubleshooting
Here are some common issues with using Experiments. If you have any issues with integrating Experiments into your website, have a look at the troubleshooting section in Integrating and using experiments.
I have launched the experiment but cannot see it
There can be several reasons for this:
- If you use AB testing, you might have been assigned to the control group, which is usually set to show the original. You can check whether this is the case by going to Customers and checking what events have been tracked to your profile. Alternatively, you can try using our Chrome extension (still in Beta stage) and see what events are being tracked live in the console.
If this is the case, then either change the AB testing or try opening the page in an incognito mode until you get assigned to the correct variant (the incognito mode changes your cookie every time you open it). - In Settings:
- Check the condition "Show on" and make sure it matches the page that you are loading.
- Check "Category": If the campaign is set to show only to customers with specific consent, your profile must have that consent too.
- If you specified any conditions in the "Audience" part, you must match them.
- If you set up a Custom JavaScript Condition for the experiment, ensure that the code behaves as expected and make sure that it returns
true
. Note that if your code does not return anything, the Experiment will never be shown.
The experiment showed once but it doesn't load again
- If the Display option in Settings is set to Once or Until interaction then you will either need to change it or use the incognito mode to see the campaign again.
- If the Experiment is using a specific schedule, the schedule might have ended.
The experiment editor won’t start
- It may be possible that your backend server is removing some parameters from the URL. The experiments editor relies on a special parameter in the URL called
exponea-editor-params
to function properly. Make sure that you server is not removing this parameter from the URL when showing a webpage. Here is a list of other URL parameters used by Bloomreach Engagement. - Make sure to disable any ad blocking extension you might be using.
- If nothing helps, please contact our support team.
My visual changes are not applied to the element
- The visual changes in the experiment are applied to your website with CSS. CSS works with priorities and so it is possible that your changes are overwritten by the CSS on you website. A bit of technical knowledge is required here, or alternatively, consider contacting our support team.
- If you understand CSS a little, you know that your experiment styles are probably overwritten by your existing website styles. Consider manually writing a longer CSS selector for the element which would get a higher priority.
- If you are changing the background color or image of an element, it is possible that the element is using the new
picture
element with a set ofsource
elements. Again, technical knowledge is required to fix this problem. To fix this problem (and have your new image shown in the webpage), you have to edit the HTML of the element, remove allsource
elements and replace them with a single newsource
(orimg
) element with the correctsrc
set to your new image. - The changes might get overwritten by another Experiment that is published in your Bloomreach Engagement project.
- The changes might be overwritten by the JavaScript running on your webpage. This tends to be hard to spot and requires some technical knowledge of your website.
Updated 8 days ago
When you set up your experiments, read about how to correctly integrate them on your website. Also read about what's called a "flickering effect" in experiments and how to avoid it.