Skip to main content

Configure targeting rules

A page is identified when the unique identifier for a page on your site matches the preconfigured targeting rules for that page.

URL targeting rules are necessary for Rokt to determine which page to activate when a customer is transacting on your site, depending on how you identify the steps in your transaction journey.

Page targeting

  1. Select a Component.

    ComponentDescription
    URLThe full document location of a page. URL is the building block of Rokt's targeting conditions and is extremely flexible when combined with components and operators.
    HostCommonly referred to as the domain or domain name.
    PathThe portion of the URL following the host/domain name that doesn't include query parameters. This is the path (or stem) that is similar to a file path on your computer. The path is often represented by a drill down or tree structure that uses forward slashes to organize files and folders. The path includes the filename (if there is one), for example, index.htm, products.php, or about.html. The path always ends when a question mark appears in the URL, which denotes the beginning of the query string.
    Query StringThe list of variables in the URL, denoted as key-value pairs. The query string is separated from the path (or hostname) with a question mark. Pairs are separated with an ampersand, "&". Not all URLs include a query string of parameters.
    View Name(IOS) Used on pages when the website URL does not change, such as single page applications (SPAs). When targeting SPAs, it is best practice to use custom event functions to notify that something has occurred within the application, for example, a change in view or page content.
    Package Name(Android) Used on pages when the website URL does not change, such as single page applications (SPAs). When targeting SPAs, it is best practice to use custom event functions to notify that something has occurred within the application, for example, a change in view or page content.
  2. Select a Condition.

    ConditionDescription
    EqualsWhen using the URL targeting component, every character in your URL, from beginning to end, must be an exact match of the entered value for the condition to evaluate as true. Use equals when you wish to target URLs that never contain dynamic information, such as session identifiers or query string parameters.
    When using the path targeting component, every character in the document path must be an exact match of the entered value for the condition to evaluate as true. As mentioned above, query string parameters cannot be evaluated when using the equals operator.
    ContainsThe contains condition (also known as a substring match) allows you to target any occurrence of a substring with a longer string. Contains is useful when targeting a unique query string parameter that appears in multiple URLs.
    Starts withThe starts with condition matches identical characters starting from the beginning of the string up to and including the last character in the string you specify. Use the starts with match type when your URLs are generally unvarying but can include query string parameters at the end that you want to exclude.
    Ends withAn exact match of the entered value with the end of the URL. For example, you can target shopping cart pages that use /thankyou.html at the end of their URLs.
    Matches RegexTA regular expression (regex) uses special characters to enable wildcard and flexible matching. Regex matches are useful when the path, trailing parameters, or both, can vary in URLs for the same webpage. If a customer could be on one of many subdomains, and your URLs use session identifiers, you could use a regular expression to define the constant element of your URL.
    Does Not EqualThis is the opposite of the equals component and will only target URLs that do not match your values.
    Does Not ContainThis is the opposite of the contains component and will only target URLs that do not match your values.
    Does Not Start WithThis is the opposite of the starts with component and will only target URLs that do not match your values.
    note

    We've provided a convenient condition checker to help you verify whether the conditions specified in your targeting rules apply to visitors to a page on your site. You can enter a value into the check field, and if the conditions specified above apply, you'll see a green check next to it.

  3. Input Value(s) for your rules.

    You can use the operators AND and OR to join multiple targeting rules.

    OperatorDescription
    ANDThe AND operator is used to join multiple targeting rules so that you can isolate a page. Conditions using AND evaluate as true when all of the values are met.
    ORThe OR operator is used within the values field of individual rules. Rules using the OR operator evaluate as true when any of the values are met.
    OR is useful for targeting one kind of page with multiple URL configurations. You can use OR by adding additional values in an URL targeting rule. When targeting URLs, OR is automatically applied in the value input section. Type additional URLs to continue building rules with the OR operator.

Example

Consider the transaction experience on an ecommerce site with a simple four-step checkout flow comprised of the following pages:

  1. Product selection
  2. Shipping information
  3. Payment
  4. Order confirmation

A checkout confirmation page may have a simple static URL that does not change regardless of the path a customer takes to complete their purchase (e.g., domain.com/checkout/confirmation). Targeting this page in the Rokt platform may only require a single targeting rule to match a specific URL. This is how it might be configured in when setting up a new page:

Pages Checkout Confirmation

By comparison, the product selection pages of an ecommerce site may follow a similar template but contain dynamic information in the query string or URL path (e.g., domain.com/event/2E0054EDEE9410B3). You may need to configure multiple values for your targeting rule, or event a set of rules, to ensure Rokt matches your page to the relevant product selection pages at the top of your funnel. When setting up targeting on this page consider using values like:

Pages Product Selection

When the Rokt Web SDK fires on a page, it matches true when the URL of that page is http://store.example.com/product_selection?productid=1234 or http://www.example.com/store/product_selection/some-product.

note

Make sure the Rokt Web SDK is implemented on all of the pages you target. This ensures Rokt can track and analyze customer behavior on every page you target, regardless of whether you decide to show Rokt offers on the page.

Was this article helpful?