Target a webpage in a web experiment

Abstract

Details how to select the webpage as well as the conditions under which the experiment runs on your organization's website (Sitecore Personalize).

You can target a webpage as well as the conditions under which a web experiment runs on your organization's website.

To target a webpage in a web experiment:

  1. From the Build screen, on the Page Targeting tile, click Add.

    The Targeting sliding modal displays.

  2. In the Match on drop-down list, click one of the following operators:

    Operator

    Description

    Equals

    This operator executes the experiment if the guest's URL is an exact match to the string you specify in the adjacent String field. If you use the Equals operator, the experiment only runs if if the string is an exact match to the URL. This might not work as intended in preview mode or in production if the URL has query parameters or Urchin Tracking Module (UTM) parameters appended to it. If you use the Equals operator, when you preview the experiment you must remove any query parameters that are not included in the String field you complete in Step 3. The Starts with operator is typically a better option.

    Contains

    This operator executes the experiment if the guest's URL contains the characters you specify in the adjacent String  field.

    Starts with

    This operator executes the experiment if the guest's URL starts with the string you specify in the adjacent String field. We often recommend using this operator, because many URLs are appended with query parameters such as utm_source=email_campaign

    Ends with

    This operator executes the experiment if the guest's URL ends with the string you specify in the adjacent String field.

    Matches Regex

    Select this operator if you want the experiment to execute if the Uniform Resource Identifier (URI) of the guest's current page is formatted and matches the exact case in the specified Regular Expression (RegEx) pattern. This is useful if you want to use more than one contains conditions because you can match different data with just one Regular Expression. Enter the RegEx characters in the adjacent field. For more details on how to write RegEx characters, see the https://www.regular-expressions.info site.

    Tip

    This operator is case sensitive. If you want to use RegEx and disregard the case, select the Matches Regex (Ignore Case) operator.

    Matches Regex (Ignore Case)

    This operator executes the experiment if the Uniform Resource Identifier (URI) of the guest's current page is formatted in the specified Regular Expression (RegEx) pattern. This is useful if you want to use more than one contains conditions because you can match different data with just one Regular Expression. Enter the RegEx characters in the adjacent field. For more details on how to write RegEx characters, see the https://www.regular-expressions.info site.

    Does not equal

    This operator executes the experiment if the guest's URL does not match the string you specify in the adjacent String field.

    Does not contain

    This operator executes the experiment if the URL does not contain the characters specified in the adjacent String field.

  3. In the String field, enter the string or characters required. This is not a URL. Depending on the operator you selected, you must enter the partial page path, as shown in the following image:

    Page Targeting using the Starts with operator
  4. To add additional target conditions, click Add page.

  5. To have Client-Side JavaScript (CSJS) executed on the browser to determine whether to execute the experiment, click Add JavaScript targeting.

    The Advanced Targeting dialog box displays.

  6. Enter the Client-Side JavaScript (CSJS).

    This can include truthy values. A truthy value is a value that translates to true when evaluated in a Boolean context.

  7. Click Done.

    You return to the Targeting sliding modal.

  8. Click Save.

    You return to the Build screen.