Price drop alert

Published September 12, 2022
Modules
Difficulty
Selected Clients
empik logoaza logosharafdg logomediaexpert logoneonet logo

Price usually turns out to be one of the key factors that influences a customer’s final purchase decision. Customers who are more sensitive to price are inclined to postpone or even abandon a purchase if the price offered is not satisfactory to them. Therefore, it is worth informing price-conscious shoppers about price reductions when they occur, which can influence their purchase intentions. It’s also a great reminder for impulsive online browsers that can trigger the urge to buy.

This use case describes an example of a price drop alert campaign that you can implement in your business. The described scenario involves sending customers products at a discounted price that the customer previously added to favorites and did not finalize the purchase.

Prerequisites


Process


  1. Create a product.priceDrop event
  2. Create an aggregate that collects sku of recently purchased products
  3. Create an aggregate that collects product sku’s added by the users to their favorites
  4. Create an aggregate that collects the latest prices of products added by users to their favorites
  5. Create an aggregate that collects the last sku’s of products received by users with a discounted price
  6. Create a workflow

Create a product.priceDrop event


In this part of the process create the product.priceDrop event, which will later be used in aggregate and workflow.

  1. Go to Data Management icon Data Management > Events.
  2. To create and describe new event in the system click Add event option.
  3. Define the name of the event. In our case, the event is called product.priceDrop.
    In the API and SDK, this parameter is usually called “action” or “action name”.
  4. Optionally, define a human-friendly display name that will be shown in the Data Managament and Analytics modules.
  5. Optionally, describe the event.
  6. Enable the Make this event available to anonymous profiles without JWT toggle.
  7. Apply all settings.
  8. In the list of events, find the event you just created.
  9. On the right side of the screen, click Add property.
  10. In the Source parameter field, enter the name of the parameter - sku.
  11. In the Property name field, enter a human-readable label for display in the Synerise platform.
  12. Optionally, in the Description field, you can add an explanation about the purpose of this parameter.
  13. To complete the process, click Save.

Create an aggregate that collects sku of recently purchased products


This aggregate will be used in the next part of the process to exclude products that the user has already bought.

  1. Go to Analytics iconAnalytics > Aggregates > New aggregate.
  2. Enter the name of the aggregate.
  3. As the type of the aggregate select Last multi and size: 100.
  4. Check the box - Consider only distinct occurrences of the event parameter.
  5. From the Choose event dropdown list, select the product.buy event.
  6. As the event parameter, select sku.
  7. Define the period from which the aggregate will collect products from the event to the last 30 days.
  8. Save the aggregate.
Configuration of the aggregate
Configuration of the aggregate

Create an aggregate that returns SKU of discounted products added to favorites


This aggregate will be used in the further part of the process. The result of this aggregate will be filtered to prevent sending notifications about discounts on the same favorite items.

  1. Go to Analytics iconAnalytics > Aggregates > New aggregate.
  2. Enter the name of the aggregate.
  3. As the type of the aggregate select Last multi and size: 100.
  4. Select the Consider all occurrences of the event parameter radio button. This includes ALL occurrences of the event in the aggregate.
  5. From the Choose event dropdown list, select the product.addToFavorites event.
  6. As the event parameter, select sku.
  7. Click + where button.
  8. From the Choose parameter dropdown list, select the sku parameter.
  9. From the Choose operator dropdown list, select Not in.
  10. From the Choose value dropdown list, select the aggregate you created in the previous step.
  11. Click + where button.
  12. From the Choose parameter dropdown list, select the sku parameter.
  13. From the Choose operator dropdown list, select Boolean Is true.
  14. Define the period from which the aggregate will collect products from the event to the last 30 days.
  15. Save the aggregate.
Configuration of the aggregate
Configuration of the aggregate

Create an aggregate that collects the latest prices of products added by users to their favorites


This aggregate will return the prices of products from the previous aggregate.

