What are Locations?

THIS ARTICLE WILL HELP YOU:

What are Locations?

The Locations are the place within the app where you configure the criteria that would trigger your experience.

The most basic configuration triggers the experiment based on a URL, for example: "http://www.convert.com".

This setting is configured automatically when you first create your experiment. And is set to the URL which you input to create your AB Experiment / MVT Experiment / Deployment or the Original URL on a Split URL Experiment. 

There are several options that the Locations provide for triggering your experience.

Trigger by URL

You can trigger experiments based on the URL of your page. You can also add many pages by adding them with the "+" sign..

For a page URL like the following:

"http://domain.com/page1.html?name1=value1&name2=value2"

You would be setting a comparison criteria based only on the first portion of the URL:

"http://domain.com/page1.html"

Trigger by URL and Query Parameters

You can trigger an experiment based on the URL and its Query Parameters.

For a URL like the following:

"http://domain.com/page1.html?name1=value1&name2=value2"

You would be setting a comparison criteria based on the whole URL

"http://domain.com/page1.html?name1=value1&name2=value2"

Trigger by Query Parameters

You can trigger an experiment based on the URL and its Query Parameters.

For a URL like the following:

"http://domain.com/page1.html?name1=value1&name2=value2"

You would set a comparison criteria based on the whole URL

"name1=value1&name2=value2"

Trigger by Page Tags

You can trigger an experiment based on the Page Tags that you setup implementing an Advanced Tracking code.

Page tags are variables that are mapped from your e-commerce system or other to Convert via javascipt variables using Convert advanced tracking code.

You can find more information regarding page tags in this article.

Trigger by JS Condition

If any of the options above did not fit how you want to trigger the experiment you can also use a Javascript Condition. 

A Javascript Condition is a piece of code that when is run and returns true, then the experiment would trigger. 

You can find how to use a JS condition to trigger your test in this article.

Trigger Programmatically

You can also trigger a test programmatically. This should not be done from the Site Area. It should be triggered by code, and can be done in any page where the Convert tracking code is installed on. 

For more information about this, please read this article.

Dynamic Website Triggers

The Triggers will be available for a limited period of time for all users. They will be part of specific plans in the future. Triggers only work with the latest version of the tracking script and not with the legacy tracking script.

What are dynamic website triggers?

Convert's new Dynamic Website Triggers feature allows users to control when and how experiments are activated. Offering various trigger options ensures that experiments are launched at the most appropriate moment, improving both performance and user targeting. This is especially beneficial for Single Page Applications (SPAs) or pages where dynamic content loads without a full refresh.

How do I access them?

SCR-20241024-klaa

Screenshot 2024-10-10 at 2.51.02 PM

Trigger Options:

  1. DOM Element
    Description: This trigger activates when a user interacts with a specific DOM element (e.g., clicks, hovers). It ensures experiments are only activated for users who engage with the selected elements.
    • Use Case: Testing variations that only apply when a user interacts with a button, form field, or a dropdown menu.
    • Event Examples:
      • Click on a CTA button
      • Hover over a specific image
    • It does not require code example; it works out of the box, you only need to enter the HTML selector for the target element, and choose which event to listen to: "click", "hover", "in_view", "change"
  2. Upon Run
    Description: This trigger activates the experiment immediately when the location is run. Ideal for experiments that should start right away when a page or SPA content loads.
    • Use Case: This is for standard A/B tests that don’t require any user interaction to trigger.
    • Code: No additional code is needed. The experiment runs automatically.
  3. Manually
    Description: Allows manual control over when an experiment is activated by embedding code in your site’s global JavaScript or specific page scripts.
    • Use Case: Triggering an experiment only after certain conditions or events are met (e.g., a user completes a sign-up or a modal appears). Embed Code:
      Place this code where you want the experiment to activate:
      window._conv_q.push({ what: 'triggerLocation', params: { locationId: '100123456' } });
  4. When a Callback is Called

Description: Trigger the experiment using a custom JavaScript callback function. This allows for more complex control, such as triggering experiments based on API responses or other asynchronous events.
    • Use Case: Triggering experiments after certain user actions or data loads in SPAs.
    • You need to enter JS code that's going to execute later inside a callback function in order to fire the experience. It is called with two arguments:
      • activate: a function that should be called when the experience should be activated
      • options: an object with the following properties:
        1. locationId: id of the location that is being activated
        2. isActive: boolean flag that indicates if the location is active

Callback Example: 

if (options.isActive) return;
setTimeout(function() {
// it activates the experiences 1 second after the
location trigger is initialized - at the load of the tracking script
activate();
}, 1000);

How to Use Dynamic Triggers:

  • DOM Element Trigger:
    Use this trigger when testing interactive elements. For instance, trigger an experiment after a user clicks a specific button or interacts with a dropdown.
  • Upon Run Trigger:
    Ideal for experiments that should start without any additional actions or inputs from the user. Use this when you want experiments to start immediately when the page loads.
  • Manual Trigger:
    This is perfect for cases where the timing of the experiment is critical and should be controlled programmatically. For example, an experiment should only start when a user reaches a specific part of a multi-step form.
  • Callback Trigger:
    Callbacks are the most flexible option, allowing for custom logic before activating an experiment. This is especially useful for SPAs or content-heavy sites where elements or data load asynchronously.

Sub-elements and Events:

  • Events:
    Used to specify what kind of interaction (e.g., clicks, hovers, scrolls) will trigger an experiment. These are relevant mostly to DOM Element triggers.
  • Example: #button.click(), #image.hover()
  • Embed Code:
    The code you place in your site’s JavaScript or global settings to manually activate an experiment at a specific time.
  • JavaScript Code:
    Code snippets to ensure the right actions trigger your experiments. For example, using a callback for complex SPAs ensures the experiment only triggers after the required data loads.