Triggers

With Triggers, the site owners can add additional logic to their website:

and run those changes as A/B tests to measure their outcome, or deploy for 100% of users.

For example, you can set up a segment: (M) Section=cart/ to trigger tracking of cart value every time a user visits the cart page. Then create another segment: (M) Cart Value >= 100 to show a notification about the free delivery to 50% of users whose cart value exceeds the minimum threshold. If the test succeeds you can then push the Trigger to 100% of traffic.

Segments and Triggers

In order to make changes to your website, you need to:

wiki-console-ui

The process is the same as for analysing your data but instead of applying the filtering conditions to visits that happend in the past, you apply them to visits that will happen in the future.

Select a Response

Once you open the Triggers tab you will see a list of available responses.

A response is a predefined module designed to deliver a specific site functionality with little or no coding effort from the website owner. Just to list a few examples, with Responses you can survey the users (e.g. open questions, likert-scale), add users to remarketing lists (e.g. Google Remarketing), extract data from the content users are confronted with (e.g. product price, error messages) or add JavaScript tags (e.g. live chat tag, tracking tag).

Responses are also capable of making changes in a front-end layer of a website: replace or add HTML content, modify CSS and execute JavaScript code. This opens the door to creating complex A/B tests, site personalizations or even building entire websites.

Configure a Trigger

All responses share the same set of settings:

wiki-console-ui

By default, responses are triggered only in the (1) Preview Mode. This allows you to safely test if everything works correctly before you push the trigger to Live Mode (production).

Responses can be fired for (2) 100% of users in the segment or for a percentage of users (a test group) while experience of the rest of users (a control group) remains unaffected.

(3) You can also control how many times should the trigger be executed for the same user. By default, the trigger will be executed every time the segment's conditions are met, but you can also limit the execution to once per visit (session) or once per user. If you choose the latter option, the information that the trigger was already executed will be stored on the user's device.

(4) The delay option, allows you to wait with the execution for a certain amout of time expressed in milliseconds. This can be useful, for example, if you want to show a message 30 seconds (30 000 ms) after the page loads.

(5) You can also specify JavaScript dependencies - one or more global variables required by your trigger. The trigger will check if the dependecies are present and wait for them if needed. For example, you may want to add $ to dependecies to wait for jQuery.

(6) By default, if an execution of a trigger fails, there will no other attempts until the trigger conditions are met again. If you want to retry the execution, e.g. in order to wait for dependencies, you can set the timeout - a period expressed in milliseconds during which the execution will be retried until it runs successfully.

Configure a Response

Each response has a different set of options to configure. The screenshot below shows the option for editing the "Show On-Screen Notification" response:

wiki-console-ui

Responses support (1) substitutions tags to show dynamic content. The example above will show a user's name in the notification message - the tag {{user.firstName}} will be substituted with the actual value of user.firstName. Learn more about using dynamic data in responses.

Trigger Related DataPoints

Each triggered response will result in tracking of several datapoints:

wiki-console-ui

Some of the datapoints are response specific and others are universal. In case of the "Show Yes/No Choice Message" pictured above (1) the list will include datapoints unique to that response:

and datapoints that are tracked in the same way for any triggered response:

(2) The icons displayed next to each datapoint allow you to quickly preview stats and create new segment definitons based on that datapoint.

(4) The link displayed under the list will take you to the list of workspaces filtered by the triggers ID.

Testing a Trigger

There are two ways to test a trigger you are working on before you publish it in the Live Mode (production).

Testing in Preview Mode

The first option is to save a workspace, open Preview Mode and navigate your website in a way that will trigger the response. If your trigger is set to fire when a user has cart value above 100 then you need to actually have the cart value greater than 100.

You don't need to be signed in to UseItBetter to test triggers in the Preview Mode. This mean that you can just share a URL with ?preview@@on or #preview@@on with your colleagues to let them try the trigger.

Testing with Code Snippet

The other option is to manualy execute the trigger using a JavaScript code snippet. Scroll down the trigger's page and copy a snippet displayed there. Then open your website, open browser's console (F12 key in Chrome) and paste the snippet in the console field. Hit run to execute the response.

This helps save your time - you don't need to save the workspace you are working on because the snippet is updated every time you make a change. You also don't need to meet any triggering conditions.

Testing an A/B Test

If you set the trigger to run for a sample of users then you might want to force yourself into either a test or a control group. To do so, scroll down the trigger's page till you see the list of related datapoints. You will find there links that will open your website with params responsible for assigning you to a chosen group.

Refreshing the Trigger

The information about triggers active on your website is loaded once when you open the website. It is then cached in your browser's Session Storage to improve performance. If you have made the changes to the trigger and you want to see the latest version you need to either open your website in a new tab, or - if you are in the Preview Mode - click the refresh icon placed in the right corner of UseItBetter in-page console.