Note: It is important to make sure that the conditions defined in both aggregates are the same in order to get the desired results when combining these aggregates.
  1. Go to Analytics iconAnalytics > Aggregates > New aggregate.
  2. Enter the name of the aggregate.
  3. As the type of the aggregate select Last multi and size: 100.
  4. Select the Consider all occurrences of the event parameter radio button. This includes ALL occurrences of the event in the aggregate.
  5. From the Choose event dropdown list, select the product.addToFavorites event.
  6. As the event parameter, select price.
  7. Click + where button.
  8. From the Choose parameter dropdown list, select the price parameter.
  9. From the Choose operator dropdown list, select Boolean Is true.
  10. Click + where button.
  11. From the Choose parameter dropdown list, select the sku parameter.
  12. From the Choose operator dropdown list, select Not in.
  13. From the Choose value dropdown list, select the aggregate you created earlier.
  14. Define the period from which the aggregate will collect products from the event to the last 30 days.
  15. Save the aggregate.
Configuration of the aggregate
Configuration of the aggregate

Create an aggregate that collects the last sku’s of products received by users with a discounted price


This aggregate later in the process will be used to exclude discounted products already sent to users when the next message is executed.

  1. Go to Analytics iconAnalytics > Aggregates > New aggregate.
  2. Enter the name of the aggregate.
  3. As the type of the aggregate select Last multi and size: 100.
  4. Check the box - Consider all occurrences of the event parameter.
  5. From the Choose event dropdown list, select the product.priceDrop event.
  6. As the event parameter, select sku.
  7. Define the period from which the aggregate will collect products from the event to the last 30 days.
  8. Save the aggregate.
Configuration of the aggregate
Configuration of the aggregate

Create a workflow


Create an automation that will check whether customers have all the necessary consents to receive email communications, as well as whether they have already bought a product they previously added to favorites. If customers meet all the requirements, they will receive an email with products added to favorites whose price has been reduced.

  1. Go to Automation > Workflows > New workflow.
  2. Enter the name of the workflow.

Configure the trigger


In this part of the process, select the customer segment for which you will run this campaign. In our case, these are customers who have added products to favorites and agreed to receive email communication.

  1. Start the workflow with the Audience node. In the configuration of the node:
    1. Set the Run trigger option to repeatable.
    2. Set the interval at which you want to run the automation.
    3. Select the time zone.
    4. Select the New audience tab.
    5. Click Define conditions.
    6. From the choose filter dropdown list select the product.addToFavorite event.
    7. Define the time period for the last 30 days.
    8. From the Choose filter drop-down list, select the newsletter_agreement parameter.
    9. From the Choose parameter drop-down list, select the Equal operator and specify the condition as enabled.
    10. Confirm by clicking Apply.
Configuration of the Profile filter
Configuration of the Profile filter

