Web push with recommended products

Published February 12, 2024
Modules
Difficulty

Web push messaging is an effective form of communication that allows businesses to communicate directly with people who visit their website, even when they are not actively using it. Compared to other forms of communication, web push notifications allow you to deliver concise, clickable messages directly to users’ devices, making them an ideal channel for delivering product recommendations and driving traffic back to your website.

Web Push notification with two action buttons

This campaign is targeted at all users and includes additional action buttons that direct them straight to a page to the product card or to a dedicated page with a list of recommendations.

Prerequisites


Process


In this use case, you will go through the following steps:

  1. Create a personalized recommendation campaign.
  2. Create a webpush template.
  3. Prepare a workflow that creates an event with recommended products and sends a web push to customers who receive any recommendation in the campaign.

Create personalized recommendation campaign

In this part of the process, you will create a personalized recommendation campaign, the ID of which will later be used during workflow creation.

  1. Go to Image presents the Communication icon Communication > Recommendations > Add recommendation.

  2. Enter the name of the recommendation (it is only visible on the list of recommendations).

  3. In the Type & Items feed section, click Define.

  4. From the Items feed dropdown list, select a product feed that has a trained model.

  5. Select the Personalized recommendation type.

  6. Confirm the recommendation type by clicking Apply.

  7. In the Items section, click Define.

  8. Click Add slot.

  9. Click the Unnamed slot that was created.

  10. Set the minimum and maximum number of products displayed in the frame to 1.

  11. Optionally, you can use filters to include specific items in the recommendation frame.

  12. Confirm the configuration by clicking Apply.

  13. Optionally, you can define the settings in the Boosting and Additional settings sections.

    Tip: Learn more about boosting and additional settings.
  14. Click Save.

    AI recommendation configuration
    AI recommendation campaign configuration

Create a web push template


In this part of the process, you will create a web push template with recommended products with two action buttons. The first button links to the product card and the second to the list of recommended products.

  1. Go to Communication icon Communication > Web Push > Templates > New template.

  2. Enter the name of the template.

  3. In the Title field, define the title you want to display in the web push.

  4. In the Message field, define the copy you want to appear in the web push. In our case it will be an insert with product title:
    {{ event.params.title }}

  5. In the Destination URL field, define the link you want to redirect your customers by clicking the web push notification. In our case, it will be link to the homepage: https://demoshop.synerise.com/ (clicking the web push will redirect to homepage, action buttons will redirect to more specific pages).

  6. In the Icon URL field, define the icon you want to display in the web push.

    1. To get the URL of the icon, go to Data Management icon Data Management > Files.
    2. Find the icon on the list.
    3. Hover the mouse cursor over the icon on the list.
    4. Click Copy URL.
    5. Paste the URL in the Icon field.
  7. In the Image URL field, define the image you want to display in the web push. In our case it will be an insert with product image: {{ event.params.imageLink }}

    1. To get the URL of the image, go to Data Management icon Data Management > Files.
    2. Find the image on the list.
    3. Hover the mouse cursor over the image on the list.
    4. Click Copy URL.
    5. Paste the URL in the Image field.
  8. Select Action button and to add two buttons to your web push template by clicking Add item twice. In the button’s settings:

    1. The first button link to product card. In the URL field, paste the following insert: {{ event.params.link }} and in the Button Label field, enter the text on the first button.
    2. The second button links to a listing of product recommendations. In URL field, paste the link to the listing. In our case, it’s https://demoshop.synerise.com/product-personalized-listing and in the Button Label field, enter the text on the second button.
    Important: To create a page with a list of recommended products, please refer to the Creating section recommendations article.
  9. Save the template clicking the button Save as, and choose the folder where the template will be saved.

  10. Confirm by clicking Save.

Create workflow


In this part of the process, create a workflow that will be triggered by the session.end event and create an event with the recommended products that you will refer to in the webpush template. If the customer receives any recommended products in the event, then a webpush message will be sent.

Define the Profile Event trigger node

At this stage, configure conditions that launch the workflow. As a trigger, we will use the session.end event.

  1. As the first node of the workflow, add Profile Event. In the configuration of the node:
    1. From Choose event dropdown menu, choose session.end event.
  2. Confirm by clicking Apply.

Define the Outgoing Integration node

In the Outgoing Integration node, create a webhook that will generate event with recommended products. In our case it is a webpush.recommendation event.

  1. After the trigger node, add Outgoing Integration.
  2. In Definition section, choose the Custom webhook tab.
  3. In the Webhook name, field enter a name for the webhook. In this case Webpush recommendation.
  4. Select the POST method.
  5. In the URL of the endpoint, enter https://api.synerise.com/v4/events/custom.
  6. Leave content-type at default: application/json.
  7. Click Add header.
  8. Add Api-Version with the value set to 4.4
  9. Enter the request body. For the sheet used in this case, the body is as follows:
    {% recommendations3 campaignId=nBzlR4BQtyvD %}
        {% set item = recommended_products3[0] %}
    {
      "label": "Webpush recommendation",
      "client": {
        "id": {{ customer.id }}
      },
      "action": "webpush.recommendation",
      "params": {
        "title": "{{ item.title }}",
        "imageLink": "{{ item.imageLink }}",
        "link": "{{ item.link }}"
      }
    }
    {% endrecommendations3 %}
            
    Where:
    • The campaignId=nBzlR4BQtyvD is the Id of the recommendation campaign you created earlier in this step.
    • All params contain information about recommended product are used in the webpush template.
  10. In the Authorization section, select by API key as your method of authorization.
    1. From the dropdown list below, select the API key that you created as part of the prerequisites.
  11. Click Apply.
The view of the Outgoing Integration node configuration
Configuration of the Outgoing Integration node

Configure the Event Filter node

This node will set the workflow to wait for 2 minutes for the creation of a webpush.recommendation event for the client. If a customer has not received any recommended products in the event, the workflow ends. However, if a customer receives any recommended products in the event, the workflow goes to the next step, in which a web push will be sent to that customer.

  1. As the next node, add Event Filter. In the configuration of the node:
    1. In the Check field, from the dropdown menu choose for period of time.
    2. Set the time range. In our case, it is 2 minutes.
    3. In the Define conditions field, from the Choose event dropdown menu, choose webpush.recommendation event.
    4. Click the + where button, from the Choose parameter dropdown menu, choose title.
    5. From the Choose operator dropdown, choose Regular expression.
    6. As the value, enter .+
      Note: The .+ value means at least 1 character. This excludes events where the item title is empty, meaning there is no recommended item.
  2. Confirm by clicking Apply.
  3. At the Not Matched path, add the End node .

Configure Send Web Push node

In this part of the process you will define the Webpush message to be sent.

  1. To the Matched path, add Send Web Push. In the configuration of the node:
    1. In the Content section, from the Webpush template dropdown, select the template you created in the previous step.
    2. In the Schedule section, set the Webpush lifespan (TTL) according to your business needs.
    3. You can describe campaigns with additional parameters.
  2. Click Apply.
Configuration of the Send Configuration node
Configuration of the Send Configuration node

Add the finishing node

  1. Add the End node.
  2. In the upper right corner, click Save & Run.
    The workflow configuration
    The workflow configuration

Check the use case set up on the Synerise Demo workspace


You can check the all the configurations directly in Synerise Demo workspace:

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