Target an experience to product pages of certain price

THIS ARTICLE WILL HELP YOU:

Issue

When testing in e-commerce sites, the opportunity might arise to test certain changes only on products of a certain price, over a certain price, or under a certain price.

Solution

You can target pages with your experience by adding a Page Tag Condition or a JS Condition to the Locations of your experience.

This will trigger the experience only on pages that match the price condition that you set.

First, you need to make sure that Page Tags have been implemented with the _conv_product_price variable.

  1. Targeting products that match an exact price:
    In this example, we are going to target product pages over 25. Go into the Locations and create and create a condition like the following:



  2. Targeting products over or under a certain price:
    Create a JS Condition like the following, adjusting the comparison operator to what you need, < (less than) or > (greater than):

    location.href.includes('products') && _conv_product_price < 25



  3. Targeting products based on a another price, besides the standard price, such a discounted price.
    Sometimes we need to target prices based on a discounted price. In this case, you need to either map the _conv_product_price variable to the discounted price, or you can also target the price based on the element displayed in the product page.

    Here is an example:

    location.href.includes('/products/') && document.querySelector('.price--highlight').textContent.replace(/\$/g,'') < 25



    In this example, we are targeting the element with the CSS selector '.price--highlight'.

    You can learn how to create a selector.