Configure the Generate event node


  1. Add the Generate event node. In this step, check if the product added to favorites by the user has been discounted.
    In the configuration of the node:
    1. Enter the Event name and Label. In our case, we are using product.priceDrop event.

      Note: Jinjava inserted in Generate event body must have all empty spaces deleted.

    2. In the Body section, use the following jinjava and modify it to your needs:

      {
        "sku": " 
        {% set last_sku=[] %}
        {% set last_price=[] %}
        {% set last_objects_array=[] %}
        {% set final_sku=[] %}
        {% set list=[] %}
        {% aggregate LAST-ITEM-ID %} {# aggregate collecting product sku #}
          {% for sku in aggregate_result|reverse %} {# saving sku from aggregate to last_sku variable #}
            {% do last_sku.append(sku) %}
          {% endfor %}
        {% endaggregate %}
        {% aggregate LAST-PRODUCT-PRICE %} {# aggregate collecting product prices #}
          {% for price in aggregate_result|reverse %} {# saving prices from the aggregate to the price variable #}
            {% do last_price.append(price) %}
          {% endfor %}
        {% endaggregate %}
        {% aggregate LAST-PRODUCT-PRICE-DROP-SKU %} {# aggregate containing previously shown items #}
          {% for listSku in aggregate_result %} {# preparation of a variable list with items to be excluded #} 
            {% do list.append(listSku) %}
          {% endfor %}
        {% endaggregate %}
          {% for sku in last_sku %} {# creating an object containing the product id and price #}
            {% set index=loop.index0 %}
            {% do last_objects_array.append({sku: sku, price: last_price[index], index: index}) %}
          {% endfor %}
        {% set last_objects_array_uniq=last_objects_array|unique(attr='sku') %} {# downloading sku from objects for comparison with the catalog #}
          {% for last in last_objects_array_uniq %}
            {% set key_name=last.sku %}
            {% catalogvar.CATALOG-WITH-ACTUAL-PRICE(key_name).ATTRIBUTE-ACTUAL-PRICE %} {# catalog from which we retrieve the price with the selected attribute #}
            {% set catalog_item=catalog_result|float %}
            {% if last.price|float > catalog_item|float %} {# condition to check if there has been a price drop #}
              {% if last.sku in list|join(',') %} {# condition that adds a comma to items that are affected by the price drop and are not in the list variable #}
              {% else %}
                {% do final_sku.append(last.sku) %}
              {% endif %}
            {% endif %}
            {% endcatalogvar %}
          {% endfor %}
          {% for sku in final_sku %} {# listing the final sku in the sku parameter #}
            {{sku}}
            {% if loop.index != final_sku|length%},{% endif %}
          {% endfor %}
        {% if final_sku|length < 1 %} {# condition to check if any product had a price drop #}
          {{kill}}
        {% endif %}"
      }
              
Tip:

If you would like to make a change to the condition that must be met in order for the event to be generated, you can do so in this line:

 {% if last.price|float > catalog_item|float %} 
Currently, this condition checks if the price varies, regardless of how big the change in value will be.

The result of the automation is an event, which in the sku attribute contains the sku of the discounted products, listed after the comma. If the event is empty, it means that none of the products met the price drop condition.

An example of a generated event:

An example of a generated product.priceDrop event
An example of a generated product.priceDrop event

Configure the Event filter node


  1. Add the Event filter node. In the configuration of the node:
    1. Check event for period of time.
    2. Define the time range to 1 minute.
    3. From the Choose event dropdown list, select the product.priceDrop event.
    4. As the event parameter, select sku.
    5. From the Choose operator dropdown list, select Regular expression.
    6. As the value, enter .+
    7. Confirm by clicking Apply.
  2. For the not matched path, select the End node.
  3. For the matched path, select the Send Email node.

Configure the Send email node

  1. In the email configuration, select the template you previously prepared for the price drop campaign.
    In the template, you can retrieve data from an event that appears in the Event filter node.
    You can learn more about how to reuse event parameters here.

    The following code is an example of how to do it:

    Example jinjava code

    {% set sku_array = event.params.sku %}
    {% set sku_from_array = sku_array|split(',') %}
    <ul>
        {% for sku in sku_from_array %}
        <li data-snr-ai-product-id="{% catalog.Snrs-produktu-ogTag(sku).product:retailer_part_no %}">
            <a class="snrs-AI--item-link" href="{% catalog.Snrs-produktu-ogTag(sku).og:url %}" title="{% catalog.Snrs-produktu-ogTag(sku).og:title %}">
                <img src="{% catalog.Snrs-produktu-ogTag(sku).og:image %}"
                    class="products-slider__item-image snrAI-product-image snrAI-product-image-{% catalog.Snrs-produktu-ogTag(sku).og:image %}"
                    width="90" alt="{% catalog.Snrs-produktu-ogTag(sku).og:title %}" id="snrAI-image-{% catalog.Snrs-produktu-ogTag(sku).product:retailer_part_no %}">
                <h3 class="snrs-AI-product--product-name">
                    <span class="snrs-AI-product--name-first">{% catalog.Snrs-produktu-ogTag(sku).og:title %}</span>
                </h3>
            </a>
        </li>
        {% endfor %}
    </ul>
        

    In addition, you can retrieve, for example, images or other parameters from your catalog.

  2. Confirm by clicking Apply.

Add final setting to your workflow


  1. Add the End node.
  2. Launch the workflow by clicking Save&Run.
Configuration of the workflow
Configuration of the workflow

Check the use case set up on the Synerise Demo workspace


You can check the configuration of each step directly in the Synerise Demo workspace:

Aggregate that collects sku of recently purchased products

Aggregate that collects product sku’s added by the users to their favorites

Aggregate that collects the latest prices of products added by users to their favorites

Aggregate that counts sku’s of products added to favorites by a user

Workflow

If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.

Read more


😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker