> Synerise Documentation — Use Cases (Part 1 of 3) > > This is part 1 of 3 of the "Use Cases" section. To reconstruct the full section, fetch all 3 parts in order (part 1, part 2, …) and concatenate them. Each article begins with a top-level "# " heading. The manifest listing all sections is at https://hub.synerise.com/llms-full.txt # Web push with voucher and promotion for different categories This use case highlights the functionality provided by Synerise through web push notifications - with a keen focus on user engagement and conversion, Synerise introduces a possibility to add two buttons to a web push campaign. These buttons not only act as navigation tools, directing users to the online store, but also serve as triggers, offering a tailored and interactive experience. This campaign focuses on a targeted approach aimed at users, who have visited specific category, but have not yet made a purchase. The web push notification will highlight special active promotions in the women’s category, which, in our case, will include jewelry and watches. However, this targeting can be customized based on various criteria, such as previously viewed categories (e.g., men/women), where dynamic content placed on the page, which the web push button redirects to, adapts to show relevant promotions based on the visited category. It can also be tailored to other specific user segments, offering flexibility to match our needs. The campaign described in this specific use case, involves adding two buttons, each associated with a unique listing of products: "watches" and "jewelry" for women. After clicking these buttons, users will go to a specific category page where dynamic content with the unique voucher will be displayed. What is important you can enrich this use case using personalized recommendations, promotional recommendations or instead add the link to dedicated landing page with personalized promotions.
Web push with vouchers
## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes). - Create [voucher pools](/docs/assets/code-pools) for both promotions. - [Configure web push notifications](/docs/campaign/Webpush/configuring-web-push) - [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog). ## Process --- In this use case, you will go through the following steps: 1. [Create voucher pools](/use-cases/webpush-with-vouchers#create-voucher-pools). 2. [Prepare a web push template](/use-cases/webpush-with-vouchers#prepare-a-web-push-template). 3. [Create a dynamic content campaign](/use-cases/webpush-with-vouchers#create-a-dynamic-content-campaign) for each promotion. 4. [Prepare a workflow](/use-cases/webpush-with-vouchers#prepare-a-workflow) that will send a web push to customers who visited products of specific categories and didn't make a purchase within 24 hours after visiting the products. ## Create voucher pools --- Create a voucher pool in Synerise for the promotion for women watches and jewelry. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Voucher Pools > Add pool**. 2. On the pop-up, fill in the following fields: 1. In the **Pool name** field, enter the name of the pool (the name is only visible on the list of the voucher pools). 2. Optionally, from the **Barcode** type dropdown list, select the type of codes which will be imported in the CSV file to Synerise.
The selection in the dropdown has no influence on the further process. It serves only informational purposes for the users.
3. Optionally, in the **Voucher prefix** field, enter a number that will be added to the beginning of each code. 4. In the **Emission start** and **Emmission end** fields, select the dates when the distribution of the codes starts and finishes, respectively. 5. Optionally, to limit the size of the pool, fill in the **Pool limit** field. 7. Optionally, in the **Description** field, enter the internal description of the pool that is visible only on the list of voucher pools. 3. Confirm by clicking **Save**. 4. Enter into the pool. 5. Using the **Import** button on the top of the screen, import the vouchers into the pool. Proceed according to [this instruction from step 3 (selecting the import method)](/docs/assets/imports/importing-vouchers#procedure). **Result**: After importing vouchers, you will be able to see the codes in the pool. You will also see information about whether it is assigned or unassigned to any customer. You can also see the assignment date and the date of use.
Voucher pool
Voucher pool
6. Repeat all the steps to create voucher pool for the other category.
Learn more how to build a monitoring system for all voucher pools you have in your workspace. The system can alert you when the number of codes in a voucher pool drops below a predetermined threshold (500 codes in a pool). This alert serves as a reminder for the business to replenish the pool with more codes, as well as an alert to customer service teams to communicate with customers to ensure they are aware of the updated balance. We encourage you to read [Voucher pool alert use case](/use-cases/voucherpools) and use this mechanism.
Do the same with the another voucher pool for watches category. ## Prepare a web push template --- In this part of the process, you will create a web push template with two action buttons. Each of them will display different product category for which the voucher code can be used. 1. Go to Experience Hub icon **Experience Hub > Web Push > Templates**. 2. Click **New template**. 3. Enter the name of the template. 4. In the **Title** field, define the title you want to display in the web push. 5. In the **Message** field, define the main body you want to display in the web push. 9. In the **Image URL** field, enter the URL of the image you uploaded previously to the **Files** section in the **Data Modeling Hub**. [Image requirements](/docs/campaign/Webpush/creating-webpush-templates#image-requirements) are listed at the top of the article. 1. To get the URL of the image, go to Data Modeling Hub icon **Data Modeling Hub > 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. 10. If you want the web push to remain visible until the recipient clicks or closes it, switch the **Require an action** toggle on.
The "requireInteraction" functionality used by this toggle is not supported by some browsers. For more details, go to [https://developer.mozilla.org/en-US/docs/Web/API/Notification/requireInteraction#browser_compatibility](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requireInteraction#browser_compatibility).
11. To configure action buttons for your template, switch the **Action Buttons** toggle on. 1. Click **Add item**. 2. In the **Button Label** field, enter the text that will appear on the button. 2. In the **URL** field, enter the address to which a customer is redirected after clicking the button. 3. To add the second action button, click **Add item** and follow steps b and c.
In this scenario, we have two buttons labeled "watches" and "jewelry." Each button corresponds to a specific URL link: - Clicking the "jewelry" button will redirect to: `https://demoshop.synerise.com/women/jewelry` - Clicking the "watches" button will redirect to: `https://demoshop.synerise.com/women/watches` These links will be employed later in the Dynamic Content (DC) configuration when choosing where to display the DC.
12. For saving the template in a folder of your choice, click **Save as** button and select the desired folder. 9. Save the template clicking the button **Save as**, and choose the folder in which template will be saved. ## Create a dynamic content campaign --- Create a dynamic content campaign where you will display items using a predefined dynamic content template (insert object). This dynamic content will be displayed as a part of the site, only for customers who have clicked the web push. 1. Go to Experience Hub icon **Experience Hub > Dynamic Content > Create new**. 2. Enter the name of the content. 3. Choose **Insert object** type. ### Define Audience 1. In the **Audience** section, select **New Audience** and click **Define conditions**. 1. From **Choose filter** dropdown list, select the `webpush.click` event, `campaignTitle` parameter, choose operator `Equal (string)` and as the value add the exact title of the [Webpush campaign](/use-cases/webpush-with-vouchers#prepare-a-web-push-template) created in the previous step. 1. Click `+ where` and from the **Choose filter** dropdown list, select the **webpush.click** event. 2. Choose the `actionButton` parameter with the value `1`. It will be visible only for users who have clicked the first button in the webpush campaign. 2. Click the calendar in the right bottom of the page and choose the option **Lifetime**. 3. Click **Save**.
The view of the Dynamic Content Audience configuration
Audience configuration
8. To save the audience, click **Apply**. ### Define content 1. In the **Content** section, click **Create Message**. 2. From the list of template folders, select a folder with the predefined **Insert object templates**. **Result:** You are redirected to the list of predefined templates. 3. You can also create your own template. In our case we choose predefined template: **Small message bar**. 4. In the **Text** field, add the copy for your message. 5. On the upper right side of the screen, click **Inserts**. From the dropdown list, choose **Pool** and select the voucher pool created in the previous part of the process. Click the voucher pool, copy the code and paste to your text box. 6. Additionally add background color, text color or add any other additional changes. 7. Click the **Use in communication** button. 8. Click **Apply**.
The view of the Dynamic Content Content configuration
Content configuration
Create two dynamic contents: the first includes an insert from one voucher pool directing to the watches category, as previously described. For the second dynamic content, use an insert from the second voucher pool leading to the jewelry category.
### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. You can also define the type of device you want to show your dynamic content. 5. In the **Page targeting** section, choose **Others**, and in the **Display on pages** section, click **Add rule**. 10. Select **Page URL containing** and enter the address of the category page you defined in the first button in the web push template (for example, the main category page). 4. Click **Apply**. 5. Optionally, you can define the UTM parameters for your dynamic content campaign. 6. Click **Activate**. 7. Prepare another dynamic content template. Duplicate this campaign and add three changes: - In the **Audience** section, change the value of the `actionButton` to `2`. - In the **Content** section, add voucher pool for jewelry category. - In the **Display settings**, select **Page URL containing** and enter the address of the category page you have defined for the second button in the web push template. ## Prepare a workflow --- In this part of the process, create a workflow that will be run every 24 hours, and it will be triggered for the group of users who have visited women category in the last 24 hours but did not make any transaction. ### Define the Audience trigger node 1. Start the workflow with the **Audience** node. 2. Click the node to configure it. 3. In the **Run trigger** section, set the option to **repeatable**, every 24 hours.
Automation Hub Audience node configuration with repeatable run trigger set to every 24 hours
Configuration of the Audience node
4. In the **Define audience** section, choose **New audience**. 1. Click **Define conditions**. 2. From the **Choose filter** dropdown list, select **page.visit**. As the parameter, select **URL** and add the URL for the watches category. 3. Click **Choose filter** and from the dropdown list, select **page.visit**. Choose the **URL** parameter and add the URL for the jewelry category. 4. Betwen those conditions choose operator **OR**. 2. Click **Choose filter** and from the dropdown list, select **transaction.charge**. 4. Betwen those conditions choose operator **AND**. 5. Set up time for each conditions as the **last 24 hours**. 6. Change filter from **matching** to **not matching**. 6. Click **Apply**
Automation Hub Audience node configuration with page visit and no recent transaction conditions
Configuration of the Audience node
### Configure Send Web Push node In this part of the process you will define the Webpush message to be sent. 1. 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](/use-cases/webpush-with-vouchers#prepare-a-web-push-template). 2. In the **Schedule** section, set the **Webpush lifespan (TTL)** according to your business needs. 3. You can describe the campaign with [additional parameters](/docs/campaign/Webpush/creating-webpush-campaigns#adding-custom-parameters). 2. Click **Apply**. ### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending web push notifications with vouchers
The workflow configuration
## What's more --- To further enrich this use case and enhance user engagement, consider a few additional options: - Incorporate personalized recommendations tailored to individual user preferences. You can dynamically suggest products within the "watches" and "jewelry" (or any other) categories that align with each user's interests e.g. showing personalized recommendations on the top of the page. These personalized recommendations can be implemented in multiple areas, such as the homepage, category pages, product detail pages, shopping cart, and even during the checkout process. This personalized touch not only captures attention but also increases the likelihood of users finding products they genuinely desire, boosting conversion rates. [Read more about personalized recommendations](/docs/ai-hub/recommendations-v2) - As an alternative strategy, incorporate a link to a dedicated landing page with personalized promotions. This landing page can feature curated product selections, exclusive discounts and codes, and a seamless shopping experience, further encouraging users to take advantage of the promotions in an environment designed to enhance their overall satisfaction. [Read more about preparing a landing page with personalized products](/use-cases/landing-page-personalized) ## Check the use case set up on the Synerise Demo workspace --- You can check the all the configurations directly in Synerise Demo workspace: - [Dynamic content campaign 1](https://app.synerise.com/campaigns/dynamic-content/create/7de0bc34-cff3-43c7-b082-d235a1ed6e89) - [Dynamic content campaign 2](https://app.synerise.com/campaigns/dynamic-content/create/1d95f14c-01ee-4804-9c5e-3cb726841e6c) - [Webpush campaign template](https://app.synerise.com/campaigns/webpush/content-manager/template/126358) - [Workflow](https://app.synerise.com/automations/automation-diagram/63b80690-139b-4c1d-90f2-47b5f77ac9d5) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webpush.send`](/docs/assets/events/event-reference/webpush#webpushsend) (~1), [`webpush.show`](/docs/assets/events/event-reference/webpush#webpushshow) (~1), [`webpush.click`](/docs/assets/events/event-reference/webpush#webpushclick) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Web push](/docs/campaign/Webpush) - [Voucher pools](/docs/assets/code-pools) # Subscription for a product in mobile app The advantage of creating a subscription model in your mobile commerce is that users can enjoy discounted rates on their desired products, which they buy regularly. This option is also beneficial for offline store owners, as it increases customer loyalty and encourages customers to visit more frequently and make more purchases. In this use case we will create a subscription service mechanism based on Synerise's promotions and analytics. The subscription allows to collect one coffee a day for the next 30 days, 30 coffees in total. Customer pays upfront and the price per item is lower than if bought separately. ## Prerequisites --- - Integrate Synerise [promotions](/docs/ai-hub/promotions) - Implement subscription status management using your billing system or payment gateway: - When the subscription is enabled (customer paid for a monthly subscription): 1. Send a `subscription.status` event with the `segment_enabled` parameter set to `1` This parameter is used to track if a customer is eligible for a coffee on each day. It is changed with a workflow after the client buys coffee and resets at midnight. 2. Update the customer's profile with the `subscription.active` attribute set to `1` This attribute is used to track if the monthly subscription is paid and active. - When the subscription ends or is disabled, update the customer's profile with the `subscription.active` attribute set to `0` In this example, Synerise doesn't de-activate the subscription after its period runs out. Your mobile application must do this. ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/subscription#create-an-aggregate) checking the subscription status. 2. [Create a segmentation](/use-cases/subscription#create-a-segmentation) eligible for the subscription based on the previously created aggregate. 4. [Create a promotion](/use-cases/subscription#create-a-promotion) in Synerise, that reduces the subscribed item's price to zero for the customer. 3. [Create a workflow that tracks redemptions](/use-cases/subscription#create-a-workflow-that-tracks-redemptions) when the customer redeems a coffee. This is needed to track if a coffee was already picked up on a particular day (by using the aggregate created earlier). 5. [Create a workflow which checks the subscription status daily](/use-cases/subscription#create-a-workflow-which-checks-the-subscription-status-daily). ## Create an aggregate --- In this part of the process, create an aggregate that returns the customer's daily redemption status from the most recent `subscription.status` event.
It is important to collect on the client-side transactional information about buying a subscription by customer. In this situation you should generate on your side event (in this case it is `subscription.status`) with the parameter (in this case named `segment_enabled`) with information if the customer is eligible for their daily coffee and send this event to Synerise (the value should be `1` if yes, or `0` if not).
1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown list, select the `subscription.status` event. 5. As the event parameter, select **segment_enabled**. 5. Click **+where** and choose the **segment_enabled** parameter. 9. From the **Choose operator** dropdown list, select **Equal**. 6. As the value set up `1` (it means that it is active). 6. Define the period from which the aggregate will look up event data - in this case, it is **Lifetime**. 7. Click **Save**.
Decision Hub Last aggregate returning the segment_enabled parameter of the most recent subscription.status event with value 1 over a customer's lifetime
Configuration of the aggregate
## Create a segmentation --- Create a segmentation of customers based on the results of [the aggregate you created](/use-cases/subscription#create-an-aggregate) in the previous part of the process. This segmentation shows the customers who did not redeem a coffee on a particular day. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. Click **Choose filter**. 4. From the dropdown list, select the [aggregate you created before](/use-cases/subscription#create-an-aggregate). 5. As the logical operator, select **Equal**. 6. In the text field, enter `true`. 7. Save the segmentation.
Segment settings
Segment settings
## Create a promotion --- In this step, create a promotion that reduces the subscribed product’s price to zero and can be redeemed 30 times. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For selected items** option. 3. In the **Audience** section: 4. Choose the [segment created previously](/use-cases/subscription#create-a-segmentation). 5. Click **Apply**. 4. In the **Content** section: 2. Add the name in the **Display name**. 2. In the **Price** field, enter `0`. 3. In the **Long description** add the names and SKU's of products which price should be reduced to zero (in this case coffees). 4. Define the name and description of the promotion. 3. Confirm the settings by clicking **Apply**. 4. In **Type & limits** section: 1. Choose the **Custom** type. 2. Choose the **Multibuy** sub-type. 4. Define the number of usages per activation as `1`. 6. Define distribution period in the **Schedule** section and publish the promotion to apply all changes and run the promotion. 7. After buying the subscription the promotion created above should be activated on the client side - **for 30 times** (because it is the promotion for 30 coffees). Check the [first](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Promotions%3A%20activation%20%26%20redemption/operation/ActivateAPromotion) or [second](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Promotions%3A%20activation%20%26%20redemption/operation/BatchActivate) option which help you in activation of the promotion in our documentation. ## Create a workflow that tracks redemptions --- In this step create a workflow that generates the event which informs that user collecting his daily coffee. In this workflow, after the promotion is redeemed by customer who has subscription - `client.removePoints` event is generated. This event is the trigger of the described workflow, which removes a customer from the segment for one day (they will not be able to use this subscription two times a day). 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- At this stage, you configure the workflow to be triggered by a `client.removePoints` 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 `client.removePoints` event. 2. Click the + where button, from the **Choose parameter** dropdown menu, choose **promotionUuid**. 3. From the **Choose operator** dropdown, choose **Equal (String)**. 4. In the next field, type the UUID of the promotion that you created earlier. 2. Confirm by clicking **Apply**. ### Define the Generate Event node --- At this stage, an event is generated which is then used to exclude this profile from the segmentation of customers who did not pick up a coffee on this day. 1. As the second node of the workflow, add **Generate Event**. 2. In the **Event name**, enter `subscription.status`. 4. In the **Body** section, define the parameters of this event. In this case it is: ``` {"segment_enabled": "0"} ``` This removes the customer from the segment of customers eligible for a coffee on this day. 5. Click **Apply**. ### Add the finishing node --- 9. Add the **End** node. 10. In the upper right corner, click **Save & Run**.
Automation Hub workflow for tracking coffee subscription redemptions and resetting daily eligibility
The workflow configuration
## Create a workflow which checks the subscription status daily --- In this step create a workflow that checks the current subscription status. It is triggered by the **Audience** node, which starts the automation every day at 00:00. This way, customers who picked up their daily coffee and were removed from the segment of eligible customers the day before, are re-added to the segment and can use the promotion during the next day. They must also have an active subscription. ### Define the Audience trigger node --- At this stage, you configure the conditions that trigger the workflow. 1. As the trigger node, add an **Audience** node. 2. In the configuration of the node: 1. Set the **Run trigger** option to **repeatable**. 2. Set the interval to 1 per day. 3. As the time when the process starts, Choose 0:00 A.M. to make sure that the automation will check the customer status at the beginning of each day. 4. Select the time zone. 6. In **Define audience**, choose **New Audience** and click **Define conditions**. 1. As the first condition, from the **Choose filter** dropdown menu, choose the `subscription.status` event. 2. Click the **+ where** button, choose **segment_enabled**, and then select **Equal**. As the value, enter `0` 6. Set the time range to **Last 1 day before 1 day**. 3. As the second condition, from **Choose filter** dropdown menu, choose the `subscription.active` attribute and then select **Equal**. As the value, enter `1`. 8. Click **Apply**.
The configuration of the Audience node
The configuration of the Audience node
### Define the Generate Event node At this stage, an event with information that the customer has an active subscription and should be added to the segment again is generated. Based on that, the customer will be able to redeem another coffee during this day. 1. As the second node of the workflow, add **Generate Event**. 2. In the **Event name**, enter `subscription.status`. 4. In the **Body** section, define the parameters of this event. In this case, it is: ```json {"segment_enabled": "1"} ``` This re-adds the customer to the segment of customers eligible for a coffee on this day. 5. Click **Apply**. ### Add the finishing node --- 9. Add the **End** node. 10. In the upper right corner, click **Save & Run**.
Automation Hub workflow for checking subscription status daily and re-adding eligible customers to the subscription segment
The workflow configuration
## Request from cash register --- After using one of the [method](/use-cases/subscription#create-a-promotion)described in the promotion section - when customer buy a coffee, the cash register sends a request about promotions ([read more](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Promotions%3A%20retrieval/operation/GetClientPromotionsByACustomFilter)). If the cash register sees in the answer that customer has an active subscription, after processing the transaction, [redeem](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Promotions%3A%20activation%20%26%20redemption/operation/RedeemAPromotion) the one promotion according to one of the methods above. ## What's next --- This promotion can be the first step towards a more advanced marketing strategy and possibilities. While collecting your primary subscription (in this case coffee) you can for example receive a gift once in a billing period - (for example free muffin or small coffee). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration directly in Synerise Demo workspace: - [aggregate](https://app.synerise.com/analytics/aggregates/9b44ca29-0f2b-3d63-94ba-d5903707472d) - [segmentation](https://app.synerise.com/analytics/segmentations/fdcf4f45-7268-49f1-b1dd-9d2add9f2723) - [workflow which generates the event informing about collecting the coffee on a specific day](https://app.synerise.com/automations/automation-diagram/2a0fc77a-4784-4a5c-a2a9-bb6e6f123094) - [workflow](https://app.synerise.com/automations/automation-diagram/5be43d01-05fd-4845-baa9-3d425f3196ab) which adds customers with active subscription to the segment again - [promotion](https://app.synerise.com/campaigns/promotions/7bc157e2-0e43-4072-b5f7-5f5e7db90352) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 42 events per profile that completes the flow: `subscription.status` (~3), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~30), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`client.removePoints`](/docs/assets/events/event-reference/loyalty#clientremovepoints) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~2), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~2). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Loyalty programs basics](/use-cases/loyalty-programs-basics) - [Promotions](/docs/ai-hub/promotions) - [Segmentation](/docs/analytics/segmentations) # Promote Complementary Products in Search Using Contextual Rules AI Search allows you to improve the search experience of your users by customizing search results to individual requirements by setting rules. The possibilities are endless. Define a rule condition and consequence which tailors results based on the context of the search, so customers can find the products they're looking for easier and faster than ever before. This use case describes the process of creating a rule in AI search which promotes mobile chargers when a customer searches for `charger` from a mobile device. ## Prerequisites - An item feed must be provided. - Enable [the search engine](/docs/ai-hub/ai-search/introduction-to-ai-search) for your workspace and create an [index](/docs/ai-hub/ai-search/create-index). - [Implement AI search](https://hub.synerise.com/api-reference/authorization#tag/Authorization/operation/profileLogin) in any of your channels (mobile app, website etc.). - Implement the context parameter with value mobile to search request. It should be added when your customer enters the query on the mobile device. ## Create rules --- 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Select an index from the list. 3. Go to the **Rules** section. 4. On the right side of the screen, click **Add rule**. 5. Enter the name of the rule. 6. To adjust the query conditions, in the **Conditions** section, click **Define**. 1. On the **Query** tab, to define the method of checking the query, choose the **is** condition. The **is** condition means the rule works only if a customer searches exactly for the phrase defined in the rule. 2. In the text field, enter: `charger` 3. In the **Context (optional)** field, enter: `mobile`. This means that the rule only works when the search request has the `context = mobile` parameter.
Example of query conditions
Example of query conditions
1. Confirm the settings by clicking the **Apply** button. 7. To define how the search engine reacts to the defined conditions, in the **Consequences** section, click **Define**. 1. Click **Add consequence**. 2. From the dropdown list, select the **Filter query results** consequence. 3. Click **Add filter**. 4. Select attribute that corresponds to **product type**. 5. In the field next to the attribute name, enter the value that denotes mobile phone chargers or select it from the dropdown list.
Please note that the attribute name and its value depends on the rules used in the implementation process.
8. Toggle the **Mark as elastic** switch on. 9. Confirm by clicking **Apply**. 10. To save and enable the query rule, click **Publish**.
Search context promotion settings
Search context promotion settings
## Check the use case set up on the Synerise Demo workspace --- You can check the [rule configuration](https://app.synerise.com/ai-v2/search/indices/1c7fac97ddd2c12b7cf1e71d7b4489261657270872/query-rules/14432) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [Configuring AI Search](/docs/ai-hub/ai-search/introduction-to-ai-search#configuring-ai-search) - [Creating rules in AI Search](/docs/ai-hub/ai-search/query-rules) # Using Rules to Boost Specific Brands and Products in Search Results You can promote brands in the search results using rules. For example, if you have a partnership with a certain brand, you might want to promote items from that brand for some queries. Another example of promoting is returning an item in a specified position in the search results. This is useful when you added a new item to your inventory and it lacks user interactions. You can promote that item to be the first in the search results for a given query. In this use case, we will show you how to combine both scenarios in one rule that is triggered when a customer searches for `4k UHD TV` (the rule requires exactly this query string): - `brandA` is promoted. - An item (called `item1` in this example) is shown as the first result of the search. ## Prerequisites --- - An item feed must be provided. - The attribute containing the item's brand must be added to [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes). - The Search Engine must be enabled for your workspace. ## Creating the rule --- 1. Go to **AI Hub > Indexes**. 2. Choose the index for which you want to apply the rule. 3. Go to the **Rules** tab. 4. Click **Add rule**. 5. In the top left corner of the screen, enter the name of the rule. 6. In the **Conditions** section, click the **Define** button. 7. In the **Query** option (selected by default), leave the **If query** value at **is**. 8. In the **Phrase** input, type `4k UHD TV`. 9. Click **Apply**. 10. In the **Consequences** section, click the **Define** button. 11. Click **Add consequence** and from the dropdown menu choose **Promote item**. 12. In the **Item** input provide the item that will be promoted. In our example, it is `item1`. 13. Change the **Position** to the place in the search results that the item should be promoted to. In our case, it's `1`. 14. Click **Add consequence** and from the dropdown menu choose **Filter query results**.
The rule view for promoting an item. The selection menu for the second consequence is open.
Settings of the rule that promotes an item. The selection menu for the second consequence is open.
15. Click **Add filter**. **Result:** A dropdown menu and an input field appear above the **Add filter** button. 16. From the dropdown menu, choose the attribute that contains the brand of the items that you want to show in the results. 17. In the input field to the right of the dropdown, provide the brand that will be promoted. 18. Click **Apply**. 19. **Optional**: To schedule your rule to be active from a start date to an end date, click **Define** in the **Schedule** section. Otherwise, your rule will be active immediately, with no end date. 20. In the top right corner of the screen, click the **Save & publish** button. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AI Search](/docs/ai-hub/ai-search) - [Rules](/docs/ai-hub/ai-search/query-rules) # Send data from Google Spreadsheet to Synerise In your business you probably use various tools to store customer information from different sources. With the help of Incoming Integration, Synerise can collect this data and store it in your workspace in any way you want - for example as customer data (attributes, events) or in a catalog. This use case describes how to prepare an automated workflow that synchronizes an updated list of customers opinions on your company stored in Google Spreadsheet with Synerise. The workflow is triggered with an incoming webhook and it creates an event with opinion on the customers' profiles. In Google Spreadsheet, we use Apps Script to send data every day to the incoming webhook. This article describes the example of custom events but you can perform other actions in Synerise using the data in Google Spreadsheet depending on what you store there, for example, you can update data in a Synerise catalog or add new customers.
Completing this procedure requires some knowledge on sending API requests using cURL, Postman, or similar tools.
## Prerequisites --- Create a [Google Spreadsheet](https://www.google.com/sheets/about/) with data you would like to synchronise with Synerise. In our case, the spreadsheet document contains two columns: - `opinion` which contains information about the feedback that customer gave about the company - `email` which contains the customer's email. ## Process --- In this use case, you will go through the following steps: 1. [Create an iconming integration](#create-an-incoming-integration). 2. [Configure a Google Spreadsheet](#configure-a-google-spreadsheet). 3. [Create a workflow](#create-a-workflow). ## Create an incoming integration --- In this part of the process, create an incoming integration to which you will send the data submitted through Google Spreadsheet. 1. Go to Automation Hub icon **Automation Hub > Incoming > New integration**. 2. On the pop-up, select **Without authentication**. 2. Enter the name of the webhook. 3. In the **Endpoint** section, click **Define**.
The URL field is already filled in with the endpoint to which the data submitted throught the form will be sent.
1. Optionally, you can add an icon to this integration. 3. Confirm by clicking **Apply**.
The view of configuration of the Endpoint section
Configuration of the Endpoint section
4. In the **Incoming data** section, click **Define**. 5. Click **Retrieve data**. Right after you click the button, send a request to the endpoint in the **Endpoint** section with the sample of data that will be sent through forms. The system waits for the incoming request for 1 minute and 30 seconds. Example request:
Replace the endpoint URL from the example with the endpoint URL from step 4.
curl --location --request POST 'https://{SYNERISE_API_BASE_PATH}/automation-endpoint/endpoints/END_ID/trigger' \
   --header 'Content-Type: application/json' \
   --data-raw '{
    "opinion": "Great company",
    "email": "xyz@test.com"
   }'
6. When the endpoint receives data from the request, verify the list of variables. If the variables include those which are in the payload (in this case, opinion and email), click **Define**. If not, click **Start again** re-send request, and wait for the results.
The view of collected variables from the request
Collected variables from the request
7. Click **Save & publish**. ## Configure a Google Spreadsheet --- In this part of the process, you will create and schedule a script that sends data from your spreadsheet to Synerise at a specific time, everyday. The script will be created in Apps Script - one of the extensions available in Google Spreadsheets. 1. Go to your **Google Sheets** account and select the Spreadsheet with customers' opinions. 2. Click on **Extensions** and from the dropdown list, selct **Apps Script**.
The view of Google Sheet toolbar
Google Sheet toolbar
**Result**: A window opens.
The view of App Script
Apps Script view
4. Paste the below JavaScript into code window. 5. In the fragment of the code marked as `#insert_endpoint_URL_here#`, insert the endpoint URL from [first step](#create-an-incoming-integration). This script is responsible for sending requests to the incoming webhook with maximum 1000 rows (this limit is configurable in the below code), if the `email` or `opinion` columns are not empty.
function onOpen() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var menuEntries = [
        { name: "Send to Synerise ", functionName: "doGet" },
    ];
    ss.addMenu("Export to Synerise", menuEntries);
   }
   function doGet() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getSheets()[0];
    var range = sheet.getRange(2, 1, 1000, 2); // 1000 is number of last row
    var values = range.getValues();
    for (var row in values) {
        if (values[row][0].length != 0 && values[row][1].length != 0) {
            var obj = {};
            obj.email = values[row][0]
            obj.opinion = values[row][1]
            UrlFetchApp.fetch('#insert_endpoint_URL_here#', {
                "method": "post",
                payload: JSON.stringify(obj), headers: { "content-type": "application/json" }
            })
        }
    }
   }
5. To save the script, in the program controls bar, click the disk icon. 6. In the menu on the left side, click the clock icon > **Triggers** . 7. In the right bottom corner, click the **Add Trigger** button. 8. Configure as below:
The view of Time trigger configuration in Apps Script
Time trigger configuration in Apps Script
9. Click **Save**. **Result:** The data from your Google Sheet spreadsheet will be sent to the endpoint in Synerise everyday between 7 and 8 A.M.
This schedule and script are just for reference and both can be adapted to your business needs. For example, sending data can be triggered by making changes in cells, or adding a new row. You can find more information on triggers [here](https://developers.google.com/apps-script/guides/triggers).
## Create a workflow --- As the final part of the process, create a workflow which captures data sent to incoming integration and creates custom events on the customers' profiles. The workflow starts with the business event trigger that is launched every time the data from Google sheet is sent to Synerise. In response to that, a custom event with an opinion about the company is created. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, select **Business Event**. In the configuration of the node, select the [incoming integration](#create-an-incoming-integration) you created as the first part of the process. 2. Confirm by clicking **Apply**. 4. On the **Buisness Event** node, click **then**. 5. From the dropdown list, select the **Outgoing Integration** node. 6. Click the node. In the configuration of the node: 1. Select the **Custom webhook**. 2. Enter the name of the webhook. 2. Select the **POST** method. 3. Enter the endpoint URL: - For workspaces hosted in Microsoft Azure EU: `https://api.synerise.com/v4/events/custom` - For workspaces hosted in Microsoft Azure USA: `https://api.azu.synerise.com/v4/events/custom` - For workspaces hosted in Google Cloud Platform: `https://api.geb.synerise.com/v4/events/custom` 4. Enter the following headers: - set the `content-type` header to `application/json` (default), - set the `accept` header to `application/json`, - set the `api-version` header to `4.4` 5. Enter the request body. For the sheet used in this case, the body is as follows:
{
           "label":"customer made an opinion about company",
           "client":{
               "email":"{{ request.body.email }}"
           },
           "action":"company.opinion",
           "params":{
               "opinion":"{{ request.body.opinion }}"
           }
           }
This is just an example, you can create JSON according to your business needs. In the example request body, we used the event context from the trigger which inserts an email address and opinion received in the Business Event trigger. You can read more about it [here](/developers/inserts/automation#context).
6. In the **Authorization** section, select **By API key**. 6. From the dropdown list, select API key that has permissions to create custom events.
You can read more about API keys [here](/docs/settings/tool/api) and you can find more information about the endpoint and required API key permissions [here](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent).
6. Confirm by clicking **Apply**. 7. On the **Outgoing Integration** node, click **then**. 8. From the dropdown list, select **End**. 8. In the upper right corner, click **Save & Run**.
The view of workflow configuration
Workflow configuration
**Result:** A `company.opinion` event is saved to the profiles of the customers.
The view of custom event in customer's profile
Custom event in customer's profile
## Check the use case set up on the Synerise Demo workspace --- You can check the [incoming webhook configuration](https://app.synerise.com/automations/custom-blocks/integrations/incoming/edit/1f8d50ee-5c7b-4ca6-9d78-1ad946e569db) and [workflow configuration](https://app.synerise.com/automations/automation-diagram/68e3eb29-6d9e-4439-8100-73ef3e03c022) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1), `company.opinion` (~1). ## Read more --- - [Apps Script documentation](https://developers.google.com/apps-script/reference/spreadsheet/sheet) - [Automation Hub](/docs/automation) - [Incoming integration](/docs/automation/integration/incoming-webhook-node) - [Triggers provided by Apps Script](https://developers.google.com/apps-script/guides/triggers) # Reach customers with high propensity to buy With Synerise you can identify customers with a high propensity to buy and create personalized messages tailored to their preferences and behavior, leveraging the power of customer data to increase engagement, build brand loyalty, and ultimately boost sales revenue. Deliver personalized content through email, SMS, and web push channels, ensuring customers receive messages in their preferred communication channel. Use the power of automation to execute a variety of business scenarios, including reminders for abandoned shopping carts or searches, delivery of promotions, and much more. In this use case, you will create a workflow sending personalized web push, email or sms message to customers with high propensity to buy, depending on their communication consents. ## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes) - [Enable the Propensity prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-propensity-and-best-fit-predictions). - [Configure an email account](/docs/campaign/e-mail/configuring-email-account). - [Integrate SMS gateway with Synerise](/docs/campaign/SMS/configuring-sms-gateway). - [Configure web push notifications](/docs/campaign/Webpush/configuring-web-push). - [Enable Time Optimizer](/docs/settings/configuration/time-optimizer#enabling-time-optimizer) in Synerise settings. - [Create Web and Email modes](/docs/settings/configuration/time-optimizer#creating-modes) in Time Optimizer. - Create templates for [email](/docs/campaign/e-mail/creating-email-templates), [SMS](/docs/campaign/SMS/creating-SMS-template) and [web push](/docs/campaign/Webpush/creating-webpush-templates) communication according to your business needs. ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](#create-a-segmentation) of customers with email/sms/web push agreement. 2. [Create a prediction](#create-a-prediction) to calculate propensity to buy for customers with email/sms/web push agreement. 3. [Create a workflow](#create-a-workflow) to send a web push, email or text message to customers with high propensity to buy, depending on their communication consents. ## Create a segmentation --- In this part of the process, create a segmentation of customers with enabled marketing agreements in one of the following channels: email, web push and SMS. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. From the From the **Add condition** dropdown list, select the `Web push agreement` attribute. 4. Click the **Choose** button, and from the list of operators, choose **Equal**, and then select **true**. 5. From the From the **Add condition** dropdown list, select the `Email agreement` attribute. 6. Click the **Choose** button, and from the list of operators, choose **Equal**, and then select **enabled**. 7. From the From the **Add condition** dropdown list, select the `SMS agreement` attribute. 8. Click the **Choose** button, and from the list of operators, choose **Equal**, and then select **true**. 9. Change **And** to **Or** between all conditions. 10. Save the segmentation.
Decision Hub segmentation configuration for customers with high propensity to buy and communication consent
Segmentation configuration
## Create a prediction --- In this part of the process you will create a prediction to find customers who have communication consents with the highest propensity to buy items in stock. 1. Go to AI Hub icon **(AI Predictions) Models > New prediction** and select **Propensity** as the prediction type. 2. Define the prediction name. 3. As an audience for the prediction, select [the segmentation created in the previous step](#create-a-segmentation). ### Define the item --- 1. In the **Item selection** section, click **Define**. 2. Click **Choose item feed**. 3. Select the catalog that contains the items you want to make the prediction for. **Result**: The **Item filter** section appears. 4. Click **Define item filter**. 1. From the **Select attribute** dropdown list, select the `availability` attribute. You can use the search field. 2. From the dropdown list that appears, select the **Equal** operator. 3. Click the **Parameter** button field that appeared and from the dropdown list, select parameter indicating the availability of a product, in our case it is **In stock**. 4. Click **Save**.
The view of the item filter configuration
Item filter configuration
5. Click **Apply**. ### Additional settings and saving --- 1. In the **Settings** section, click **Define**. 2. Change the **Calculation frequency** to **Recurring calculation**. 3. Set the frequency of model recalculation to 30 days. 4. In the **How would you like to display results?** section, select **2-point scale** for analysis. 5. Click **Apply**. 6. Click **Save & Calculate**.
After the calculation, a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction.
## Create a workflow --- In this workflow, we will send personalized communication to customers with a high propensity to purchase, reaching them through one of their preferred communication channels. In one workflow, we will reach all those customers at the best time, regardless of their preferred type of communication. The workflow will be triggered by the high score of the `snr.propensity.score` event. In this scenario, we will use the **Profile Filter** node to filter customers by their preferred communication channel: web push or email. If a customer has consented to web push communication and has email communication disabled, with **matched path**, we will reach them via web push. Through **not matched path**, we will reach customers with email communication enabled, and with **Event Filter**, we will check if the customer made a purchase after receiving an email. If not, we will send them a text message. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- 1. As the first node, add the **Profile Event**. In the settings of the node, select the `snr.propensity.score` event. 2. Click **+where**. 3. Click **Apply**. 4. From the **Choose parameter** dropdown list, select **modelId**.
**modelId** parameter equals the ID of the prediction you want to use. The model ID can be copied from the Three-dot icon menu in the Prediction list.
5. From the **Choose operator** dropdown list, select **Equal (String)** and enter the ID of the [prediction created in the previous step](#create-a-prediction) in the text field. 6. Click **+where**. 7. From the **Choose parameter** dropdown list, select **score_label**. 8. From the **Choose operator** dropdown list, select **Equal (String)** and enter `high` in the text field. 9. Click **Apply**.
The view of the Profile Event node configuration
Profile Event node configuration
### Define the Profile Filter node --- 1. Add the **Profile Filter** node. In the node settings: 1. Click **Choose filter** and select **Web push agreement** attribute form the dropdown list. 2. From the **Choose operator** drop-down, choose **Equal(String)**. 3. In the text field type `true`. 4. Click **Choose filter** and select **Email agreement** attribute form the dropdown list. 5. In the text field type `disabled`. 2. Click **Apply**.
Automation Hub Profile Filter node configured for web push agreement and email agreement conditions
Profile Filter node configuration
### Define the Optimize Time node to the Matched path --- 1. To the **Matched** path, add the **Optimize Time** node. In the node settings: 1. From the **AI optimization mode** dropdown list, choose **Web**. 2. In **Time period to analyze**, choose the best moment to activate the node that follows the Optimize Time node. In our case it will be **Custom time period**. 3. In the **Time period** field, enter `10` 2. Click **Apply**. ### Define the Send Web Push node --- 1. To the **Optimize Time** node, add the **Send Web Push** node. In the node settings: 1. In the **Content** section, from the **Webpush template** dropdown, select [the template you created as part of the prerequsites](#prerequisites). 2. In the **Schedule** section, set the **Webpush lifespan (TTL)** according to your business needs. 3. You can describe campaigns with [additional parameters](/docs/campaign/Webpush/creating-webpush-campaigns#adding-custom-parameters). 2. Click **Apply**. ### Define the Optimize Time node to the Not matched path --- 1. To the **Not matched** path, add the **Optimize Time** node. In the node settings: 1. From the **AI optimization mode** dropdown list, choose **Mail**. 2. In **Time period to analyze**, choose the best moment to activate the node that follows the Optimize Time node. In our case it will be **Custom time period**. 3. In the **Time period** field, enter `10` 2. Click **Apply**. ### Define the Send Email node --- 1. Add the **Send Email** node. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, type the **Subject** and from the **Template** dropdown, select [the template you created as part of the prerequsites](#prerequisites). 3. In the **UTM & URL parameters** section, you can define the UTM parameters added to the links included in the email. 4. In the **Additional parameters** section, you can optionally describe campaigns with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 2. Click **Apply**. ### Define Event Filter node --- 1. Add the **Event Filter** node. In the node settings: 1. Check event **for period of time**. 2. Define the time range to **1 Day**. 3. In the **Define conditions**, from the **Choose event** dropdown list, select `transaction.charge` event. 2. Click **Apply**. 3. For the matched path, select the **End** node. ### Define the Send SMS node --- 1. To the **Not matched** path, add the **Send SMS** node. In the node settings: 1. In the **Content** section, choose the phone number from which the message will be sent. 2. From the **SMS template** dropdown, select [the template you created as part of the prerequsites](#prerequisites). 2. Click **Apply**. 3. Add the **Merge Paths** node, joining the **Send SMS** and **Send Web Push** nodes. ### Add the finishing node and set capping --- 1. Add the **End** node. 2. In the upper right corner, click **Set Capping** and define the limit of workflows a profile can start: 1. Set **Limit** to 1. 2. Set **Time** to 3 months. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending communications to customers with high propensity to buy
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/14b2c630-85f5-4c75-b53b-2c0264abb2d5) - [Prediction](https://app.synerise.com/ai-v2/predictions/propensity/uxjakavwbbgt) - [Workflow](https://app.synerise.com/automations/automation-diagram/48972f25-04ff-43c3-a06f-1e34c7089e06) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~4), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`snr.ate.prediction`](/docs/assets/events/event-reference/predictions#snrateprediction) (~1), [`webpush.send`](/docs/assets/events/event-reference/webpush#webpushsend) (~1), [`webpush.show`](/docs/assets/events/event-reference/webpush#webpushshow) (~1), [`webpush.click`](/docs/assets/events/event-reference/webpush#webpushclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Email campaigns](/docs/campaign/e-mail) - [Predictions](/docs/ai-hub/predictions) - [Product feed](/developers/product-feed) - [Segmentation](/docs/analytics/segmentations) - [Time optimizer](/docs/settings/configuration/time-optimizer) - [SMS campaigns](/docs/campaign/SMS) - [Web push](/docs/campaign/Webpush) # Voucher-based referral program Creating a solid loyalty program is key to building lasting relationships with customers. Among the countless strategies to achieve this, the use of discount codes stands out as a powerful tool. Implementing a referral program based on discount codes opens up many opportunities to attract new users, while encouraging current users to engage more deeply. These codes not only encourage customers to make additional purchases, but also serve as a channel to expand our customer base through word-of-mouth referrals. What's more, this referral system isn't just advantageous for the invitee; it's a win-win scenario that rewards both the inviter and the invitee when the shopping voucher is utilized. In this use case, the loyalty program works by giving customers a discount code that they can share with their friends after they've made a purchase. If a friend then uses this code to buy something, the original customer gets a reward, usually in the form of another discount. These discount codes are shared through email. This approach keeps customers engaged and encourages them to spread the word, benefiting both the business and its customers. ## Prerequisites --- - [Create an email account](/docs/campaign/e-mail/configuring-email-account) which you will use to send emails. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). Additionally, implement a custom parameter for the **transaction.charge** event, which will contain the coupon code that was used in the transaction. In our case, we will use the `discountCode` parameter. - Create two different [voucher pools](/docs/assets/code-pools): - One pool is for voucher codes that customers can share with their friends. - The second pool contains rewards for customers after someone they shared a voucher code with makes a purchase using the code from the first pool.
To easily identify discount codes in the next process steps, you can start each voucher with the same set of letters. For example, use prefixes like `SPR`_F45670, `SPR`_J20948.
- Meet [all requirements](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Vouchers/operation/RedeemAVoucher) necessary to redeem a voucher - Make two types of email templates: - One for customers who have made a purchase and will get a voucher code to share with friends. - Another for customers whose shared voucher code was used by a friend, so they get a new voucher code for themselves.
We recommend using Jinjava in templates to retrieve the voucher code for the customer. To get the same voucher code, use this Jinjava code:
{% voucher assign=false %} pool-uuid {% endvoucher %}
## Process --- 1. [Create a workflow](/use-cases/voucher-codes-share#create-first-workflow) that sends a discount code to customers who have made a transaction to share the code with another person. 2. [Create a workflow](/use-cases/voucher-codes-share#create-second-workflow) that checks the use of the code by the recipient of the code. 3. [Create a workflow](/use-cases/voucher-codes-share#create-third-workflow) that will reward a customer from the first workflow who gifted someone with the code. ## Create first workflow --- This workflow is used to send a discount code to customers who have made a transaction to share the code with another person. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- 1. As the first node of the workflow, add **Profile Event**. In the node settings: 1. Click **Choose event** and from the dropdown list, select the [`transaction.charge` event](/docs/assets/events/event-reference/items#transactioncharge). 2. Confirm by clicking **Apply**.
Profile Event trigger configuration
Profile Event trigger configuration
### Configure the Send email node --- In this part of the process, send email communication to customers who have made a transaction. Following the allocation of a voucher to a customer, a [**voucherCode.assigned**](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) event will be recorded in their customer profile. 1. Add the **Send Email** node and open its settings. 2. In the **Sender details** section, choose the email account from which the email is sent. 3. In the **Content** section, select the template that you prepared as a part of the prerequisites. 4. **Optional**: In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 5. **Optional**: In the **Additional parameters** section, assign [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters) to the events generated by interactions with the message. 6. Confirm by clicking **Apply**. ### Configure the Event filter node --- In this step, we verify if the **voucherCode.assigned** event has been generated for a customer. 1. Add the **Event Filter** node. In the configuration of the node: 1. Enter the title of the node, (for example, we use `voucherCheck`). 1. Check event **for period of time**. 2. Define the time range to **5 Minute**. 3. From the **Choose event** dropdown list, select the **voucherCode.assigned** event. 4. As the event parameter, select **poolName**. 5. From the **Choose operator** dropdown list, select **Equal**. 6. As the value, enter the name of the voucher pool you are referring to. 7. Confirm by clicking **Apply**.
Event filter node configuration
Event filter node configuration
2. For the **not matched** path, select the **End** node. 3. For the matched path, select the **Update profile** node. ### Add the Update Profile node --- In this step, assign an attribute to customer's profile with the value of the voucher code. In our case, we use **my_refferal_code** attribute. 1. For the **Matched** path, add the **Update Profile** node. 2. Click dropdown list and create **my_refferal_code** attribute. 3. From the next dropdown list, choose **Change** operator. 4. In the **Value** section, insert the following jinjava which will display as the **voucherCode**:
`{{ automationPathSteps['voucherCheck'].event.params.voucherCode }}`
Note that `voucherCheck` is the name of the **Event Filter** trigger added manually.
Update Profile node configuration
Update Profile node configuration
3. To save the changes, click **Apply**. 4. Add the **End** node.
Final view of the workflow configuration
Final view of the workflow configuration
## Create second workflow --- This workflow will be used to redeem discount code. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- 1. As the first node of the workflow, add **Profile Event**. In the node settings: 1. Create name for this node, as it will be used later in the workflow. 2. Click **Choose event** and from the dropdown list, select the `transaction.charge` event. 3. Click **+where** and from the dropdown list, select **discountCode** parameter. 4. From the **Choose operator** dropdown list, select **Starts with (String)**. 5. In the **Value** section insert the prefix that is used in all codes from the first voucher pool you created as a part of prerequisites. In our case it's `SPR` prefix. 3. Confirm by clicking **Apply**.
Profile Event trigger configuration
Profile Event trigger configuration
### Configure the Profile filter node --- This Profile filter creates a security measure so that this code cannot be used by people who received it through the [first workflow](#create-first-workflow). 1. Add the **Profile Filter** node. In the configuration of the node: 1. From the **Choose filter** dropdown list, select the **my_refferal_code** attribute. 2. From the **Choose operator** dropdown list select **Starts with (String)**. 3. In the **Value** section, insert the prefix that is used in all codes from the first voucher pool you created as a part of prerequisites. In our case it's `SPR` prefix. 4. Modify the **Profile matching** attribute to **Profile not matching**. 5. From the **Choose filter** dropdown list, select the **voucherCode.assigned** event. 8. Click **+where** and from the dropdown list, select **poolName** parameter. 9. From the **Choose operator** dropdown list, select **Equal (String))**. 5. In the **Value** section insert the prefix that is used in all codes from the first voucher pool you created as a part of prerequisites. In our case it's `SPR` prefix. 6. Modify the **Profile matching** attribute to **Profile not matching**. 7. Define the time period for which the event will be calculated. 8. Use the **AND** logical operator to connect set rules. 7. Confirm by clicking **Apply**.
Event filter node configuration
Event filter node configuration
2. For the **not matched** path, select the **End** node. 3. For the matched path, select the **Outgoing integration** node. ## Configure the Outgoing Integration node --- In this step, we will redeem the used coupon during the transaction using [Synerise API reference](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Vouchers/operation/RedeemAVoucher). 1. Add **Outgoing Integration** node. 2. In **Definition** section, choose the **Custom** tab. 2. Choose Webhook connection type. 3. Select a connection. If you haven't created any connection yet, see instructions in ["Set up a connection" section](/docs/automation/actions/webhook-node#set-up-a-connection). 3. In the **Webhook name**, enter your preferred name. The value of this field will be stored as a Name parameter in the response event. It makes it easier to identify the event and is useful for creating analysis. In our use case, we will use the following name `voucherRedeemed`. 4. Define the **Webhook event name**. In our use case, we use the `voucherCode.redeemed` event.
This is the event key. While naming it, follow the pattern used for the default events in the application such as page.visit, product.buy and so on.
5. In the **URL** section, choose the **POST** method. 2. Enter the following URL: `https://api.synerise.com/v4/vouchers/item/redeem` 5. In the **Key** field, enter `Accept` and in the **Value** field, enter `application/json` 6. Click **Add header**. 7. Add **Accept** with `application/json` 7. In the **Key** field, enter `Api-Version` and in the **Value** field, enter `4.4` 4. In the **Body** section, enter the following Jinjava:
{"code":"{{ automationPathSteps['transactionCode'].event.params.discountCode }}"}
Note that `transactionCode` is the name of the **Profile Event** trigger added manually. In this Jinjava we reference to code that has been used. Because this code was assigned in the first workflow to the user who shares it, the voucherCode.redeemed event (which is the result of using this API request) is assigned to the profile of the person who shares the code. Such configuration is crucial for the [third workflow](#create-third-workflow) which sends out reward discount code which is based on the `voucherCode.redeemed` event. 3. Confirm by clicking **Apply**.
Outgoing integration node configuration
Outgoing integration node configuration
4. Add the finishing **End** node.
Final view of the workflow configuration
Final view of the workflow configuration
## Create third workflow --- This workflow will send a reward to a customer from the first workflow after the code they shared with someone has been used. ### Define the Profile Event trigger node --- The worflow is triggered by the `voucherCode.redeemed` event which was generated in the previous workflow. 1. As the first node of the workflow, add **Profile Event**. In the node settings: 1. Click **Choose event** and from the dropdown list, select the `voucherCode.redeemed` event. 2. Click **+ where** and from the dropdown list, select **poolName**. 3. From the **Choose operator** dropdown list select **Equal (String)**. 4. As the value, enter the name of the voucher pool you are referring to. 5. Confirm by clicking **Apply**.
Profile Event trigger configuration
Profile Event trigger configuration
### Configure the Send email node --- In this part of the process, send email communication to customers who previously shared the code. They'll receive a reward in the form of a voucher code for their own use. 1. Add the **Send Email** node and open its settings. 2. In the **Sender details** section, choose the email account from which the email is sent. 3. In the **Content** section, select the template that you prepared as a part of the prerequisites. 4. **Optional**: In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 5. **Optional**: In the **Additional parameters** section, assign [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters) to the events generated by interactions with the message. 6. Confirm by clicking **Apply**. 4. Add the **End** node.
Final view of the workflow configuration
Final view of the workflow configuration
## Check the use case set up on the Synerise Demo workspace --- Check all items (metrics and dynamic content) created in this use case in our Synerise Demo workspace: - [Workflow 1](https://app.synerise.com/automations/automation-diagram/8b5add66-f831-412b-880a-e687a31e651a) - [Workflow 2](https://app.synerise.com/automations/automation-diagram/b05c6666-cf7d-49c9-aff4-9efe742e1149) - [Workflow 3](https://app.synerise.com/automations/automation-diagram/52294202-031a-4a19-ae01-86a91ae456bd) - [Voucher codes for referral](https://app.synerise.com/assets/vouchers/pools/193bf1b4-3e95-4236-9117-35d161ab62cc/coupons) - [Voucher codes for those who shared the code](https://app.synerise.com/assets/vouchers/pools/3d914818-46e0-42dd-b703-f07736d73c70/coupons) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 28 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~2), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~4), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~3), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~6), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~3), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~2), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~2), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~2), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~2), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1), [`voucherCode.redeemed`](/docs/assets/events/event-reference/loyalty#vouchercoderedeemed) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [API](/developers/api) - [Email campaigns](/docs/campaign/e-mail) - [Voucher pools](/docs/assets/code-pools) # Automated Email Workflow for Gathering Customer Feedback and Improving Ratings Online shopping gives customers huge opportunities to compare offers between different e-commerce sites and to search for the best price. Many online services, like price comparison websites, offer access to reviews and average ratings of a given store. Low rates can discourage potential customers from buying in a particular store. Generally, it is often dissatisfied customers who make the effort to express their opinion, while people who have successfully completed the purchasing process are not motivated to share their positive experiences. In this way, a store's opinion can be easily damaged, so it is so important to maintain its good rating. A good idea is to **encourage your loyal and satisfied customers to leave their opinion and reviews** to collect more feedback and improve your ratings. To do this, you need to use some kind of reward, such as a discount or any other special offer which will be added to the customer’s account if they leave their feedback. This use case describes an automated process in which, after the transaction and receiving the order, the customer gets an email encouraging them to leave reviews on the website. As a gift, the customer receives a discount on future purchases, and additionally participates in the contest in which they can win a voucher for a higher amount.
An additional incentive you encourage your customers with is to make the reward only available for a specific amount of time, for example one month.
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code). - Send [transactional events](/developers/web/transactions-sdk). - Configure an [email account](/docs/campaign/e-mail/configuring-email-account). ## Process --- 1. [Send custom event](/use-cases/ratings-on-external-sites#send-custom-event) with information about the order status. 2. [Prepare an email template](/use-cases/ratings-on-external-sites#prepare-an-email-template). 3. [Create a workflow](/use-cases/ratings-on-external-sites#create-a-workflow). ## Send custom event --- To run a workflow which allows you to send an email after customers receive their orders, you must send information to Synerise that the order was delivered. Using the API, [send a custom event](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/ClientVisitedScreen) with information about the order status. The example event:
{   
"label": "Order delivered",
"action": "order.delivered",
"client": {
        "email": "john.doe@test.com"
    },
    "params": {
        "orderId": "1988100"
    }
}
If you don’t want to create custom events, you can send the `transaction.charge` event with the updated `orderStatus` parameter using [this API method](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/BatchAddOrUpdateTransactions). You must include `eventSalt` parameter in such case.
Custom event example
Example of custom event
## Prepare an email template --- In this part of the process, create an email template that will be sent to the customers who received their orders. 1. Go to **Experience Hub > Email**. 2. On the left side of the screen, click **Templates**. 3. Select the wizard in which you will create your message. - **Drag&drop builder** - It lets you create templates with ready-made components. - **Code editor** - It lets you create templates in CSS and HTML. 4. Prepare the template according to your business needs. 5. Click **Save this template > Save as**. 6. Enter the name of the template and select the folder in which the template will be saved.
You can prepare the second version of the email template. This will let you perform A/B test of emails and find out which provides better conversion.
## Create a workflow --- In this part of the procedure, create a workflow triggered by the event that signifies the delivery of the order to the customer. 3 days after the occurrence of the event, send the email to the customers who received their orders. Optionally, you can send two versions of the email. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, add **Profile Event**. 4. In the configuration of the node: 1. As the name of the node, enter `OrderDelivered`. 2. Select the event that is generated when the order is delivered to a customer. In this use case, it is `order.delivered`. 5. Confirm by clicking **Apply**. 5. As the second node, add **Delay**. In the configuration of the node, set the delay to 3 days. 6. As the third node, add **Send Email** node. In the configuration of the node: 1. In the **Sender details** section, select the email account from which the email will be sent. 2. In the **Content** section, select the email template.
In the email subject, you can insert information about order ID, which is retrieved from the **Profile Event** trigger. Insert the `{{ automationPathSteps['OrderDelivered'].event.params.orderId }}` snippet, which will display as the order ID . Note that `OrderDelivered` is the name of the **Profile Event** trigger added manually.
3. In the **UTM & URL parameters** section, add the parameters to your email. 4. Confirm by clicking **Apply**.
If you want to perform A/B test instead of sending a single email, click here
  1. Instead of performing step 6 and its substeps, add the ABx Test node. In the configuration of the node, define the allocation of groups. Optionally, you can add more groups.
  2. On the ABx Test node, click the plus icon.
  3. From the dropdown list, select the Send Email node.
    Result: Group A path appears.
  4. On the ABx Test node, click the plus icon.
  5. From the dropdown list, select the Send Email node.
    Group B path appears.
  6. In the configuration of the Send Email nodes:
    1. In the Sender details section, select the email account from which the email will be sent.

    2. In the Content section, select the email template.

      In the email subject, you can insert information about order ID, which is retrieved from the Profile Event trigger. Insert the `{{ automationPathSteps['OrderDelivered'].event.params.orderId }}` snippet, which will display as the order ID . Note that `OrderDelivered` is the name of the Profile Event trigger added manually.

    3. In the UTM & URL parameters section, add the parameters to your email.

    4. Confirm by clicking Apply.

    The configuration of the workflow with A/B testing
    The configuration of the workflow with A/B testing
7. Add the **End** node. 8. Click **Save & Run**.
The configuration of the workflow
The configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- Check the [workflow](https://app.synerise.com/automations/workflows/automation-diagram/2854a513-4b2b-42a9-951a-6eec92c96bd9) settings in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per profile that completes the flow: `order.delivered` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [ABx Test node](/docs/automation/conditions/abx-split-node) - [Automation Hub](/docs/automation) - [Automation Jinjava inserts](/developers/inserts/automation) - [Creating email templates](/docs/campaign/e-mail/creating-email-templates) - [Send Email node](/docs/automation/actions/send-email) # Exclude Outliers from Client Segmentation Analysis Often when working with big datasets and collecting huge amounts of data, it happens that many outliers end up in the database. In general, outliers are not beneficial to analysis and while representing true data points, they can obscure insights in the data. Here we demonstrate two examples how you use outliers exclusion in analytics using quantiles. The first case is creating a segmentation of clients with typical purchases, and the second one is an example how to calculate a metric that only calculates typical (without outliers) values. ## Prerequisites --- - Implement [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Implement [transactions](/developers/web/transactions-sdk). ## Process --- In this use case, you will go through the following steps: 1. [Create segmentation](/use-cases/outlier-exclude#create-segmentation-of-clients-with-typical-purchases) of clients with typical purchases. 2. [Create aggregate](/use-cases/outlier-exclude#create-aggregate-to-define-outliers) to define outliers. 3. [Create segmentation](/use-cases/outlier-exclude#create-segmentation-for-customers-who-are-not-outliers) for customers who are not outliers. 4. [Create metric](/use-cases/outlier-exclude#calculate-the-sum-of-transactions-without-outliers) to calculate the sum of transactions without outliers. ## Create segmentation of clients with typical purchases --- We aim to create a segment of clients and include only typical behaviors with regards to the selected analytic. For example, a segment of clients that made typical purchases in a given time period.
In this example, "typical" means that the value of purchases is between 5th and 95th percentiles, however this may be adjusted as needed.
## Create aggregate to define outliers --- You need to create two separate aggregates (outliers/high and outliers/low) to define the quantile which denotes outlier values. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Set the **Analyze profiles by** option to **Quantile** and select the appropriate value (in this case `95` for high outliers or `5` for low outliers). 4. Click **Choose event**. 5. From the dropdown list, select **transaction.charge**.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it's **transaction.charge**).
6. Select the **totalAmount** attribute. 7. Save the aggregate. 8. Repeat steps 1-7 to create the other aggregate. A single aggregate should look more or less like this:
Example setup of aggregate to capture outliers
Outliers
## Create segmentation for customers who are not outliers --- In this stage, you create a segmentation that list the customers who are *not* outliers. 6. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 7. Enter the name of the segmentation. 9. On the canvas, click **Choose filter**. 10. From the dropdown list, select the **transaction.charge** event. 11. Click the **where** input that appeared on the canvas. 12. Click **$totalAmount**. If the attribute is not visible in the list, you can use the search field. 13. Choose the **More than** number operator. 14. Click the Filter icon icon until it changes to dictionary 15. From the list of available dictionaries, select the low outlier aggregate you create earlier. 16. Add the high outlier aggregate by repeating steps 5-9, but change the operator to **Less than**. 17. Save the segmentation. The end result should look more or less like this:
Example setup of segmentation that excludes outliers
Outliers
## Calculate the sum of transactions without outliers --- In this part, create a simple metric that calculates the sum of transactions for a given time range, without outliers in the transactions. 1. Go to **Decision Hub > Metrics > New Metric**.
You can find the detailed instructions on creating simple metrics [here](/docs/analytics/metrics/creating-simple-metrics).
2. Enter the name of the metric. 3. As the aggregator, select **Sum**. 10. From the dropdown list, select the **transaction.charge** event. 11. Click the **where** input that appeared on the canvas. 12. Click **$totalAmount**. If the attribute is not visible in the list, you can use the search field. 13. Choose the **More than** number operator. 14. Click the Filter icon icon until it changes to dictionary 15. From the list of available dictionaries, select the low outlier aggregate you create earlier. 16. Add the high outlier aggregate by repeating steps 5-9, but change the operator to **Less than**. 17. Save the metric.
Example definition of metric that excludes outliers
Metric without outliers
## Check the use case set up on the Synerise Demo workspace --- You can check the analyses created in this use case in our Synerise Demo workspace: - [Segmentation of customers who made purchase in last 30 days](https://app.synerise.com/analytics/segmentations/7b96db59-0d8d-4d5c-9b74-0107a5d866fa). - [Outlier high aggregate](https://app.synerise.com/analytics/aggregates/427c31e3-8038-3f0c-889d-4cd60e308c71) - [Outlier low aggregate](https://app.synerise.com/analytics/aggregates/9a6bd735-39fe-37de-a62a-e161bdb656b0) - [Segmentation of customers who are not outliers](https://app.synerise.com/analytics/segmentations/2a9a47a4-6202-4fd1-a9cc-ac59c703236a) - [Metric that counts the sum of transactions without outliers](https://app.synerise.com/analytics/metrics/223a8310-51a3-4ad1-a7b3-794f3d86dbeb). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Metrics](/docs/analytics/metrics) - [Segmentation](/docs/analytics/segmentations) # AI-Powered Personalized Brand Recommendations on Category Pages Recommending items is not the only approach that you can take. Another way to engage the customer is to provide brand recommendations, which placed on the category page. These recommendations are personalized, which means that for each customer the AI model will recommend brands that fit the customers' preferences. This method raises the customer conversion rates. In this example, we will create a recommendation that consists of 3 recommended brands at minimum and 5 at maximum, that will be placed on the category page. This is different from the [Promote a brand in recommendations](/use-cases/boost-brand) use case, in which the selected brands are promoted to appear in the recommendations more often, but the other brands are not completely excluded from the results. ## Prerequisites --- - The [items feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) must be provided. - The attribute recommendation type must be enabled in [AI Engine Configuration](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Optionally, you can provide [metadata catalog](/docs/ai-hub/recommendations-v2/item-feed-requirements). ## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 3. In the top left corner, enter the name of your recommendation. 4. In the **Type & Items feed** section, click **Define**. 5. From the **Items feed** dropdown menu, choose the provided feed. 6. Choose the **Attribute** recommendation type. 7. From the dropdown menu that appears at the bottom, choose your **Metadata catalog**. 8. Click **Apply**. 9. In the **Items** section, click **Define**. 10. Click **Add slot**. 11. Define the minimum and maximum number of brands that will be recommended to the user. In our example, it is from 3 (minimum) to 5 (maximum). 12. From the **Items attribute** dropdown menu, choose the `brand` attribute. 13. Click **Apply**. 14. In the top right corner, click **Save**. ## What's next --- You can display the recommendation on a category page by using [dynamic content](/docs/campaign/dynamiccontent). 1. Go to **Experience Hub > Dynamic content > New dynamic content**. 2. In the body of the dynamic content, use the recommendation insert.
Read more about how to use recommendation in inserts [here](/developers/inserts/recommendations-v2).
3. Add CSS and/or HTML to the dynamic content. 4. [Define the rest of the settings](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Check the use case set up on the Synerise Demo workspace --- You can check the [recommendation settings](https://app.synerise.com/ai-v2/recommendations/EHdHrqiT9tTE) in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Recommendations](/docs/ai-hub/recommendations-v2) # Optimize the sending time of a promotional code campaign A properly designed and executed mobile push campaign can help attract users' attention and increase the conversion rate. Sending a push notification at the optimal time, when the customer is active in the app, increases the chances that the customer will read the communication, use the promo code, and finalize the purchase. This use case describes the process of sending a mobile push with a promo code at the best time in the next seven days to customers who have added a product to their cart and have not completed the purchase process. ## Prerequisites --- - [Implement Synerise SDK in your mobile application](/developers/mobile-sdk). - Implement mobile push notifications in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - Implement transaction events using [API](https://hub.synerise.com/api-reference/data-management#tag/Events). - [Implement **Add to cart** event in your mobile application](/developers/mobile-sdk/event-tracking#product-added-to-cart). - [Enable time optimizer](/docs/settings/configuration/time-optimizer#enabling-time-optimizer). - [Create a Mobile mode](/docs/settings/configuration/time-optimizer#creating-modes) for Time Optimizer that will calculate the time when the customer is most active in the mobile application based on the events such as `screen.view` and `screen.interaction`. - [Create a mobile push template](/docs/campaign/Mobile/creating-mobile-push) with a promo code.
For promo codes, you can use our [Voucher pools](/docs/assets/code-pools), which allows you to assign a unique coupon from a specified pool for each customer.
## Create a workflow --- Create a workflow that sends a mobile push notification to customers on the day they are most likely to visit the site and who have previously added products to their shopping cart but have not completed the purchase process. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node of the workflow, add **Profile Event**. In the node settings: 1. In the **Choose event** field, select the `product.addToCart` event. 2. Confirm by clicking **Apply**. 4. Add an **Optimize Time** node. In the configuration of the node: 1. Select the **Mobile mode**. 2. Set the time period to analyze to **Next 7 days**. 3. Confirm by clicking **Apply**. 5. Add the **Profile Filter** node. In the configuration of the node: 1. In the **Choose filter** field, select the `transaction.charge` event. 2. Set the time period to the **last 7 days**. 3. Confirm by clicking **Apply**. 6. To the **Matched** path, add the **End** node. 7. To the **Not matched** path, add the **Send Mobile Push** node. In the node settings: 1. In the **Template type**, select the mobile push type according to your business needs. 2. Select proper **Push template** that you created earlier. 3. Confirm by clicking **Apply**. 8. Add the **End** node.
The final workflow configuration
The final workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the [workflow configuration](https://app.synerise.com/automations/automation-diagram/da91ac01-907d-4053-9382-bf2c5d33d39b) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`snr.ate.prediction`](/docs/assets/events/event-reference/predictions#snrateprediction) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1). ## Read more --- - [Configuring mobile notifications](/docs/campaign/Mobile/mobile_campaign) - [Mobile push](/docs/campaign/Mobile/creating-mobile-push) - [Time optimizer](/docs/settings/configuration/time-optimizer) - [Workflow](/docs/automation/creating-automation) # Optimizing Voucher Campaigns for First-Time Website Visitors Engaging new visitors effectively is crucial for driving conversions and building customer loyalty. Dynamic Content campaigns tailored for first-time visitors, such as offering a voucher, can create a strong initial impression and encourage users to complete their first transaction. However, when running such campaigns, there is a risk of missing new users who are not in the database at the time of campaign launch. This is where the **Include first time visitors in audience** option becomes invaluable, ensuring convenient targeting for these users. In this use case, we will describe a voucher campaign targeted at new users who have never made a transaction. By enabling the **Include first time visitors in audience** option in the campaign, we ensure that new users visiting the website are not overlooked. Even if they were not yet in the database at the moment the campaign started, they will still see the dynamic content and receive their voucher. This ensures that the campaign reaches its intended audience and no opportunities to engage first-time visitors are missed. ## Prerequisites --- [Implement a tracking code](/docs/settings/tool/tracking_codes). ## Process --- In this use case, you will go through the following steps: 1. [Create a voucher pool](/use-cases/voucher-for-new-users-optimization#create-a-voucher-pool). 3. [Create a dynamic content](/use-cases/voucher-for-new-users-optimization#create-a-dynamic-content) campaign, which displays the voucher code on the website. ## Create a voucher pool --- In this use case, the ID of this voucher pool will be used as a dynamic value during the message creation process, allowing discount codes to be assigned to each customer participating in this scenario. 1. Go to **Settings > [Voucher pools](https://app.synerise.com/spa/modules/vouchers/pools/)** and click **Add pool**. 2. In the voucher pool configuration form: 1. In the **Pool name** field, enter the name of the pool. 2. Select the dates for the **Emission start** and **Emission end** fields. 3. Complete the form by clicking **Apply**. **Result**: The pool is created. 3. Open the voucher pool by clicking its name on the voucher pool list. 4. Add codes to the voucher pool by clicking **Add record** button. You can also import records to the voucher pool. You can learn more about it in ["Importing vouchers"](/docs/assets/imports/importing-vouchers). ## Create a dynamic content --- Create a dynamic content campaign. This dynamic content will be displayed on your site with the unique voucher from the voucher pool. 1. Go to **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 1. Choose **Insert Object** type. 2. To select the recipients of the dynamic content, on the **Audience** tab, click **Define**. 3. Select **New Audience** and click **Define conditions**. In this step, you define the group of customers who have never bought anything from your shop. 1. Choose **Add condition** and find the `transaction.charge` event. 5. Set the time as **Lifetime**. 6. Click **Performed** and change it to **Not Performed**. 7. Click **Apply**.
The audience settings
The audience settings
9. Click **Advanced options** and choose the **Include first time visitors in audience** option. 10. Click **Apply**.
The audience settings
The audience settings
### Create the Dynamic Content template 3. In the **Content** section, specify the CSS selector where you want to insert your campaign. 4. Click **Create Message**. 5. In the code editor, create a dynamic content campaign based on your preferences and your own CSS styles. Remember about the predefined templates in Synerise, which you can use to simplify the process and avoid building everything from scratch. 2. Click **Inserts** and **Pools** and choose the voucher pool created in the [previous step](#create-a-voucher-pool).
Check also the voucher pools inserts documentation, based on different possible options: - [If you want to always display the same code for a customer,](/developers/inserts/insert-usage#retrieving-the-same-code-every-time) - [If you need to display barcodes.](/developers/inserts/insert-usage#barcodes)
4. Customize the design and content of your dynamic content campaign to suit your business needs. 3. Click **Use in communication** and then click **Apply**. ### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define** and specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. You can define the frequency of dynamic content to be displayed. You can also define the type of device you want to show your dynamic content. 3. Optionally, you can define the type of device you want to show your dynamic content on. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of [dynamic content campaign](https://app.synerise.com/campaigns/dynamic-content/create/1cb07032-a65c-44fe-9d09-1b3db3c811c0), directly in Synerise. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Voucher pools](/docs/assets/code-pools) # Send segmentations from HubSpot to Synerise This use case demonstrates the integration between Synerise and HubSpot. The integration allows you to send any data collected in HubSpot to Synerise. In this way, you can supplement the data you collect in Synerise with additional information you gather in HubSpot, unlocking the full potential of your data. In this use case, we will focus on creating an integration that imports customer's data from HubSpot into Synerise. ## Prerequisites --- - A HubSpot Pro account is required. - Your workspace must have API key permission for creating profiles: `API_BATCH_CLIENT_CREATE` ## Process --- 1. [Create an incoming integration](/use-cases/hubspot-integration#create-an-incoming-integration-for-hubspot-customer-data) for HubSpot clients data. 2. [Create a workflow](/use-cases/hubspot-integration#create-a-workflow-for-handling-incoming-data-from-hubspot) for handling incoming data from HubSpot. ## Create an incoming integration for HubSpot customer data --- In this part of the process, create incoming integrations in Synerise to which you will send customer's data from Hubspot. 1. Go to Automation Hub icon **Automation Hub > Incoming > New integration**. 2. On the pop-up, select **Without authentication**. 3. Enter the name of the webhook. 4. In the **Endpoint** section, click **Define**.
The URL field is already filled in with the endpoint to which the data from HubSpot will be sent.
5. Optionally, you can add an icon to this integration. 6. Confirm by clicking **Apply**.
The view of configuration of the Endpoint section
Configuration of the Endpoint section
7. In the **Incoming data** section, click **Define**. 8. Click **Retrieve data**. **There are two ways of retreving data:** 1. You can send direct cURL request.
Click to expand the instruction on sending cURL request

Right after you click the button, send a request to the endpoint in the Endpoint section with the sample of data that will be sent through HubSpot. The system waits for the incoming request for 1 minute and 30 seconds.

Replace the endpoint URL from the example below with the endpoint URL from step 4.

An example of cURL request:

curl --location 'https://api.synerise.com/automation-endpoint/endpoints/112ae31f-1a3e-4729-89ae-3b37eb7475f4/trigger' \ --header 'Content-Type: application/json' \ --data-raw '{ "associated-company": { "company-id": 43535242, "portal-id": 123413, "properties": { "address": { "value": "NYC 123 Main Street, US" }, "city": { "value": "NEW YORK" }, "cliente": { "value": "123413" }, "closedate": { "value": "1519039262794" }, "country": { "value": "USA" }, "createdate": { "value": "1519038967696" }, "associated-owner": { "email": "joedoetesthb@example.com", "first-name": "", "hubspot-user-id": 123454321, "last-name": "", "type": "PERSON" } , "canonical-vid": 11 } } }'
2. You can send Webhook from HubSpot to the endpoint you created [earlier in the process](/use-cases/hubspot-integration#create-an-incoming-integration-for-hubspot-customer-data).
Click to expand the instruction on sending webhook from Hubspot

Navigate to the Workflows in the HubSpot and create a new workflow that will send a webhook with the selected clients segments to Synerise.

HubSpot workflow configuration
HubSpot workflow configuration

  1. Define the workflow trigger, which in our case should be a segment of clients which data will be send to Synerise.
  2. Configure the webhook:
    1. Select POST method.
    2. Enter the webhook URL (the endpoint you created earlier in the process).
    3. Select the appropriate authentification type.
    4. Choose the properties you want to include in the webhook request body.
    Webhook configuration
    Webhook configuration
  3. Test your webhook to see the response and be able to select which fields to output for use later in your workflow.
  4. Save your configuration and finish the workflow.
9. When the endpoint receives data from the request, verify the list of variables. If the variables include those which are in the payload, click **Define**. If not, to re-send the request, click **Start again**, and wait for the results.
The view of collected variables from the request
Collected variables from the request
10. Click **Save & publish**. ## Create a workflow for handling incoming data from HubSpot --- As the final part of the process, create a workflow which captures data sent to the incoming integration you created in the previous part of the process and creates customer's profiles with the attributes defined earlier in the process. The workflow starts with the business event trigger (for customer's data) that is launched every time the data from HubSpot is sent to Synerise. In response to that, customer's profiles are created. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the business event node 3. As the trigger, select **Business Event**. In the configuration of the node, select the [incoming integration for customer's data](/use-cases/hubspot-integration#create-an-incoming-integration-for-hubspot-customer-data) you created as the first part of the process. 4. Confirm by clicking **Apply**.
Business Event node configuration
Business Event node configuration
### Define the Outgoing Integration node In the **Outgoing Integration** node, create a webhook that will create a customer's profile with the selected attributes sent from HubSpot. 5. From the dropdown list, select the **Outgoing Integration** node. 6. Click the node. In the configuration of the node: 1. Select the **Custom webhook**. 2. Enter the name of the webhook. 2. Select the **POST** method. 3. Enter the endpoint URL: `https://api.synerise.com/v4/clients/batch ` 4. Enter the following headers: - set the `content-type` header to `application/json` (default), - set the `api-version` header to `4.4` 5. Enter the request body. For the scenario described in this use case, the body is as follows:
[
         {

           "email": "{{request.body['associated-company'].properties['associated-owner'].email }}",
           "city": "{{request.body['associated-company'].properties.city.value}}",

           "attributes": {
             "closedDate":"{{request.body['associated-company'].properties.closedate.value}}",
             "createdate": "{{request.body['associated-company'].properties.createdate.value}}"
           },
           "tags": [
             "hubspot integration"
           ]
         }
       ]
This is just an example, you can create JSON according to your business needs. You can use any attribute that comes in the request from HubSpot. You can read more about it [here](/developers/inserts/automation#context).
6. In the **Authorization** section, select **By API key**. 6. From the dropdown list, select API key that has permissions to create customer's profile.
You can read more about API keys [here](/docs/settings/tool/api) and you can find more information about the endpoint and required API key permissions [here](https://hub.synerise.com/api-reference/data-management#tag/Profile-management/operation/CreateAClientInCrm).
6. Confirm by clicking **Apply**.
Final configuration of the Outgoing Integration node
Final configuration of the Outgoing Integration node
### Add final setting to your workflow --- 1. Add the **End** node. 2. Launch the workflow by clicking **Save&Run**.
Final view of the workflow configuration
Final view of the workflow configuration
## Generated events This use case generates approximately 5 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1), [`client.add`](/docs/assets/events/event-reference/profiles#clientadd) (~1). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of all steps described in the use case directly in Synerise Demo workspace: - [Incoming webhook configuration](https://app.synerise.com/automations/custom-blocks/integrations/incoming/edit/112ae31f-1a3e-4729-89ae-3b37eb7475f4) - [Workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/122f399a-b9c2-4925-b643-32928c0f4f10) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. # The most frequently clicked links in email campaigns Synerise allows you to create a report of the most frequently clicked links in an email campaign. To display links without UTM parameters, create an expression that formula sets the logic of displaying links. ## Prerequisites --- - Make sure the links in the email templates contain the [tracking parameters](/developers/inserts/email#adding-utm-and-tracking-parameters-to-links). ## Process --- In this use case, you will go through the following steps: 1. [Create a metric](/use-cases/report-with-neat-links#create-a-metric) that calculates the occurrences of the `newsletter.click` event. 2. [Create an expression](/use-cases/report-with-neat-links#create-an-expression) that will be available as a variable when including the `newsletter.click` event in analytics. 3. [Create a report](/use-cases/report-with-neat-links#create-a-report). ## Create a metric --- As the first part of the process, create a metric that calculates the occurrences of the `newsletter.click` event. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. Leave the metric kind at default (**Simple metric**). 4. As **Aggregator**, select **Count**. 5. Leave **Event** and **Occurrence type** at default. 6. From the **Choose event** dropdown list, select **newsletter.click**. 7. As the date range, select **Lifetime**. 8. Click **Save**.
Formula of the metric
Formula of the metric
## Create an expression --- In this part of the process, create an expression that will be available as a variable when including the `newsletter.click` event in analytics. The formula of the expression contains the regular expression for the URL parameter of the `newsletter.click` event. As a result, the expression removes UTM parameters from the link.
Expression that returns links without UTM parameters
1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression. 3. Set the **Expression for** option to **Event**. 4. From the dropdown list, select **newsletter.click**. 5. Build the formula of the expression: 1. On the dashboard, click **Select**. 2. From the dropdown list, select **Function > Regexp**. 3. In the left **Select** field, select **Event attribute**. 4. From the dropdown list, select **url**. 5. In the right dropdown list, select **Constant**. 6. Enter the following formula: `(?<=www\.|https:\/\/)[^\?\s]+(?=\?)?`
Behavioral Data Hub expression formula using Regexp to extract clean URLs from newsletter click events
Formula of the expression
6. Save the expression. ## Create a report --- In this part of the process, create a report based on the metric and expression you prepared before. The result of the report is a table with the top/last links clicked in email campaigns and the number of clicks for each link. 1. Go to Decision Hub icon **Decision Hub > Reports > New report**. 2. Enter the name of the report. 3. Select the metric you created in this [part](/use-cases/report-with-neat-links#create-a-metric) of the process. 4. From the **Range** dropdown list, select the number of top (the most frequently clicked) or last (the least frequently clicked) results to be shown in the preview of the report. 5. In the **Dimension** section, select the expression you created in [this part](/use-cases/report-with-neat-links#create-an-expression) of the process. 6. In the date range, select the time that will be analyzed.
Configuration of the report
Configuration of the report
7. Save the report. 8. Click **Preview** to see the results.
Report preview
Report presents the top 3 clicked links and the number of clicks in the links
## Check the use case set up on the Synerise Demo workspace --- You can check the analyses created in this use case in our Synerise Demo workspace: - [Metric that returns the number of clicked links in emails](https://app.synerise.com/analytics/metrics/61110a06-af76-4227-a6bf-d7ab5238a176). - [Expression that returns a neat link](https://app.synerise.com/analytics/expressions/8a3b2f05-4972-47ef-a03c-04670a55bbb8). - [Report with a heatmap of links clicked in an email](https://app.synerise.com/analytics/reports/f5a529c4-2d37-49f2-bfbb-2f4dc0c1e232). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) # Attribute-based mobile push campaign You can customize mobile push messages to display appropriate content based on your customer's attributes. Personalize your outreach by tailoring messages to your audience's gender preferences and understand and cater to the unique needs and interests of both male and female consumers for more successful marketing and sales strategies. This use case describes how to create a mobile push notification for customers based on their gender with the use of attribute stored in the customer's profile. ## Prerequisites --- - Integrate Synerise [mobile SDK](/developers/mobile-sdk) in your mobile application. - Implement mobile pushes in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - Store gender attribute on customer's profile
In our example, a customer can have the attribute `user_gender`, which stores one of values: - woman - man
## Create push notification --- In this part of the process, you will create a [simple mobile push](/docs/campaign/Mobile/creating-mobile-push) notification that displays content based on the assigned gender attribute value. 1. Go to Experience Hub icon **Experience Hub > Mobile Push > Create new** 2. Enter the name of the push notification (it is only visible on the list of notifications). 3. As the mobile notification type, select **Simple push**. 4. Specify **Device type** according to you business needs: 1. Select one of the tabs: **All**, **Android** or **iOS**. 2. Click **Apply**. 5. Define your **Audience** according to you business needs. ### Define Content --- 1. In the **Content** section, click **Define**. 2. Click **Create message**. 3. Select the **Drag&drop builder**. 4. Prepare the message which your customer will get: 1. In the **Title** field, enter the text that will display in the header of the notification. You can use up to 160 characters. 2. In the **Message** field, enter the text that will display in the body of the notification. Use the below code, which will select the appropriate message depending on the user's attribute:
<!-- Content for users with woman attribute value --> 
               {% if customer.user_gender == "woman" %}
               Check new woman collection
               <!-- Content for users with man attribute value -->
               {% elif customer.user_gender == "man" %} 
               Check new man collection
               <!-- Content for users without such attribute -->
               {% else %}
               Check new collection
               {% endif %}
3. Optionally, you can define settings in OS tabs. Select the OS for which your notification is dedicated, if you create a template for both OS, fill out the settings in both tabs: **iOS** and **Android**. 4. In the **Action type** section, define what happens when the customer clicks the notification, choose **Deep linking** or **Open URL**. Use the same code as in the **Message** field:
<!-- Content for users with woman attribute value --> 
               {% if customer.user_gender == "woman" %}
               Check new woman collection
               <!-- Content for users with man attribute value -->
               {% elif customer.user_gender == "man" %} 
               Check new man collection
               <!-- Content for users without such attribute -->
               {% else %}
               Check new collection
               {% endif %}
5. If your template is ready, click **Next**.
The view of the mobile push notification configuration
Mbile push notification configuration
5. Click **Apply**. ### Schedule the notification and additional parameters --- In this part of the process, you will define when the push notification will be sent. 1. In the **Schedule** section, click **Define**. 1. Choose **Display time** according to your business needs. 2. Additionally, you can enable **Silence Hours**. 2. Click **Apply**. 3. Optionally, in the **Additional parameters** section, you can [add up to 10 parameters which will be added to every event generated by this communication](/docs/campaign/Mobile/creating-mobile-push#define-additional-parameters). 4. Click **Send**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [mobile push configuration](https://app.synerise.com/campaigns/create/e6472fed-40d9-4073-8de2-3aab3c530a23) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1). ## Read more --- - [Jinjava onserts](/developers/inserts) - [Mobile campaigns](/docs/campaign/Mobile) # Gender-based promotion Gender marketing is a sales strategy used to reach out to women and men consumers by understanding their tastes, preferences and consumption trends. It involves the use of market segmentation and focuses on building specific strategies to reach out to female or male consumers, incorporating consumers' gender-specific needs into communication. You can use gender-based promotions to advertise and sell your goods and services successfully. This use case describes how to create a promotion for customers based on their gender with the use of segmentation. ## Prerequisites --- - Implement promotions in your [mobile application](/developers/mobile-sdk/loyalty), website or through [API](https://hub.synerise.com/api-reference/authorization#tag/Authorization/operation/profileLogin) - [Implement transactional events](/developers/web/methods-reference#tracking-transactions). - [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog). ## Process --- - [Prepare two segmentations](/use-cases/gender-based-promotion#prepare-two-segmentations) of customers based on the category of the products they already bought. - [Create two promotions](/use-cases/gender-based-promotion#create-two-promotions) based on gender. ## Prepare two segmentations --- In this part of the process create two segmentations that will group customers based on the category of purchased items.
In this use case, we will assign gender based on the category of products they purchase. These are just example conditions of the segmentation. These conditions may be completely different depending on your business goals and do not have to be based on this event.
1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. From the **Choose filter** dropdown list, select the `product.buy` event. 4. From the **Choose parameter** dropdown list, select **category**. 5. From the dropdown list that appears, select the **Contain** operator. 6. In the next field enter the phrase "-female-" or "-male-".
The construction of this condition depends on the implementation of transactional events and may vary.
7. To determine the time range from which the data will be analyzed, click the calendar icon and choose the **Lifetime** time range. Confirm your choice with the Apply button. 8. Click **Save**. 9. To create the second segmentation repeat the process from steps 1 to 8. **Result**: The segmentations are saved and can be used as an audience for promotions.
An example of a segmentation of female customers
An example of a segmentation of female customers
An example of a segmentation of male customers
An example of a segmentation of male customers
## Create two promotions --- 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Enter a name for the promotion. 3. According to your business needs select one of the scopes: - **For selected items** - **For entire basket** 4. In the **Audience** section, choose **Segments** and select one of segmentations created in [this step](/use-cases/gender-based-promotion#prepare-two-segmentations). 5. In the **Content** section: 1. Define the name, description, and image of the promotion. 2. Define the rest of the settings according to your needs. 3. Confirm the settings by clicking **Apply**.
AI Hub promotion Content section with name, description, and image fields for a gender-based promotion
Example of promotion content
5. Define the **Type and limits** section according to your business needs.
Example of Type and limits settings
Example of Type and limits settings
6. In the **Schedule** section, define the promotion distribution period according to your business needs. 7. In the **Stores** section, according to you business needs you can specify stores where the promotion is available.
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
8. In the **Items** section, specify the catalog item to be discounted: 1. In the **Source catalog** field, select an item catalog to select the promotional items from. 2. In the **Include items** section, pick one according to your business needs. 11. To apply configuration and run the promotion, click **Publish**. 12. To create second promotion repeat all the steps. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the segmentations directly in Synerise demo workspace: - [a segmentation of female customers](https://app.synerise.com/analytics/segmentations/e4046377-e385-42ff-88c0-92fa14740c61), - [a segmentation of male customers](https://app.synerise.com/analytics/segmentations/4040a08c-f30a-4709-9ab2-610701e61aaf). Here you can find the configuration of promotions, available on Synerise demo workspace: - [for female customers](https://app.synerise.com/campaigns/promotions/ef6a9396-70a9-4d8f-b1d0-fde456e49a9d), - [for male customers](https://app.synerise.com/campaigns/promotions/0a79c12c-eaa7-4a70-9e35-aa055c0b72db). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1). ## Read more --- - [Promotions](/docs/ai-hub/promotions) - [Segmentations](/docs/analytics/segmentations) # Analyze customer’s preferred item category You can use expressions to examine the most frequently visited category of items for every customer. This expression can be used later in an analytical dashboard to monitor the results for the expression. ## Prerequisites --- - Implement [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. ## Process --- In this use case, you will go through the following steps: 1. [Create aggregates](/use-cases/most-visited-category#create-aggregates) that count the number of page visits of items in two specific categories - each aggregate calculates page visits to one category. 2. [Create an expression](/use-cases/most-visited-category#create-an-expression) that returns values: `women`, `men`, and `unknown` depending on the number of page visits in the categories selected in the aggregates. 3. [Create an analytical dashboard](/use-cases/most-visited-category#create-an-analytical-dashboard). ## Create aggregates --- In this part of the process, create two aggregates that count the number of page visits of items in two specific categories - each aggregate calculates page visits to one category. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Set **Analyze profiles by** to **Count**. 3. Click **Choose event**. 4. From the dropdown list, select **page.visit**. 5. Click **+ where**. 6. Find the **category** parameter. 7. From the logical operator dropdown list, select **Equal**. 8. In the text field, enter `women`.
Modify this name of the parameter according to the actual values of the category parameter you send to Synerise.
9. As the time range, select **Lifetime**. 10. Click **Save**.
The construction of the first aggregate
The construction of the first aggregate
11. Repeat steps from 1 to 11. In step 8, replace `women` with `men`.
The construction of the second aggregate
The construction of the second aggregate
## Create an expression --- In this part of the process, create an expression that returns values: `women`, `men`, and `unknown` depending on the number of page visits in the categories selected in the aggregates.
Expression that returns the most frequently visited item category
1. Go to **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 2. Leave the selection of the **Expression for** option at default (**Attribute**). 3. Create the following formula:
The construction of the expression
The construction of the expression
Explanation of the expression logic

The expression creates the following logic:

  • If the number of page visits in the `women` category is higher, return `women`.
  • If the above condition is not met:
    • If the number of page visits in the `men` category is higher, return `men`.
    • If the above condition is not met, return `unknown`.
4. To complete the expression, click **Save**. 5. To check the result of the expression for individual customers, click the **Preview tab**. In the search box, enter the email of a customer. ## Create an analytical dashboard --- You can add this expression to the analytical dashboard and monitor the result of the expression for individual customers. 1. Go to **Decision Hub > Dashboards > New dashboard**. 2. Click the Expression icon icon on the dashboard. 2. Double-click the expression added to the dashboard. 3. On the right side, from the dropdown list, select the expression you created. 5. Click the Dynamic key icon icon. 6. Enter the ID of a customer. 7. Click **Apply**.
The result of the expression in the analytical dashboard for an example customer
The result of the expression in the analytical dashboard for an example customer
## Check the use case set up on the Synerise Demo workspace --- Check the configuration of analyses created in this expressions on Synerise Demo workspace: - [Aggregate that returns the number of page visits to women's category](https://app.synerise.com/analytics/aggregates/150a51cd-c175-3b33-94cb-c2e778330576). - [Aggregate that returns the number of page visits to men's category](https://app.synerise.com/analytics/aggregates/f23889e9-b915-3c40-b97f-2662660d9c0a). - [Expression that returns preferred item category](https://app.synerise.com/analytics/expressions/a9f8f10b-f25c-4ecd-88cf-96e2068dc6e3). - [Analytical dashboard that uses the expression](https://app.synerise.com/analytics/dashboards/839d3cea-4da9-4927-b343-be1cc59df31b?clientId=11111111111). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) # Renewable quest There are several ways to make a loyalty program an engaging experience for users. One way is to include personalized and frequently updated content, along with special promotions and attractive rewards. Another method can include gamification, which we will explore more deeply in this use case. In Synerise, you can create gamification scenarios based on various user actions collected within the profile history like transactions, consents, form submissions, watching videos, rating products, and more. However, scenarios based on transaction events are the most popular. These scenarios involve completing quests that lead to rewards such as promotions, free products, extra loyalty points, or access to premium content.
Cover photo
Cover photo for renewable quest use case
In this use case, we will guide you through the process of building a renewable quest. This quest allows customers to earn 1000 loyalty points by purchasing 10 products from a specific category within a set timeframe. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). Make sure that you implement **category** parameter in the transaction events and **quantity** of products. - Integrate mechanism for awarding loyalty points. Find more in the [Loyalty programs basics](/use-cases/loyalty-programs-basics) use case. ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Create a quest.renewableComplete event](/use-cases/renewable-quest#create-a-questrenewablecomplete-event) 2. [Create the aggregate that returns the timestamp of the last finished quest](/use-cases/renewable-quest#create-an-aggregate-that-returns-the-timestamp-of-the-last-finished-quest) 3. [Create the aggregate with the number of product purchased](/use-cases/renewable-quest#create-an-aggregate-that-returns-the-number-of-products-purchased-from-the-defined-product-category) 4. [Create an expression with the number of products required to complete the quest](/use-cases/renewable-quest#create-an-expression-with-the-number-of-products-required-to-complete-the-quest) 5. [Create an expression that returns the number of products purchased](/use-cases/renewable-quest#create-an-expression-that-returns-the-number-of-products-purchased) 6. [Create an expression checking the conditions for completing the quest](/use-cases/renewable-quest#create-an-expression-that-determines-the-number-of-products-required-to-complete-the-quest) 7. [Create a workflow](/use-cases/renewable-quest#create-a-workflow) which adds points to the customer's account 8. [Create a document](/use-cases/renewable-quest#create-a-document) with all necessary data conected with this loyalty scenario ## Create a quest.renewableComplete event --- In this part of the process, create a **quest.renewableComplete** event, which will be later generated in the workflow when the customer completes the quest. In addition, this event must contain a parameter that contains the name of the completed quest to facilitate identification of the quest. In our case, we use the `gameName` parameter. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Events > Add event**. 2. In the **Name** field, enter `quest.renewableComplete`. In the API and SDK, the name parameter is usually called `action` or `action name`. 3. Optionally, define a human-friendly display name that will be shown in **Data Modeling Hub** and **Decision Hub**. 4. Optionally, in the **Description** field, enter the description of the event. 5. Enable the **Make this event available to anonymous profiles without JWT** toggle. 6. Click **Apply**. 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 `gameName`. 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. In **Property type** and **Link** fields, leave the default `string` and `-`. 13. To complete the process, click **Save**. ## Create an aggregate that returns the timestamp of the last finished quest --- In this step, we create an aggregate that provides the timestamp of the most recently completed quest. The timeframe for the quest begins on the day it starts and continues until the expected completion time. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate as `[UC] Timestamp of last finished quest`. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown, select the `questRenewableComplete` event, that you created in the [previous](/use-cases/renewable-quest#create-a-questrenewablecomplete-event) step. 5. As the event parameter, choose **TIMESTAMP**. 6. From the **Choose parameter** dropdown list, select the **gameName** parameter. 7. From the **Choose operator** dropdown list, select **Equal**. 8. Enter the name of the quest. In our case, it’s `Towel's quest`. 7. Set the period for the aggregate to **Custom** and specify the desired data range. In this scenario, we will select the following time range `02.06.2023 - 30.05.2024`. 8. To save the aggregate, click **Save**.
Decision Hub Last aggregate returning the TIMESTAMP of the last quest.renewableComplete event for Towel's quest in a custom date range
Configuration of the aggregate
## Create an aggregate that returns the number of products purchased from the defined product category --- In this part of the process, create an aggregate that will calculate the number of products that were purchased from the `Paper_towels` category after the last quest was completed. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate as `[UC]Number of products purchased after last finished quest`. 3. Click **Analyze profiles by** and select **Sum**. 4. From the **Choose event** dropdown, select the **product.buy** event. 5. As the event parameter, choose **$quantity**. 5. Click the **+ where** button and from the **Choose parameter** dropdown menu, choose **category** parameter. 6. From the **Choose operator** dropdown menu, select **Equal**. 7. Type the name of the product category - `Paper_towels`. 8. Click the **+ where** button and from the **Choose parameter** dropdown menu, choose **TIMESTAMP** parameter. 9. From the **Choose operator** dropdown menu, select **More than** number operator. 10. Click the Choose value icon (Choose value icon). 11. From the **Choose value** dropdown list, select the aggregate you created [earlier in the process](/use-cases/renewable-quest#create-an-aggregate-that-returns-the-timestamp-of-the-last-finished-quest). 12. Set the period for the aggregate to **Lifetime**. 13. Save the aggregate.
Decision Hub Sum aggregate counting the total quantity of product.buy events from the Paper_towels category since the last completed quest
Configuration of the aggregate
## Create an expression with the number of products required to complete the quest --- In this step, create an expression that determines the number of products needed to complete the quest. Based on the assumptions of this use case, the assumed requirement for purchase is 10 units. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression as `[UC]Target amount`. 3. Leave the **Expression** option at default **(Attribute)**. 4. Click the **Select** button. 5. Choose **# Constant**. 6. Open the settings of Constant value by clicking `0`. 7. In the field below, type `10` 8. Click **Save**.
The graphic shows the expressions settings
Final configuration of the expression
## Create an expression that returns the number of products purchased --- In this part of the process, create an expression that returns the number of products purchased from the `Paper_towels` category. This expression uses the [aggregate](/use-cases/renewable-quest#create-an-aggregate-that-returns-the-number-of-products-purchased-from-the-defined-product-category) and [expression](/use-cases/renewable-quest#create-an-expression-with-the-number-of-products-required-to-complete-the-quest) created in the previous steps.
Explanation of the expression logic

The logic in the expression compares the number of products purchased after the last finished quest to the target amount, which is 10 units needed to complete the quest. There are two possible scenarios:

  • If the number of products purchased from the "Paper_towels" category is equal to or greater than the target (10), the expression will return 10, indicating that the quest has been successfully completed.
  • If the number of products purchased from the "Paper_towels" category is less than the target, the expression will return the actual number of products purchased.

If the number of products purchased in a single transaction exceeds the target of 10, the surplus is not carried over to the next quest.

1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression as `[UC]Products purchased` 3. Leave the **Expression** option at default (**Attribute**). 4. Build the following formula of the expression:
Final configuration of the expression
Final configuration of the expression
5. Save the expression. ## Create an expression that determines the number of products required to complete the quest --- In this step, create an expression that checks if the number of products bought is equal to or greater than the target amount, indicating whether the customer has met all the conditions to finish the quest.
Explanation of the expression logic

The expression will produce one of two results based on certain conditions:

  • If the number of products purchased from the "Paper_towels" category is 10 or greater, the expression will return true.
  • If the number of products purchased from the "Paper_towels" category is less than 10, the expression will return false.
1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression as `[UC]Comparing amount of products bought` 3. Leave the **Expression** option at default (**Attribute**). 5. Build the following formula of the expression:
Final configurationj of the expression
Final configurationj of the expression
6. Save the expression. ## Create a workflow --- In this part of the process, create a workflow to determine if the customer has successfully completed the quest. The condition that needs to be met is the purchase of 10 products from the "Paper_towels" category. If the condition is met, two events will be generated for the customer: - An event `quest.renewableComplete` will be generated to inform about the quest completion. - An event `points.upcharge` will be generated to assign 1000 loyalty points to the customer. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow as `[UC]Renewable Quest`. ### Define the Profile Event node --- The workflow will be triggered by the `product.buy` when customers will purchase any product from the `Paper_towels` category. 1. As the first node of the workflow, add **Profile Event**. 1. From the **Choose event** dropdown menu, choose the `product.buy` event, 2. As the parameter, choose **category**, 3. As the operator, choose **Equal**, 4. As the value of the parameter, add `Paper_towels`, 2. Confirm by clicking **Apply**.
The graphic shows profile filter settings
The configuration of the Profile Event node
### Define the delay --- We need to set up a short delay of 10 seconds to ensure that events have been calculated before proceeding to the next condition in the workflow. 1. Add the **Deley** node, 1. Enter the name of the delay as `10s`, 2. Set the **Delay** number as `10`, 3. In **Unit** section choose **Second**, 2. Confirm by clicking **Apply**.
The Delay node configuration
The Delay node configuration
### Define the Profile Filter node --- In this part of the process, we will check if the customer has completed the quest. We will use the previously created expression that determines whether the customer has met all the conditions to finish the quest. If the quest has been completed, the next step in the workflow will generate the `quest.renewableComplete` event. Otherwise, the process ends. 1. Add the **Profile Filter** node. In the node settings: 1. Click **Choose event** and select **expression** created [earlier in the process](/use-cases/renewable-quest#create-an-expression-that-determines-the-number-of-products-required-to-complete-the-quest), 2. From the **operator** drop-down, choose **Is true (Boolean)**, 2. Confirm by clicking **Apply**.
Automation Hub Profile Filter node checking quest completion expression is true
The Profile Filter node configuration
### Define the Generate Event node --- In this part of the process the `quest.renewableComplete` event is generated, which informs us about the completion of the quest. 1. To the **matched** path, add the **Generate Event** node. 2. In the configuration of the node: 1. Enter the **Event name**. In our case, we are using `quest.renewableComplete` event. 2. In the **Body** section, use the following Jinjava and modify it to your needs:
{
                   "gameName": "Towel's quest"
               }
2. Confirm by clicking **Apply**.
An example of a generated quest.renewableComplete event
Configuration of the Generate Event node with a quest.renewableComplete event
### Define the secound Generate Event node --- In this part of the process, a `points.upcharge` event will be generated, assigning 1000 loyalty points to customers who have finished the quest. 1. Add the **Generate Event** node. 2. In the configuration of the node: 1. Enter the **Event name**. In our case, we are using `points.upcharge` event. 2. In the **Body** section, use the following Jinjava and modify it to your needs:
{
                   "gameName": "Towel's quest",
                   "points": 1000
               }
2. Confirm by clicking **Apply**.
The graphic shows generate event settings
Configuration of the points.upcharge event
### Add the finishing node and set capping 1. Add the **End** node. 2. In the upper right corner, click **Set Capping** and define the limit of workflows a profile can start in a specific time range. 3. In the upper right corner, click **Save & Run**.
Automation Hub workflow for a renewable quest loyalty campaign
Configuration of the workflow
## Create a document --- In the final step of this process, you will create a document that will display in a selected channel (for example, a mobile application) the results of the expressions you created before, showing your customers how far are they in their quest. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Documents > Add document**. 2. Enter the name for your document. To create a document, you have to set up three steps of settings: audience, configuration, and schedule. ### Set up Audience --- In the audience section, determine who will be the recipient of the document. 2. Click **Define**, 3. Select **Everyone**, 4. Save by clicking **Apply**.
Audience configuration in Document settings
Audience configuration in Document settings
### Set up the Configuration section --- In the configuration section, determine the content of the document. 1. In the **Slug** field, enter the slug of the document, we recommend using the following name convention: this-is-slug-name. In our example enter the name of the event as `towels`. 2. In the **Priority** field, use a number to define the document priority. The order of documents is defined by the priority value (1 is the highest, 100 is the lowest). In our example it will be `1`. 3. From the **Type** dropdown list, select a document type. Document type defines how the document is validated by your mobile application. To create a new type, from the dropdown list, click Add type. In our example it will be `StampCampaign`. 4. In the **Body** field, add the content of the promotion in the JSON format. Body content will depend on the scenario of loyalty program. In our case, we display the results of the expressions created in previous parts of the process, a description, image, and some more information about the conditions of completing quest.
{
            "current_status": " {% expression %} 1c92f585-3342-4fbd-af05-93f53ebe5882 {% endexpression %} ",
            "description": "Buy 10 product from towels category and get 1000 loyalty points",
            "format": "stamps",
            "image": "https://ecommerce.pl/media/catalog/product/towels/1/image/9df78eab33525d08d6e5fb8d27136e95/94989/regina-wish-recznik-papierowy-bialy-2-rolki-reczniki-papierowe-artykuly-higieniczne_0.jpg",
            "name": "Towels",
            "prize": "1000",
            "prizeType": "points",
            "target": "{% expression %} 930673cb-28d2-4a81-9100-7306bdfcce86 {% endexpression %}",
            "visibility": "1"
    }
In the `current_status` and `target` parameters, we are referring to the expressions created earlier in the process. The `current_status` expression returns the actual number of products bought by the client, while the `target` expression determines the number of products needed to complete the quest. 5. Save by clicking **Apply**.
Document settings configuration
Document settings configuration
### Set up Schedule In the schedule section, set the document activation date. 1. Define the period as **Run Imediately** 2. Save by clicking **Apply**.
The configuration of document schedule
The configuration of document schedule
To activate immediately or at a scheduled date, click the **Activate** button.
The graphic shows document settings
The graphic shows document settings
## What’s next --- For a screen view to be visible in a mobile application, you must fetch it using the appropriate SDK method for: - [Android](/developers/mobile-sdk/method-reference/android/content), - [iOS](/developers/mobile-sdk/method-reference/ios/content), - [React Native](/developers/mobile-sdk/method-reference/react-native/content). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of every element of this process directly in Synerise [Demo workspace](https://demo.synerise.com/request): - [Aggregates with timestamp of last finished quest](https://app.synerise.com/analytics-v2/aggregates/f5c5f07e-0d37-3f9c-ac3a-7bb50ab0d8a9) - [Aggregates with number of products purchased after last finished quest](https://app.synerise.com/analytics/aggregates/8255900e-01e7-3ecd-9b31-21700ca7a8cf) - [Expressions with the number of products required to complete the quest](https://app.synerise.com/analytics/expressions/930673cb-28d2-4a81-9100-7306bdfcce86) - [Expressions that returns the number of products purchased](https://app.synerise.com/analytics/expressions/1c92f585-3342-4fbd-af05-93f53ebe5882) - [Expressions checking the conditions for completing the quest](https://app.synerise.com/analytics/expressions/4ad6113a-3f18-44f0-8a50-cf40cc57e895) - [Documents](https://app.synerise.com/assets/documents/33da9fe3-c317-46e5-93fb-cae73c2f889a) - [Workflow](https://app.synerise.com/automations/automation-diagram/6e9a80ef-065b-4bd6-a13a-2601e40b4111) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~4), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `quest.renewableComplete` (~1), `points.upcharge` (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) - [Documents](/docs/assets/documents/introduction-to-documents) # Send customers from Synerise to Custom Audience in Facebook Synerise enables you to collect data from various sources and create advanced analyses based on this data. In short, Synerise enables you to gain insights from your data as well as create segments. The power of Synerise is that not only it allows you to gather, process and analyze data but also it lets you reuse it in the external sources. In this use case, you will use the native Facebook integration in Automation Hub to send a group of customers who were active in the web and mobile channels during last 30 days to Custom Audience. ## Prerequisites --- - [Generate the system user access token in Facebook](https://developers.facebook.com/docs/audience-network/optimization/report-api/system-user/); as the `scope` value, select `ads_management`. - [Create Custom Audience in Facebook](https://developers.facebook.com/docs/marketing-api/reference/custom-audience/). ## Process --- To send Custom Audience, follow the steps listed below in the following order: 1. [Create a segmentation of customers](/use-cases/send-custom-audience-webhook#create-a-segmentation) who are the most active in the web and mobile channels during last 30 days. 2. [Create a workflow](/use-cases/send-custom-audience-webhook#create-a-workflow) in which you will send the group of customers to Custom Audience in Facebook. ## Create a segmentation --- As the first part of the process, create a group of customers who were active in the mobile and web channels during last 30 days. The segmentation includes only customers with an email address. In the further part of the process, this group will be exported to Custom Audience in Facebook.
You must always narrow down the segmentation to customers who have an email address or a phone number.
1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful name of the segmentation. 3. Click **Choose filter**. 5. From the dropdown list, select the **session.start** event. 4. As the time range, set **Last 30 days**. 6. Click **Choose filter**. 7. From the dropdown list, select the **screen.view** event. 8. As the time range, set **Last 30 days**. 9. Click **Choose filter**. 10. From the dropdown list, select the **Email address** attribute. 11. As the logical operator, by clicking Boolean icon icon, select **Is true**. 12. Connect these conditions by the **And** operator. 13. Click **Save**.
The configuration of the segmentation
The configuration of the segmentation
## Create a workflow --- In this part of the process, create a workflow for the group of customers you created in the [previous step](/use-cases/send-custom-audience-webhook#create-a-segmentation). This workflow sends the group of customers to Custom Audience in Facebook. ### Choose the segmentation of customers 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. On the dashboard, click the plus icon. 3. From the dropdown list, select **Audience**. **Results**: The **Audience** node is added to the dashboard. 4. Double-click the node. **Result**: A pop-up appears. 5. Leave the **Run trigger** option at default. 6. Click the **Select segment** button. 7. From the dropdown list, select the [segmentation you created in the previous step](/use-cases/send-custom-audience-webhook#create-a-segmentation). **Result**:
The Audience node
The configuration of the Audience node
7. Click **Apply**. ### Configure the Facebook integration 1. Click the plus button on the **Audience** node. 2. From the dropdown list, select the **Add Profiles to Custom Audience** node. 2. Double-click the node. 2. From the **Select connection** dropdown list, select an existing connection which allows you to authorize in Facebook Ad. If you haven't established a connection yet: 1. At the top of the dropdown list, click **Add connection**. 2. In the **Access token** field, paste the token generated as a part of [prerequisites](/use-cases/send-custom-audience-webhook#prerequisites). 3. Click **Next**. 4. In the **Connection name**, enter the name of the connection (it will be only visible on the list of connections).
The connection can be re-used to any custom audience created in the Facebook Ad Account related to the token generated as a part of [prerequisites](/use-cases/send-custom-audience-webhook#prerequisites).
3. In the **API version** field, enter the Facebook API version according to the [Facebook documentation](https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences/). 5. From the **Identified type** dropdown list, select **Email**. 6. In the **Identifier source** field, enter `{{ client.email }}`.
You can read more about Jinjava tags in Automation Hub [here](/developers/inserts/automation).
4. In the **Audience ID** field, enter the ID of the Custom Audience to which you want to send your group of customers. **Result**:
The configuration of the Add Profiles to Custom Audience node
The configuration of the Add Profiles to Custom Audience node
6. Confirm by clicking **Apply**. ### Add the End node 1. Click the plus icon on the **Add Profiles to Custom Audience** node. 2. From the dropdown list, select **End**. 3. In the upper right corner, click **Save & Run**.
Automation Hub workflow for adding customer profiles to a Facebook Custom Audience via webhook
The final configuration of the workflow
4. Wait a few minutes for the response of the webhook. **Result**: An **automation** event is saved to the profiles of the customers. Then, go Facebook, to **Facebook Manager > Audiences** to check your Custom Audience.
A webhook response with 200 status on a profile of a test customer
A webhook response with the OK status (200) on a customer's profile
## What's next --- You can start creating personalized ads to your customers in Facebook. You can see your custom audience in **Facebook Manager > Audiences**. ## Check the use case set up on the Synerise Demo workspace --- You can also check the [segmentation configuration](https://app.synerise.com/analytics/segmentations/6474998d-d04a-40cd-866c-c0f484d9eae1) and [workflow configuration](https://app.synerise.com/automations/automation-diagram/36e343c7-9d80-4600-b2c4-8f92cab368ed) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `facebook.addToCustomAudience` (~1). ## Read more --- - [Automation inserts](/developers/inserts/automation) - [Automation Hub](/docs/automation) - [Creating segmentations](/docs/analytics/segmentations/creating-segmentations) - [Add Profiles to Custom Audience node](/docs/automation/integration/facebook/send-custom-audience) # Promotion with basket trigger Basket trigger promotion applies to the entire contents of a shopper's basket and the customer is entitled to the promotion when the total value of the shopping cart exceeds a designated range. The decision to frame a promotion within a specific range of purchase values is strategic and purposeful. By setting a minimum threshold for eligibility, customers are motivated to explore additional products or services to reach the lower end of the range, often discovering new items of interest. On the other hand, those who are considering higher-value purchases find the incentive to maximize their savings by striving for the upper end of the range. This enables businesses to harmonize the promotion with their broader pricing strategy. In this use case, if a customer's total basket value is between 100-500 PLN, they become eligible for a generous 10% discount on their overall purchase. ## Prerequisites --- - POS must be integrated with Synerise promotion engine to calculate discounted values of basket items. - Apply [the Process basket method](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Promotions%3A%20basket%20%26%20POS%20integration/operation/processSale_POST) which sends information (basket value and purchased items) about the transaction made at the checkout to Synerise (in the case of applying promotions, also in offline stores). This way, we can determine whether the transaction qualifies for being included in this specific promotion. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Implement promotions with [SDK mobile in your mobile application](/developers/mobile-sdk/loyalty) or through [API](https://hub.synerise.com/api-reference/authorization#tag/Authorization/operation/profileLogin) in any channel.
This use case only works when Synerise is the [main source of promotion calculation](/docs/ai-hub/promotions/introduction-to-promotions#promotion-implementation-variants).
## Creating the promotion --- 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For entire cart** option. 3. In the **Audience** section, select a group of customers for whom the promotion will be activated. Confirm your selection, by clicking **Apply**. 4. In the **Content** section, define the name, description, and an image of the promotion. Confirm the settings by clicking **Apply**. 5. In **Type & limits** section: 1. As a discount type, choose **Percentage**. 2. In the **Value** field, enter the amount of discount, in our case it's `10`. 4. Define the minimum and maximum basket value trigger to apply promotion. In our case it will be `100` and `500`. 5. Apply changes.
The view of the configuration of the promotion
Configuration of the promotion
6. In the **Schedule** section, define the distribution period. 7. Optionally, in the **Stores** section, select the offline stores where the profiles can redeem the promotion. 8. In the **Items** section, select the catalog and items to be included in the promotion. 8. To apply all changes and run the promotion, click **Publish**.
As the next step, you can create a [document](/docs/assets/documents) within Synerise that includes this promotion, so that it [becomes visible](/docs/assets/documents/introduction-to-documents#exemplary-usages), for example, in the mobile application. Thanks to this, you can enhance the promotion's reach and effectiveness, potentially increasing customer engagement and sales.
## Check the use case set up on the Synerise Demo workspace --- You can check the [promotion configuration](https://app.synerise.com/campaigns/promotions/317404be-1da6-4fd0-95e2-a880ab99131c) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Promotions](/docs/ai-hub/promotions) # Making smart alerts about deviation problems IoT is a solution that allows you to connect different devices and transfer data between them. Synerise gives you the ability to connect to any device, so you will be able to easily monitor the accuracy of its operation. ## Example of use - Food Industry **Challenge** Our use case is based on a project that shows that **IOT integration with the food industry** works well and provides a competitive advantage. Our client has a food parcel lockers network, which are devices that allow you to order food and store it until you pick it up. They usually consist of three temperature settings, one for frozen products where the temperature should be at most minus 10 degrees, another for products requiring a storage temperature of one to five degrees and a third setting of about 15 degrees. Increasing or decreasing the temperature for some products can cause damage. **Solution** This means that the temperature inside must be constantly monitored, and any deviation must be immediately notified. For this purpose, each of these food parcel lockers has a terminal which constantly monitors the temperature and has the ability to share this data. We created several alert scenarios for him that created notifications about: - temperature (general report) - temperature deviations (too low/too high temperature) - when devices go offline ![Screenshot presenting iot](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/iot_main.png) ## Prerequisites --- **General:** - Devices with the ability to connect to the internet via GSM or Wi-fi module. - Basic knowledge about API/webhooks and the Synerise platform. **Optional** - Configured email and SMS provider in your Synerise workspace. - Knowledge about API of communicators that you are using. ## Create automation --- 1. Go to **Automation Hub > Incoming**. Here we can configure the endpoint. We will receive a URL to which we will be able to send data. At the beginning you have to set up your device. Synerise allows you to create an endpoint to which you can send external data and as the result of such an action, you will receive a URL to which you can send the data in JSON format. Below you will see an example of a data frame.
{ 
         "time": "x", 
         "label": "x", 
         "action": "x", 
         "client": { 
               "uuid": "xxx-xxx-xxx" 
         }, 
         "params": { 
               "temp1": "x", 
               "temp2": "x", 
               "temp3": "x", 
               "temp4": "x" 
               } 
         }
2. When our devices are configured and they are sending data to this URL we can start to create an automation. 3. Automations allow us to convert received data into events on our device cards. - We use business events as a trigger, which means that our automation will be triggered every time our end point receives some data. So, when one of our devices sends any data, our automation will be triggered. - Then it will send outgoing webhooks. And here in the body of our outgoing webhook, we use Jinjava in order to get information about the values of these particular parameters. #### Case 1: Making smart alerts about temperature deviation problems 1. Go to **Automation Hub > Workflow > New workflow.** 2. Start with the **Profile Event** trigger and in the settings of the node, select the **custom.temp** event. This automation is triggered every time this event appears on the profile card. 3. Choose **Update Profile** action. Update the device status to online because when the device is sending data, that means it's online. 4. Choose **Profile Filter**. In this step we check if the average of the last 4 measurements was between 10 and 15 degrees. Because let's assume that this is the temperature that we want to have. 5. If **Profile Filter** is **matched** add **Update Profile** node. In settings define that it should updating a temperature status into “in scale” and then the automation is ending with **End node**. 6. But when our average temperature falls below 10 degrees or moves above 15 degrees, our automation will go with a different path. If **Profile Filter** is **not matched** add some **Delay node**. 7. Next, add another **Profile Filter** in which we check if the last temperature status was “in scale”. We do it for the purpose of capping.
Let's say that we want to receive only one notification per day. But in this particular way I assume that I wanted to get one notification when my fridge is broken and another one only when it’s been fixed but it’s broken again. So, of course, this is a very flexible and this is just one way of doing this automation if you want you can receive as many alerts as you want but this is just an example.
8. If conditions are **not matched** add **End node**. 9. If conditions are **matched** add **Alerts**. In this way you can send a bunch of email alerts and SMS alerts and some Slack notifications. We also update the hourly temperature status into out of scale. Based on that automation we are sure that a broken device would not send us and annotification until we fixed the fridge. ![Screenshot presenting iot](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/iot1.png) #### Case 2: Making smart alerts about device connection problems 1. Go to **Automation Hub > Workflow > New workflow.** 2. As a trigger add **Audience** node. Set up **Run trigger** as repeatable, and send interval as one hour. In this way, this automation will be triggered, every hour. 3. Add **Profile Filter.** It checks if we have any devices in our segment that didn't respond for one hour. 4. If **Profile Filter** is not matched, add **End node**. 5. If **Profile Filter** is matched, add **Update Profile** node. If it finds such devices, it will update its status to offline. 6. Add **Outgoing Integration** node, which send us a notification. 7. Add **Profile Filter**. We'll check if we have any devices that didn't respond for at least 12 hours. 8. If **Profile Filter** is not matched, add **End node**. 9. If **Profile Filter** is matched, add **Update Profile** node. If there are any such devices it will update the device status to offline. 10. Add **Outgoing Integration.** It will send a notification that our device is offline for at least 12 hours. In this scenario we will only get two emails when one of our devices is offline. 11. Finish the workflow adding **End** node. ![Screenshot presenting iot](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/iot2.png) ## Generated events This use case generates approximately 16 events per profile that completes the flow: `custom.temp` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~8), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~2), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`sms.send`](/docs/assets/events/event-reference/sms#smssend) (~1), [`slack.sendChannelMessage`](/docs/assets/events/event-reference/integration#slacksendchannelmessage) (~1). ## Read more --- - [Webhooks](/docs/automation/integration) - [Workflow](/docs/automation) # Web push with recommended products 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 --- - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable personalized recommendations. - [Import your product feed to AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - [Configure web push notifications](/docs/campaign/Webpush/configuring-web-push) - Create a workspace [API Key](/docs/settings/tool/api) with the permission - API_CUSTOM_EVENTS_CREATE. ## Process --- In this use case, you will go through the following steps: 1. [Create a personalized recommendation campaign](/use-cases/webpush-with-recommended-products#create-personalized-recommendation-campaign). 2. [Create a webpush template](/use-cases/webpush-with-recommended-products#create-a-web-push-template). 3. [Prepare a workflow](/use-cases/webpush-with-recommended-products#create-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](/use-cases/webpush-with-recommended-products#create-workflow). 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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.
Learn more about [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors) and [additional settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#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 Experience Hub icon **Experience Hub > 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 Modeling Hub icon **Data Modeling Hub > 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 Modeling Hub icon **Data Modeling Hub > 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.
To create a page with a list of recommended products, please refer to the [Creating section recommendations](/docs/ai-hub/recommendations-v2/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**. 1. Choose the authentication method. In our case, it will be **API key**. 2. Click **Add connection**, and on the pop-up, enter the name of the connection and from the dropdown list, select the API Key created as a part of prerequisites. 2. Click **Apply**. 3. In the **Webhook name**, field enter a name for the webhook. In this case `Webpush recommendation`. 4. Select the **POST** method. 3. In the URL of the endpoint, enter `https://api.synerise.com/v4/events/custom`. 5. Leave **content-type** at default: `application/json`. 6. Click **Add header**. 7. Add **Api-Version** with the value set to `4.4` 8. 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](/use-cases/webpush-with-recommended-products#create-personalized-recommendation-campaign). - All params contain information about recommended product are used in the [webpush template](/use-cases/webpush-with-recommended-products#create-a-web-push-template). 6. 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 `.+`
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](/use-cases/webpush-with-recommended-products#create-a-web-push-template). 2. In the **Schedule** section, set the **Webpush lifespan (TTL)** according to your business needs. 3. You can describe campaigns with [additional parameters](/docs/campaign/Webpush/creating-webpush-campaigns#adding-custom-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**.
Automation Hub workflow for sending web push notifications with recommended products
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: - [Personalized recommendation campaign](https://app.synerise.com/ai-v2/recommendations/nBzlR4BQtyvD) - [Workflow](https://app.synerise.com/automations/automation-diagram/e02a94cc-dc7c-4df3-9ef3-e03c64d90307) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`session.end`](/docs/assets/events/event-reference/web-and-app#sessionend) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `webpush.recommendation` (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`webpush.send`](/docs/assets/events/event-reference/webpush#webpushsend) (~1), [`webpush.show`](/docs/assets/events/event-reference/webpush#webpushshow) (~1), [`webpush.click`](/docs/assets/events/event-reference/webpush#webpushclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Web push](/docs/campaign/Webpush) # Low-stock abandoned cart campaign In the constantly evolving e-commerce landscape, optimizing sales and minimizing shopping cart abandonment rates is crucial. There are several ways to prevent the abandoned cart scenarios. While the classic approach to solving this problem is well known, there is an even more effective strategy - low-stock campaigns. To keep your potential customers from abandoning their shopping carts, consider implementing a low-stock campaign, which is a comprehensive solution that applies not only to abandoned shopping carts, but also to abandoned pages or abandoned favorite lists. Here's how a low-stock campaign strategy unfolds, especially for abandoned shopping carts. When users add products to their shopping carts that either already have low-stock levels or are predicted to have limited availability in the near future, and fail to complete the purchase, you can capitalize on the situation by triggering your low-stock abandoned cart communication. By promptly informing customers that the products they are at risk of selling out due to declining inventory, you provide them with a compelling reason to complete their purchase. This urgency can become a key element in the decision-making process, potentially leading to higher conversion rates. The beauty of a low inventory campaign is that it is highly customizable. What constitutes "low inventory" is entirely up to your discretion and tailored to your specific business needs. Whether you have 10 units left or even 1000 , the definition of low inventory can fit perfectly with your inventory management strategy. This flexibility ensures that your campaign can be tailored to different product categories and customer preferences, optimizing its effectiveness. In this use case you will learn how to create a low-stock campaign for customers with an abandoned shopping cart.
Low stock campaign
## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes) into your website. - [Implement the `cart.status` event](/developers/web/cart), which stores the current status of the basket in the form of an event on the customer's card. This event must to be sent to Synerise after every change in the cart status. - [Import product feed into the Synerise catalog](/use-cases/import-product-feed-to-catalog).
Click to see a sample catalog
Example of a catalog
Example of a catalog
- Prepare an email template for Low stock campaign. This template will be used later in the workflow. In the template, you can retrieve the event context from the preceding nodes. In this case, you can reuse the context of a product that has been added to the cart, but has not been purchased and is running out of stock. For more information on how to reuse event parameters, check out this [article](/developers/inserts/automation). ## Process --- In this use case, you will go through the following steps: 1. [Create a product.LowInStock event](/use-cases/low-stock-campaign#create-a-productlowinstockevent) 2. [Create an aggregate that returns products in a cart](/use-cases/low-stock-campaign#create-an-aggregate-that-returns-the-products-in-a-cart) 3. [Create a workflow](/use-cases/low-stock-campaign#create-a-workflow) ## Create a product.LowInStock event --- In this part of the process, add the **product.LowInStock** event, which will later be generated in the workflow that checks whether the product is low in stock. In addition, this event must include the **sku** parameter, which contains the SKU of the low-in-stock product which the customer added to the shopping cart. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Events > Add event**. 3. In the **Name** field, enter `product.LowInStock` In the API and SDK, the name parameter is usually called `action` or `action name` 4. Optionally, define a human-friendly display name that will be shown in **Data Modeling Hub** and **Decision Hub Hub**. 5. Optionally, in the **Description** field, enter the description of the event. 6. Enable the **Make this event available to anonymous profiles without JWT** toggle. 7. Click **Apply**. 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 `lowstock_cart`. This parameter will be used to save the SKUs of items which are low in stock. 11. In the **Property name** field, enter a human-readable label of the property 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 returns the products in a cart --- This aggregate will be used later in the **product.LowInStock** event to get products a customer added to their cart. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown list, select the `cart.status` event. 5. As the event parameter, select **ItemIds**. 6. Set the period from which the aggregate will analyze the results. In our case, we set the time period to **Lifetime**. 7. Save the aggregate.
Decision Hub Last aggregate returning the ItemIds parameter of the last cart.status event over a customer's lifetime
Configuration of the aggregate
## Create an aggregate that returns the number of products in a cart --- This aggregate will be used in the first workflow to check if a customer has any products in the shopping cart. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 5. From the **Choose event** dropdown list, select the `cart.status` event. 6. As the event parameter, select **totalQuantity**. 7. Set the period from which the aggregate will analyze the results to **Lifetime**. 12. Save the aggregate.
Decision Hub Last aggregate returning the totalQuantity parameter of the last cart.status event over a customer's lifetime
Configuration of the aggregate
## Create a workflow --- In this part of the process, we create a workflow to send an email campaign to customers who have added products to their cart but haven't completed their purchase. The workflow follows this logic: 1. Target customers who: - Have added products to their cart. - Haven't made a purchase in the last 60 minutes. - Have agreed to receive email communications. 2. If a customer meets all these conditions, we generate a **product.LowInStock** event. This event contains information about the items in the customer's cart that are running low in stock. 3. The workflow then waits for 10 minutes for the event to be generated. 4. Once the event is generated, the customer receives an email message with details about the products mentioned in the **product.LowInStock** event. ### Configure a trigger --- In this part of the process, select the segmentation for which you want to target low-stock campaign. 1. As the first node of the workflow, add **Profile Event**. 2. From **Choose event** dropdown menu, choose the **product.addToCart** event. 3. Confirm by clicking **Apply**. ### Define the Delay node --- This node creates an hour's delay before moving to the next condition of the workflow. 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `1`. 2. From the dropdown list, choose **Hour**. 2. Click **Apply**.
Configuration of the Delay node`
Configuration of the Delay node
### Configure the Profile Filter node --- This part of the process defines the conditions that the customer should meet in order to move to the next step of the workflow. If the customer does not meet the defined conditions, the workflow ends for them. 1. Add the **Profile Filter** node. In the node settings: 1. Click **Choose filter** and select the [aggregate](/use-cases/low-stock-campaign#create-an-aggregate-that-returns-the-number-of-products-in-a-cart) you created earlier in the process. 2. From the **Choose operator** dropdown, choose **More than (Number)** and type `0` in the empty field. 3. From the **Choose filter** dropdown list, select the **transaction.charge** event. 4. Change the funnel type from **profiles matching** to **profiles not matching**. 5. Click the calendar icon and set the date/time filter to **Last 60 minutes**. 6. From the **Choose filter** dropdown list, select the **newsletter_agreement** attribute. 7. From the **Choose operator** dropdown, choose **Equal (String)** and type `enabled` in the empty field. 2. Click **Apply**.
Automation Hub Profile Filter node checking for non-empty basket, no recent transaction, and newsletter agreement
Profile Filter node configuration
### Configure the Generate Event node for the Matched path --- Before sending the email to the customer, an event must be generated on the customer's profile. The event must contain the IDs of products that are running low in stock (these are the products that will be sent to the customer in the email). 1. Add the **Generate Event** node to the **Matched** path. In the configuration of the node: 1. In **Event name**, enter `product.LowInStock` 2. In the **Body** section, use the following Jinjava and modify it to your needs: {{< note >}} Jinjava inserted in **Generate event** body must have all empty spaces deleted. {{< /note >}} {{< highlight jinja >}} { "lowstock_cart": "{% set skus = [] %} {% aggregate PRODUCTS-IN-CART %} {# replace PRODUCTS-IN-CART with the ID of the aggregate that returns products in the cart #} {% for items in aggregate_result %} {% do skus.append(items) %} {%endfor%} {% endaggregate %} {% set lowstock = []%} {% for sku in skus %} {% catalogitemv2.CATALOG-NAME(sku) %} {# replace CATALOG-NAME with the name of your feed catalog #} {% set object = catalog_result %} {% if object.get('Quantity')|int < NUMBER %} {# NUMBER defines the amount of products you consider as low in stock #} {% set quantity = object.get('Quantity') %} {% do lowstock.append(sku) %} {%else%} {%endif%} {% endcatalogitemv2 %} {%endfor%} {% if lowstock|count==0 %}0{% else %}{{lowstock[0]}}{% endif %}" } {{< /highlight >}} **Result:** a **product.LowInStock** event is generated. Its **lowstock_cart** parameter contains the ID of a product that is low in stock. An example of a generated event:
Example of a generated product.LowInStock event with lowstock_cart parameter
Profile Filter node configuration
### Configure the Event Filter node --- This filter serves as a security measure to ensure that the **product.LowInStock** event was generated in the previous step. 1. Add the **Event Filter** node. In the configuration of the node: 1. Set **Check** to **for period of time**. 2. Define the time range to **10 minute**. 3. From the **Choose event** dropdown list, select the **product.LowInStock** event. 4. As the event parameter, select **lowstock_cart**. 5. From the **Choose operator** dropdown list, select **Regular expression**. 6. In the text field, type `.` {{< note >}} This regular expression is necessary to exclude product.LowInStock events with the empty value of the lowstock_cart parameter. {{< /note >}} 2. Confirm by clicking **Apply**.
Automation Hub Event Filter node configured with a regular expression to exclude empty lowstock_cart parameter values
The final configuration of the workflow
If an event was not generated for a customer, then the workflow ends for this customer. If the event is generated, then the next step is sending an email to the customer. ### Configure the Send Email node --- In this part of the process, send email communication to customers for whom the **product.LowInStock** event was generated. The email should contain the products returned in the event. 1. Add the **Send Email** node and open its settings. 2. In the **Sender details** section, choose the email account from which the email is sent. 3. In the **Content** section, select the template that you prepared as a part of the prerequisites. 4. **Optional**: In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 5. **Optional**: In the **Additional parameters** section, describe the campaign with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 6. Click **Apply**. ### Add final settings to your workflow --- 1. Add the **End** nodes. 2. Launch the workflow by clicking **Save&Run**.
Automation Hub workflow for sending low-stock campaign email notifications
The final configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/da49583b-f35a-349b-9906-55d5c1e820df) that returns the itemIds of products in the shopping cart for each customer. - [Aggregate](https://app.synerise.com/analytics/aggregates/0d351702-fb43-356e-a90a-c405fa0a388c) that returns the total quantity of products in the shopping cart for each customer. - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/e48f3760-2799-43d4-ae12-338ef8af0ea3) - [Catalog](https://app.synerise.com/assets/catalogs/183729) {{% include "/reuse/use-cases/synerise-demo-workspace.md" %}} ## Generated events This use case generates approximately 12 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~5), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `product.LowInStock` (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Email campaigns](/docs/campaign/e-mail) - [Jinjava inserts](/developers/inserts) - [Segmentation](/docs/analytics/segmentations) # Manage loyalty points expiration with rolling logic In many loyalty programs, points remain valid only for a limited period of time. To manage this process effectively, it is important to accurately calculate when points expire and update customer balances accordingly. There are two common approaches to handling point expiration. The first is rolling cancellation, where each points-earning event has its own expiration date calculated from the moment the points were awarded. The second is batch expiration, where points are removed periodically for the entire customer base according to predefined rules. In this use case, we focus on the more flexible rolling expiration model, in which points expire individually after a defined validity period. This approach allows you to maintain accurate point balances, monitor expiring points continuously, easily modify point expiration rules, and proactively inform customers about upcoming point reductions. #### Use case assumptions The expiration mechanism can be configured in many different ways depending on business requirements. For the purpose of this use case, we assume the following setup: - Loyalty points are awarded through the `points.loyalty` event based on the `transaction.charge` event which generates the points. Optionally, you can implement other loyalty point-earning events for different actions (such as completing a survey, newsletter subscription, fast order pickup etc). - Points can be spent on rewards through the `client.activatePromotion` event. - The default retention of the two above mentioned events is set to 30 days, however we recommend to change it to infinite. - Each point-earning event can have its own configurable expiration time, however in this case we assume that points which have not been redeemed expire after 6 months (182 days) from the moment they are awarded. - Expired points are recorded with the `points.expire` event generated by workflow and later used in expressions calculating the current balance. - The expiration process runs daily. ## Prerequisites --- Integrate mechanism for awarding loyalty points. With the help of Synerise support implement the `points.loyalty` and `client.activatePromotion` events, as well as necessary custom loyalty events.
Find more in the [Loyalty programs basics](/use-cases/loyalty-programs-basics) use case.
## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate summing collected points](/use-cases/rolling-points-expiration#create-an-aggregate-summing-collected-points). 2. [Create an aggregate summing expired points](/use-cases/rolling-points-expiration#create-an-aggregate-summing-expired-points). 3. [Create an aggregate summing points redeemed on promotions](/use-cases/rolling-points-expiration#create-an-aggregate-summing-points-redeemed-on-promotions). 4. [Create an aggregate summing all points are to potentially expire](/use-cases/rolling-points-expiration#create-an-aggregate-summing-all-points-that-are-to-potentially-expire). 5. [Create an expression summing aggregates with all lost points](/use-cases/rolling-points-expiration#create-an-expression-summing-aggregates-with-all-lost-points) 6. [Create an expression calculating current point balance](/use-cases/rolling-points-expiration#create-an-expression-calculating-current-point-balance) 7. [Create an expression calculating points to expire](/use-cases/rolling-points-expiration#create-an-expression-calculating-points-to-expire) 8. [Create a segmentation of customers with points to expire](/use-cases/rolling-points-expiration#create-a-segmentation-of-customers-with-points-to-expire) 9. [Create a workflow](/use-cases/rolling-points-expiration#create-a-workflow) ## Create an aggregate summing collected points --- Start with creating an aggregate which returns the sum of points for the `points.loyalty` event. We recommend setting the analyzed period to **Lifetime**. The result of the aggregate will be used in an expression calculating current point balance. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate. 4. Click **Analyze profiles by** and select **Sum**. 5. Select the `points.loyalty` event. 6. As a parameter, choose `points`. 7. Set the analyzed period to **Lifetime**. 8. Click **Save**.
Decision Hub aggregate summing the points parameter of all points.loyalty events in a customer's lifetime
The configuration of an aggregate summing all points.loyalty events in a customer’s lifetime
## Create an aggregate summing expired points --- In this part of the process, create an aggregate which returns the sum of expired points based on the `points.expire` event. We recommend setting the analyzed period to **Lifetime**. The result of the aggregate will be used in an expression calculating all lost points. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate. 4. Click **Analyze profiles by** and select **Sum**. 5. Select the `points.expire` event. 6. As a parameter, choose `points`. 7. Set the analyzed period to **Lifetime**. 8. Click **Save**.
Decision Hub aggregate summing the points parameter of all points.expire events in a customer's lifetime
The configuration of an aggregate summing all points.expire events in a customer’s lifetime
## Create an aggregate summing points redeemed on promotions --- In this stage of the process, create an aggregate that counts the sum of redeemed points based on `client.activatePromotion` event. We recommend setting the analyzed period to **Lifetime**. The result of the aggregate will be used in an expression calculating all lost points. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate. 4. Click **Analyze profiles by** and select **Sum**. 5. Select the `client.activatePromotion` event. 6. As the event parameter, select `promotionRequireRedeemedPoints`. 7. Set the analyzed period to **Lifetime**. 8. Click **Save**.
Decision Hub aggregate summing the promotionRequireRedeemedPoints parameter of all client.activatePromotion events in a customer's lifetime
The configuration of an aggregate summing all client.activatePromotion events in a customer’s lifetime.
## Create an aggregate summing all points that are to potentially expire --- In this step, create an aggregate that returns the total number of loyalty points awarded more than 182 days ago based on the `points.loyalty` event. These points may have reached the expiration threshold and could potentially expire at the time of calculation. The analyzed time range is set from 20 years ago up to 182 days before today. This allows the aggregate to include all historical point-earning events that are old enough to be considered for expiration. Since the system does not allow setting an infinite time range, 20 years is safe to use instead of lifetime. The result of this aggregate will be used later in an expression that calculates how many points should expire. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate. 4. Click **Analyze profiles by** and select **Sum**. 5. Select the `points.loyalty` event. 6. As a parameter, choose `points`. 7. Set the analyzed period to last **20 years** before **182 days**. 8. Click **Save**.
Decision Hub aggregate summing points.loyalty events from 20 years ago up to 182 days before today to identify historically earned points eligible for expiration
The configuration of an aggregate summing all points.loyalty historical events up to the date points are to potentially expire in 6 months
## Create an expression summing aggregates with all lost points --- In this part of the process, prepare an expression which is a sum of two aggregates created in the previous steps: [aggregate summing expired points](#create-an-aggregate-summing-expired-points) and [aggregate summing redeemed points](#create-an-aggregate-summing-points-redeemed-on-promotions). 1. Go to Behavioral Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. From the **Expressions for** dropdown list, select **Attribute**. 3. Build the following formula of the expression:
Behavioral Data Hub expression formula summing aggregates of expired and redeemed loyalty points
Formula of an expression summing up aggregates with all lost points
4. Save the expression. ## Create an expression calculating current point balance --- In this part of the process, prepare a current point balance expression by substracting lost points (the sum of [aggregate summing expired points](#create-an-aggregate-summing-expired-points) and [aggregate summing redeemed points](#create-an-aggregate-summing-points-redeemed-on-promotions)) from all points gathered ([aggregate summing collected points](#create-an-aggregate-summing-collected-points)). 1. Go to Behavioral Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. From the **Expressions for** dropdown list, select **Attribute**. 3. Build the following formula of the expression:
Behavioral Data Hub expression formula calculating current loyalty point balance
Formula of an expression calculating the current point balance
5. Save the expression. ## Create an expression calculating points to expire --- In this part of the process, we create a formula that will tell how many points should be counted as expired, taking into account that some of them may already have been used on rewards. The result of this expression will be used in the segmentation of customers whose points should expire. This expression is based on the condition that if the number of collected points returned by the [aggregate summing all points that reached the expiration threshold](#create-an-aggregate-summing-all-points-that-are-to- potentially-expire) is equal to or lower than the results of the [expression summing aggregates with all lost points](#create-an-expression-summing-aggregates-with-all-lost-points) which includes all points already deducted from the balance up to this moment (in this case, up to 6 months ago), then we assume that all points eligible for expiration have already been redeemed or expired. In this case, the expression returns 0. Otherwise, we subtract the value of the [expression summing aggregates with all lost points](#create-an-expression-summing-aggregates-with-all-lost-points) from the result of the [aggregate summing all points that reached the expiration threshold](#create-an-aggregate-summing-all-points-that-are-to-potentially- expire). The returned value equals the number of points that should expire. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. From the **Expressions for** dropdown list, select **Attribute**. 3. Build the following formula of the expression:
Behavioral Data Hub expression formula calculating loyalty points eligible for expiration
Formula of an expression calculating points to expire
4. Save the expression. ## Create a segmentation of customers with points to expire --- In this step, create a segment of users who have loyalty points eligible for expiration. This segment will serve as the audience for the daily workflow responsible for generating the `points.expire` event. The segmentation is based on the following conditions: - The user received loyalty points at least 182 days ago. In this simplified example, we check the occurrence of the `points.loyalty` event. If your loyalty program awards points through multiple events, you can include them using the OR operator. - The result of the [expression calculating points to expire](#create-an-expression-calculating-points-to-expire) is greater than 0. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. Choose **Add condition**. 4. From the dropdown list, choose the `points.loyalty` event. 5. As a parameter, choose `points`. 6. Select the **More than** operator. 7. In the left field, leave the **#** icon and enter `0` in the value field. 8. Using the date picker in the lower-right corner, set the time range to **Last 24 hours before 182 days**. 9. Choose **Add condition** once again. 10. From the dropdown list, choose the [expression calculating points to expire](#create-an-expression-calculating-points-to-expire) you have created in the previous part of the process. 11. Select the **More than** operator. 12. In the left field, leave the **#** icon and enter `0` in the value field. 13. Save the segmentation.
Segmentation settings
The configuration of a segmentation of users who have points to expire
## Create a workflow --- In this part of the process, you will create a simple workflow that runs daily, preferably shortly after midnight. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- The workflow is triggered for customers who belong to the [segmentation](#create-a-segmentation-of-customers-with-points-to-expire) created in the previous step every day at a defined time. 1. As the first node, add the **Audience** node. 2. In the configuration of the node, set the **Schedule** option to **Repeat runs**. 3. Select the correct time zone. 4. Set the interval to 1 per day. 5. Choose the day and time when the process starts. We recommend scheduling it a few seconds (5–10) after midnight. 6. In **Define audience**, choose **Segments**, click **Select segments** and select the [segmentation](#create-a-segmentation-of-customers-with-points-to-expire) created in the previous step. 7. Click **Apply**.
The view of the audience configuration
The configuration of Audience node
### Define the Generate Event node --- 1. Add the **Generate Event** node. In the node settings: 1. In the **Event name**, enter `points.expire`. 2. In the **Body section**, use the following Jinjava, entering the UUID of the [expression calculating points to expire](#create-an-expression-calculating-points-to-expire) which allows to dynamically generate events with points number personalized for each user.
{
                       "points": " {% expression %} a7d340ac-906d-49af-83a1-fbe4015bc76f {% endexpression %} ",
               }
The result of such action will be such an event:
The view of the points.expire event
The view of the points.expire event on customer's profile
2. Click **Apply**.
The view of the generate event node configuration
The configuration of Generate Event node
### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for rolling loyalty points expiration
The configuration of the workflow for expiring points
## What's next --- Once the rolling expiration mechanism is configured, you can extend this setup with additional communication scenarios. For example, you can create a campaign that informs customers in advance about points that will expire soon. Sending a notification a few days or weeks before the expiration date helps customers use their points before they disappear. Such communication can include personalized information about the number of points that will expire and highlight rewards or promotions where those points can be redeemed. This approach not only improves the customer experience but also increases engagement with the loyalty program and can boost the number of transactions. ## Check the use case set up on the Synerise Demo workspace --- You can check all the analytics directly in the Synerise Demo workspace: - [Aggregate returning the sum of collected loyalty points](https://app.synerise.com/analytics-v2/aggregates/2d104df4-9de2-378e-ad28-1e3e70b66a23) - [Aggregate returning the sum of expired loyalty points](https://app.synerise.com/analytics-v2/aggregates/65310b9f-ec28-3317-8292-215891bb26a7) - [Aggregate returning the loyalty points redeemed on promotions](https://app.synerise.com/analytics-v2/aggregates/2d7417d3-38ce-3704-9cea-9940cdb4d8aa) - [Aggregate returning the sum of points that are potentially to expire](https://app.synerise.com/analytics-v2/aggregates/053abceb-b1a3-32f2-b960-fed98a97e4fa) - [Expression returning the sum of aggregates with all lost points](https://app.synerise.com/analytics/expressions/23785c1e-9093-48cf-8c83-6b4f6099689e) - [Expression calculating current point balance](https://app.synerise.com/analytics/expressions/66fa052f-434c-4a54-901f-0c7483c38160) - [Expression calculating points to expire](https://app.synerise.com/analytics/expressions/8dfe993d-f84f-4608-a936-4f83a6d9acfa) - [Segmentation of customers with points to expire](https://app.synerise.com/analytics-v2/segmentations/f616b0d0-d615-4f4a-af6c-4907d33f5b4a) - [Workflow for expiring points](https://app.synerise.com/automations/workflows/automation-diagram/0c21290d-cdeb-4493-a83b-90a8db22d0b6) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `points.expire` (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) - [Segmentations](/docs/analytics/segmentations) - [Audience node](/docs/automation/triggers/audience-node) - [Generate Event node](/docs/automation/actions/send-client-event) - [End node](/docs/automation/flow-control/end-node) - [Loyalty events](/docs/assets/events/event-reference/loyalty) Check our other [loyalty use cases](/use-cases/?ordering=DESC&sortBy=publishDate&filters=tags%3D%3D%22loyalty%22) # Search engine for a brand with multiple languages and currencies AI search is not difficult tool to use, especially when we use one language. A lot of our customers are operating in many markets and want to use search in different languages. It is hard to avoid a situation where a user enters a different language when searching certain categories in his language on the website. We can accept it and the fact that he will find a blank page with no results, but on the other hand we can set up the search process and, based on that, show him the products he is looking for no matter which language he uses. **Challenge** Our client had one e-commerce platform that uses different variants depending on the region chosen by customers, currencies available on the chosen region and website language. Additionally, each market had its own product stock. So, in fact we had several e-commerce operations under one domain. Our customer wanted to have all the data in one place and execute all campaigns from the one place as well. He was also interested in creating AI search which makes it possible to search for products in different languages. ![Screenshot presenting ai search](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/aisearch-products1.png) ## Prerequisites --- - Synerise [tracking code](/docs/settings/tool/tracking_codes), to collect all necessary events from the website. - [Product feed](/developers/product-feed) implemented. - [OG tags](/developers/web/og-tags). - Collecting [transactional events](/docs/automation/actions/synerise-integrations/import-events). ## Process --- 1. [Prepare product feeds](/use-cases/search-multiple-languages#prepare-product-feeds) for each market. 2. [Prepare a search ranking](/use-cases/search-multiple-languages#prepare-a-search-ranking). 3. [Set up AI search](/use-cases/search-multiple-languages#set-up-ai-search) - query rules and synonyms. ## Prepare product feeds --- 1. **Create separated product feeds** for each market with additional information about those languages on the website which we want to use in our search - every attribute like description, title, type, category should be added in two languages. Everything in the Google merchant format. Thanks to that, even if the customer is on the English version of the website, he can search using Arabic words as well.

2. Every search for each region has to be built on the basis of separate product feeds. So, we have to prepare **different indexes for such an AI search**. Thanks to that we can choose, based on which product feed we want to build our models on. As you can see below, we can choose one of the imported product catalogs and later use it to prepare the appropriate campaign. ![Screenshot presenting index](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/indexes.png) ## Prepare a search ranking --- In the case of a search engine, the most important step of setting it up is to **prepare a search ranking**. This means you have to indicate which attributes around the product have to be searchable and assign their importance. ![Screenshot presenting ranking](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/aisearchranking.png) As you can see here, we have a lot of attributes from the product feed, from this customer, but the most important are searchable attributes which will be search at the beginning. In our case it will be: - Category - itemID - attributes.product_type_ar – second language - brand - title In medium and low importance, we have also the next attributes from the product; description, gender, attributes.title_ar, attributes.description_ar, and more of them in the low importance (e.g. size, pattern etc.).

## Set up AI Search --- ### Query rules Synerise lets you optimize search using our query rules. It also allows us to prepare seven better search results. Based on this, in just a few steps you can decide that if somebody enters a query, you can replace it with a different phrase and show him specific content. We can prepare such query rules in AI Hub – Indexes - New index, clicking button “create new” in query rules. We have to complete 3 sections: - Conditions - Consequences - Schedule ![Screenshot presenting query rules](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/queryrules.png) Let’s say that we want to prepare a query for when someone enters “dress” - we would like to show him products from the dress category in the Arabic language “فستان”. So, we choose the title from the first steps subpage and add it to the consequences section. In this way we will define that if somebody enters “dress” we would like to replace this query with a new query, which is dress in Arabic. ### Synonyms You can also use synonyms to make the search more effective. To do this, add new synonym in the synonym section. Choose if it should work in one way or two ways. ![Screenshot presenting query rules](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synonyms.png) It can be helpful if a lot of similar words for your category exist (sweatshirt and hoodie) or a lot of different products are in the same category e.g. beach accessories, where you can find towels, bags, umbrellas etc.
You can always check the **zero page results section** in your search configurator to see what kind of words are often entered by your customers. It may be that some categories or product names are entered by mistake and you can automatically replace them with the proper word.
## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AI search](/docs/ai-hub/ai-search/introduction-to-ai-search) - [Catalogs](/docs/assets/catalogs/creating-catalogs) - [Product Search API documentation](https://hub.synerise.com/api-reference/ai-search) # Abandoned search scenario Recover customers who have abandoned their search. When customers conduct a search on your website without adding any items to their cart, this is known as search abandonment. When a customer doesn’t complete a purchase, send an email with products related to the phrase they searched. This use case describes how to prepare an automated workflow that is triggered by customer searching a specific phrase and sends them an email with an offer based on the abandoned search after 48 hours. One of the challenges addressed in this use case is the use of outgoing integration. ## Prerequisites --- - [Implement AI search](https://hub.synerise.com/api-reference/ai-search) in any of your channels (mobile app, website, and so on). - Match customers using search in any of your channels with their emails. To do so, we suggest to implement customer identification [on the website](/developers/web/tracking-form-data) and [in your mobile app](/developers/mobile-sdk/user-identification-and-authorization). - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Create an email template](/docs/campaign/e-mail/creating-email-templates). ## Prepare a workflow --- Create a workflow which sends your customers an email offer with the products from their abandoned AI search. Optionally, you can add additional nodes, depending on your business needs. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node At this stage, we will configure conditions that launch the workflow. As a trigger, we will use the `item.search` 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 `item.search` event.
`item.search` is an event that our system generates automatically, when our AI search is implemented somewhere in any of your channels, when customer searches for a phrase. It contains `query` parameter which stores the phrase entered by customer.
2. Confirm by clicking **Apply**. ### Configure the Event Filter node This node will set the workflow to wait for 48 hours for customer conversion (`product.buy`). If the purchase is made, then the workflow ends. If it doesn't happen, the workflow moves on because the customer meets the abandoned search scenario. This setting is just an example and can be configured according to your business needs. 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 48 hours. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `product.buy` event. 2. Confirm by clicking **Apply**. 3. For the **Matched** path, add the **End** node . ### Configure the Outgoing Integration node In this step, we will use the phrase that the customer has searched for (it is stored as a `query` event parameter in the trigger) to send a request to AI search for products related to this phrase. In further steps, we will use these products in the email which will be added to it through a dynamic insert. You can find the method to retrieve products related to the phrase [at this link](https://hub.synerise.com/api-reference/ai-search#tag/Search/operation/SearchAutocompletePost). In order to create a request, we configure a custom webhook by defining the Endpoint URL, body request, and so on. This action allows you to send requests from Synerise to external systems. 1. To the **Not matched** path, add **Outgoing Integration**. In the configuration of the node: 1. Choose **Custom webhook**. 2. Name the webhook. In our case `get search result`. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `search.ai.abandoned` 2. As **Display name**, enter `Abandoned AI search` 3. In the **URL** section, next to **POST**, type the endpoint of request: `https://api.synerise.com/search/v2/indices/{indexId}/autocomplete`, where `{indexId}` is the ID of your AI search index. 4. In the **Headers** section, click **Add header**. In the first field type `x-api-key`, and in the second, enter the tracker key from your [tracking code](/developers/web/installation-and-configuration). 5. In the **Body** section add the following JSON frame with Jinjava code:
{   
               "query": "{{event.params.query}}",
               "limit":6
               }
**Where:** | Phrase | Explanation | |------------ |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `query` | this is the phrase the customer used in their search, taken from the event triggering the workflow -

`item.search`. To insert this phrase dynamically we used [an insert](/developers/inserts/automation#event-parameters). | | `limit` | this phrase limits how many products the customer will receive. | 6. Leave **None** as the the method of authorization. 2. Confirm by clicking **Apply**.
Outgoing Integration configuration
Outgoing Integration configuration
### Configure the Event Filter node This node will allow you to use the products returned by the AI search in the previous step, to send an email with those products. The data of the returned products will be included in the parameters of the `search.ai.abandoned` event. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Define conditions** field, from the **Choose event** dropdown menu, choose the `search.ai.abandoned` event. 2. Confirm by clicking **Apply**. ### Configure settings for email 1. As the next node, add **Send Email**. Configure it according to your business needs. 2. Configure the sender details section. 3. Configure the Content section. 1. In the **Subject** field, enter your message subject. 2. In the **Template** section, choose the template email template prepared earlier. 3. You can define **UTM & URL parameters**. 4. Confirm by clicking **Apply**.
You need to enrich your email template with products related to the phrase your customer searched. To do so, use [Jinjava code](/developers/inserts/automation#event-parameters) and correlate it with parameters from the `search.ai.abandoned` event.
### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for following up on abandoned AI search sessions
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can also check the [workflow configuration](https://app.synerise.com/automations/automation-diagram/b4661379-1a4e-4b32-a8c9-fd3aede43cdc) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~4), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `search.ai.abandoned` (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Automation inserts](/developers/inserts/automation) - [Creating workflows](/docs/automation/creating-automation) - [Outgoing Integration](/docs/automation/actions/webhook-node) # Displaying personalized recommendations before typing a search query AI search phrases that are well-built and adaptable can become a key tool enabling maximum shortening of the user's path, leading to more purchases. To enable customers to find items they need as quickly as possible, it is important to take care of the accuracy of search results, monitor its behavior and calibrate it accordingly. Various types of recommendations allow **adding** other modules with **recommended products to the search engine**.
Screenshot presenting AI search filter
AI search
--- ## Example of use - construction industry **Challenge** A client from the construction industry wanted to shorten the user's path as much as possible to find the needed product using AI search. For this purpose, the client decided to display product suggestions in the form of a list already at the stage when the user clicks on the search engine, but has not yet enter the desired phrase. The displayed offers were selected based on a personalized recommendations model. **Results** - CTR **11%** - Campaign conversion **1.4%** - Increase in the number of people using the search engine by **9%** within **21 days** from introducing the AI search modification. ## Prerequisites --- Before you start implementing this use case, you must fulfill the requirements listed below: - [Implement event tracker](/developers/mobile-sdk/event-tracking). - [Implement OG tags](/developers/web/og-tags). - [Import product feed to Synerise](/developers/product-feed). - [Track transaction events](/developers/web/event-tracking). ## Process --- To prepare such a scenario, you have to follow 2 important steps. 1. [Prepare personalized recommendations](/use-cases/ai-search-improvements#prepare-personalized-recommendations). 2. [Set up dynamic content](/use-cases/ai-search-improvements#set-up-a-dynamic-content). ## Prepare personalized recommendations --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. From the drop down list, choose **Catalog** based on which your recommendations will be built. 3. Choose **Personalized** as the recommendation type.
Screenshot presenting site with type and source of recommendation
Select the type of recommendation
4. In **Items** define more details about your recommendation.
You must select the minimum and maximum number of products displayed in the recommendation frame. Optionally, you can set the filters (for example, narrow down the number of items from a specific category), however, in this use case the client didn't add the filters. You can also create filters by following the instructions in [this](/docs/ai-hub/recommendations-v2/recommendation-filters) article.
## Set up a dynamic content --- To insert personalized recommendations in the search results right before a user starts typing a search phrase, use dynamic content. 1. Choose **Insert Object** type. 2. Select your **Audience**. You can target your communication to everyone or select segment of users. In our example we target communcation to **everyone**. 3. In the **Content** section, click **simple message** and specify the CSS selector where you want to insert recommendations. 4. In the **Content** tab section, click **Create message** insert Jinjava code with AI recommendation and add your own CSS.
Check the Jinjava code
<!-- Opening the tag that retrieves the value from recommendation prepared in point 1--> {% recommendations3 campaignId=xxx %} for loop below: <!-- In the section {% for r in recommended_products3 %} a {% endfor %} there is access to all variables from a given object (products here) - which parameters you add to the template depends on you. --> {% for r in recommended_products3 %} <!-- {{ r.itemId }} {{ r.title }} {{ r.imageLink }}{{r.price.value}}{{r.salePrice.value}} - parameters taken from the recommendation. The itemId is a standard name, but others (like category, price, salePrice, title, imageLink) only depend on names defined in the feed--> {{r.itemId}} {{r.title}} {{r.imageLink}} {{r.price.value}} {{r.salePrice.value}} {% endfor %} <!-- Closing of the tag that gets the value from the recommendation prepared in point 1 --> {% endrecommendations3 %}
Implementation of the script above results in displaying recommendation personalized for individual user after clicking the AI search. Remember to replace `xxx` in the `campaignID` with the ID of the recommendation you prepared in the previous steps.
6. Skip **UTM** section. 7. In **Display Settings**, define where dynamic content is shown: **Always**, **On landing**, on **All pages**. 8. In the upper right corner, click **Schedule** and **Activate** when the dynamic content has to be active. ## Check the use case set up on the Synerise Demo workspace --- You can check [recommendations](https://app.synerise.com/ai-v2/recommendations/PsDLh5DdTlk3) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [AI recommendation](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Dynamic content](/docs/campaign/dynamiccontent) - [Jinjava inserts](/developers/inserts/filter) - [Recommendations](/docs/ai-hub/recommendations-v2) # Brickworks product template with AI-based similar recommendations Presenting accurate and up-to-date product content across channels often requires combining product catalog data with dynamically generated recommendations. [Brickworks](/docs/assets/brickworks) allows you to define a product template that can pull product attributes directly from your catalog and extend it with AI-based similar products. In this use case, you will create a schema enabling templates to return: - dynamic product information coming from a Synerise catalog - dynamically computed similar products based on an AI recommendation model Additionally, this schema will serve as an in-app template derived from a template available in the Synerise Demo workspace (ID: 1590) and will be displayed directly within the application. The goal is to enable an in-app view that appears when a user adds a product to their favorites from that product’s page (triggered by the product.addToFavorite event). This view will display the selected product alongside AI-generated recommendations of similar items.
In-app message example
## Prerequisites --- - Import a product feed to Synerise. You can find instructions [here](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search). - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable similar items recommendations. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Implement a custom event for adding a product to favorites, which will be available in the customer profile. In this example, the event is called `product.addToFavorite`. Implement custom events in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-favorites) or [website](/developers/web/event-tracking#declarative-tracking-custom-events). ## Process --- In this use case, you will go through the following steps: 1. [Create an AI recommendatons](#create-an-ai-recommendations) with similar products. 2. [Create a schema](#create-a-schema) with similar AI recommendations. 3. [Create the record](#create-the-record). 3. [Create an in-app campaign](#create-an-in-app-campaign) based on the brickworks schema. ## Create an AI recommendations --- In this part of the process, you will configure a [similar items recommendation](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) with context. This recommendation will later act as a reusable data source inside the schema, so any component that uses the schema will automatically access consistent recommendations. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items Feed** dropdown list, as an item feed, select an item catalog which you configured as a part of [prerequisites](#prerequisites). 5. In the **Type** section, choose the **Similar items** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 8. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 9. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 10. Confirm by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors. 9. In the right upper corner, click **Save**. ## Create a schema --- In this section, you will [create a Brickworks schema](/docs/assets/brickworks/quick-start/creating-a-schema) with fields for product information and AI recommendations. The schema acts as a structured container for all data that will later be displayed to users in different channels. By defining fields here, you create a single place where product-related information is stored, updated, and reused across templates, campaigns, and runtime contexts. 1. Go to **Data Modeling Hub > Schemas > New schema**. 2. Choose **Simple Schema**. 3. Enter a name for the schema, in **Display name** for example **Product template**. **API names** value is pre-filled with the value from Display name. The value in this field is the unique identifier used to reference this schema in API requests. 4. Optionally, fill in the **Description** field. ### Add Product Name 5. Click **Add new field** and choose **String** 3. Complete the fields: - Add **Display name** for the field in our case `Product name`. - **API name** will be pre-filled automatically. 4. Set the field as **Required** by selecting the **Required field** checbox. 5. To save your changes, click **Apply**.
Brickworks schema field configuration showing Product name string field
Brickworks configuration
### Add Item ID 5. Click **Add new field** and choose **Jinjava code** 3. Complete the fields: - Add the **Display name** for the field in our case `Item ID`. - The **API name** will be pre-filled automatically. 4. Check the **Cast to** field. By default, Jinjava output is cast to string. Use this option to cast the result to another type (number, boolean, JSON). 5. Choose type as the `Integer`. 5. To save your changes, click **Apply** .
Brickworks schema field configuration showing Item ID Jinjava field
Brickworks configuration
### Add Product Catalog 5. Click **Add new field** and choose **Catalog**. 3. Complete the fields: - Add the **Display name** for the field in our case `Product Catalog`. - The **API name** will be pre-filled automatically. 4. From the catalogs list, choose the catalog with the product feed which you imported as a part of [prerequisites](#prerequisites) 5. Optionally you can enter the primary key used to identify items in the catalog (string or JINJAVA). In this case it will be Jinjava primary key with the value: `{{ record.itemid }}`. 5. Click **Apply** to save your changes. ### Add the AI Recommendations 5. Click **Add new field** and choose **AI Recommendations** 3. Complete the fields: - Add the **Display name** for the field in our case `Similar Products`. - The **API name** will be pre-filled automatically. 4. Choose from the list AI Recommendations created in the [previous step](#create-an-ai-recommendations) 5. Enter the Product context - Item ID passed as context for recommendations. In pur case it will be Jinjava primary key with the value:`{{ record.itemid }}`. It is required in similar/complementary campaigns. Optional in personalized ones. 5. To save your changes, click **Apply**.
Brickworks schema field configuration showing Similar Products AI recommendations field
Brickworks configuration
### Set up the Audience & Settings 1. Click the **Audience & Settings** tab. 2. In the **Audience** section, click **Define**. 3. Choose the schema recipients, in our case, choose **Everyone**. 4. Click **Apply**. 5. In the upper-right corner, click **Save.** ## Create the record --- [Creating a record](/docs/assets/brickworks/quick-start/creating-a-record) means adding the data to the schema. It means that you fill out schema fields with the actual values. This step fills the structure you created earlier with real data that will be rendered to the user. Anything you enter here becomes the source of truth for templates, recommendations, and dynamic elements across your communication channels. By storing product-specific information inside the record, you ensure that all in-app messages, PDP blocks, or emails referencing this schema always draw from the same, consistent data set. 1. Go to **Data Modeling Hub > Data collection > Select schema**. 2. Choose [schema created in the previous part of the process](#create-a-schema). 3. Click **Add record**. 4. Add a name for the reocrd. 5. Add a slug for the reocrd. Slug is a unique, URL-friendly version of the name. It usually contains only lowercase letters, numbers, and hyphens. In our case it will be `dynamic`. 6. As an itemId add `{{ context.itemid }}`. 7. Click **Publish** to publish your record. ### Previewing records After saving the record either as a draft (in case of records created based on versioned schemas) or publishing it (in case of both schema types), you can [preview the record](/docs/assets/brickworks/quick-start/creating-a-record#previewing-records) for the context of a selected user. This context-driven approach enables your records to adapt dynamically based on the requesting application, user session, or any external factors you define. 1. Go to **Data Modeling Hub > Data collections**. 2. In the header, from **Select schema* dropdown list, select the [schema](#create-a-schema) created previously. 3. Find the record which you want to preview. 4. Enter the record configuration. 5. Click the **Preview context**. 6. From the dropdown list, find a profile for whom you want to generate record preview. This means the same record can render completely differently depending on the context you provide. 6. Click **Add parameter** and choose the parameter from your catalog you want to preview, in our case it will be `itemid`. As the value of this field add the example itemid value for exemplary product.
Brickworks record preview context with itemid parameter configuration
Brickworks configuration
**Result**: You will see the dynamic preview with the data about the specific product from your catalog.
Brickworks record dynamic preview showing product data from catalog
Brickworks configuration
What is more you can see what similar recommendations will be generated for this specific product for the choosen user.
Brickworks record preview showing similar AI recommendations for a product
Brickworks configuration
## Create an in-app campaign --- In this part of the process, you [create an in-app campaign](/docs/campaign/in-app-messages/create-inapp-message) triggered by the `product.addTofFavorite` event. We will use a template available on the Demo Workspace (1590), so there is no need to create a template from scratch, you can copy the template to your workspace and use it. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. 1. In the **Audience** section, click **Define**. 4. Click **Everyone**. 8. To save the audience, click **Apply**. ### Define content --- In this part of the process, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template. 1. In the **Content** section, click **Define**. 2. Click **Create message**.
We’re using a ready-made template available in the 1590 Synerise Demo workspace. You can use this template as a base and copy it into your own workspace.
**Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template [add snippets](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs.
Brickworks in-app Config tab with Schema ID, Record ID, and ContextID fields
In-app configuration
1. To the **Schema ID** field, add the ID of the [schema created as the part of prerequisites](#create-a-schema). You can find schema ID in the URL of the schema. 2. To the **Record ID** field, add the ID of the [record created as the part of prerequisites](#create-the-record). You can find the record ID in the URL of the record. 3. To the **ContextID** field, insert a value of the context parameter of the product used in the record. In our case it will be an example itemid for example: `e579487933852f3a83abd9e840175c`. 3. You can optionally edit the copy and design of the template. 10. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the preview directly in the mobile app.
11. If the template is ready, in the upper right corner click **Save this template > Save as**. 12. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 13. To continue the process of configuring the in-app campaign, click **Next**. 14. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `product.addTofFavorite` event. 3. Click the **+ where** button and select `mobile`. 4. As the logical operator, select **Exists**. 5. Click **Apply**. ### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the message to the customer a maximum of 1 time in period of 7 days.
You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general.
16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ## What's next --- After defining this schema, you can reuse the template across other placements as needed. It can be applied not only in PDP blocks, emails, or in-app views, but also in any additional surfaces supported by your setup—for example homepage modules, product carousels, or campaign-specific placements. This allows you to keep product data consistent while still generating similar items dynamically. ## Check the use case set up on the Synerise Demo workspace --- In Synerise Demo workspace, you can check the configuration of: - [Similar Recommendation](https://app.synerise.com/ai-v2/recommendations/Qgt7QWHu35ZB) - [Brickwork schema](https://app.synerise.com/assets/brickworks/schemas/4f90172f-2439-4e32-9588-77a156a8c6e1) - [In-app campaign](https://app.synerise.com/communications/in-app/7f5cc48e-d9d2-4bac-97cc-fb2384d358d1) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`product.addToFavorite`](/docs/assets/events/event-reference/items#productaddtofavorite) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`brickwork.generated`](/docs/assets/events/event-reference/brickworks#brickworkgenerated) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Brickworks](/docs/assets/brickworks) - [In-app messages](/docs/campaign/in-app-messages) - [Recommendations](/docs/ai-hub/recommendations-v2) # Cross-sell recommendations from different category Cross-sell recommendations are designed to surface complementary products that can be used together with the item currently viewed. Instead of showing similar or alternative items, it focuses on cross-selling by selecting products from different categories, encouraging broader exploration and potential basket building. In this use case, the recommendation returns from 6 to 12 items. A static filter ensures that **none of the recommended products share the same category as the context product**. For example, if the user is viewing a table, the system may suggest chairs, bookshelf — but not other tables. This approach helps avoid redundancy and instead promotes useful add-ons or combinations across categories. What is more we will promote and demote specific categories from search results. ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable cross-sell recommendation model. - Implement the [transaction events](/developers/web/transactions-sdk). ## Prepare an AI recommendations --- We will configure a cross-sell recommendation which returns up to 12 items. A static filter ensures that **none of the recommended products share the same category as the context product**. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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 an item feed. 5. In the **Type** section, choose the **Cross-sell** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot - here it will be from 6 to 12 items. 3. Define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters). 4. In our case, in the **Static filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **category**. 6. As an operator, choose **Not in**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Context** (eye icon). 7. As the value, choose `category`, to be sure that the category of recommended products will not be the same as the category of the currently viewed item. 8. In the **Category level** input area that appear, define the category level as a numeric value.
If your products categories have a `X > Y > Z` structure, level 0 will be `X > Y > Z`. Level 1 will be `X > Y` and so on. Here, you define how granular the category recommendations will be. For example, if you are selling shoes, you will have a `Outdoor > Sport > Running` category and a `Outdoor > Sport > Football` category. If level 0 is provided, both categories can be recommended. If level 1 is provided `Outdoor > Sport` category will be recommended to the user.
4. Confirm by clicking **Apply**. 8. Define the boosting rules by clicking **Define** in the **Boosting** section. 9. Click **Add rule**. 10. Click **Define rule** and choose **Visual builder**. 11. Click **Select value** and choose the **category**. 12. As an operator select **Not in**. 13. Click on **0 items** and select the categories you want to demote from the recommendatons results from the list. 14. Click **Apply**. 15. In the **Promote/Demote** selector, select **Demote**. 12. Use the slider to adjust how much you want the rule to affect the results.
Boosting itemsr
Boosting items
9. Click **Add rule**. 10. Click **Define rule** and choose **Visual builder**. 11. Click **Select value** and choose the **category**. 12. As an operator select **In**. 13. Click on **0 items** and select the categories you want to promote from the recommendatons results from the list. 14. Click **Apply**. 15. In the **Promote/Demote** selector, select **Promote** (default value). 12. Use the slider to adjust how much you want the rule to affect the results.
Screenshot of the boosting strength slider
The boosting strength slider
13. Click **Apply** to save changes.
Boosting itemsr
Boosting items
9. In the **Additional settings** section, choose **Exclude already bought products**. If your company sells replenishable products, you can set exclusion for specific number of days, for example, exclude products bought not later than 30 days ago. 9. In the right upper corner, click **Save**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/76urzbmYEpFE) in our Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Recommendations](/docs/ai-hub/recommendations-v2) # Predict churn Churn prediction is a business strategy that involves identifying customers who are likely to stop using a product or service in the near future. Churn prediction can help businesses reduce customer churn rates, increase customer loyalty, and improve overall business performance. With the Prediction feature you can create predictive models that accurately forecast customer behavior, enabling you to take targeted actions to reduce churn and improve customer satisfaction. In this use case, we will create a prediction which will help us identify customers likely to churn. As the prediction target we will use an expression with the segmentation of customers who had a transaction and have not visited our page in the last 30 days.
Churn prediction
Churn prediction
## Prerequisites --- - [Integrate JS SDK](/developers/web/installation-and-configuration). - [Enable the Custom prediction model](/docs/ai-hub/predictions/enabling-predictions#enabling-regression-and-classification-predictions). ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](#create-a-segmentation). 2. [Create an expression](#create-an-expression). 2. [Create a prediction](#create-a-prediction). ## Create a segmentation --- In this step, we create a group of customers who have made at least one transaction but have not visited the site in the last 30 days. This segmentation will be used in an expression in the next step. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New Segmentation**. 2. Optionally, switch the **Show in profile card** toggle on. 3. Enter the name of the segmentation. 4. From the **Add condition** dropdown list, select the `transaction.charge` event.
Events may have different labels between workspace, but you can always find them by their action name (in this step, it's **transaction.charge**).
5. Using the date picker in the lower-right corner, set the time range to **Relative time range > More > Lifetime**. 6. From the **Add condition** dropdown list, select the `Visited page` event. 7. Change **Performed** action to **Not performed**. 8. Using the date picker in the lower-right corner, set the time range to **Relative time range > Custom > Last 30 days**. 9. Save the segmentation. ## Create an expression --- In this part of the process, create an expression that will serve as the target for the prediction model. The expression will return `1` if a customer belongs to the previously defined segmentation and `0` if they don't. 10. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 11. Enter the name of the expression. 12. From the **Expressions for** dropdown list, select **Attribute**. Predictions work only with attribute expressions. 13. In the formula creator, click the **Select** node and from the drop-down list select **Function > If**. 14. As the first argument, select the segmentation you created earlier. 15. As the second argument, select **Constant** and set its value to `1`. 16. As the third argument, select **Constant** and set its value to `0`. 16. Save the expression.
The view of the configuration of the expression
Configuration of the expression
## Create a prediction --- 1. Go to AI Hub icon in left menu **(AI Predictions) Models > New prediction**. 2. In the upper-right corner, enter a name for the prediction. 3. In the **Prediction type** section, click **Define**. 4. Select **Classification** and click **Apply** ### Select the audience In this section you decide which segment of the customers should be taken into account while making a prediction. For every individual in the segment, Synerise produces a single prediction. Segmentations can be very complex and the possibilities of building the conditions are practically unlimited. In this example, a simple segmentation will include customers who have a marketing agreement. 1. In the **Audience** section, click **Define**. You can use existing segmentations. This example shows how to create a new one. 2. Click **Choose segmentation > Create new**. 3. Enter a segmentation name and click **Next step**. 4. Click **Choose filter**, from the dropdown list, select **Attribute> Email agreement**. 5. From the **choose operator** dropdown list, select **Equal (String)**. 6. In the text field, enter `enabled`. 7. Click **Create segmentation**. **Result**: The segmentation is saved as the audience of the prediction and also becomes available in the **Decision Hub** for other uses. 8. Click **Apply**.
The view of the configuration of the Audience
Audience configuration.
### Select prediction target 1. In the **What would you like to predict?** section, click **Define**. 2. Click **Select expression** and select the [expression created earlier](#create-an-expression). 3. Click **Apply**. ### Select inputs In this section, you set up input [features](/docs/glossary#feature) based on which the prediction model will be trained. It is possible to select feature inputs manually, but we recommend using the automatic selection, as explained below. Our algorithms evaluate feature relevance in context of the prediction target and are, in most cases, more effective than manual selection. 1. In the **Model inputs** section, click **Define**. 2. Click **Add feature > Automatically**. **Result:** The list is populated with input features. 3. Click **Apply**. ### Configure additional settings The additional settings define how often re-calculations are made and the content of events produced by the prediction. 1. In the **Settings** section, click **Define**. 2. From the **How many days in advance do you want to make a prediction** list, select **30 days**. 3. In the **Calculation frequency** section, select **Recurring calculation**. 4. From the **How frequently should the model be trained?** list, select **30 days**. 5. In the **Prediction start** section, select **Immediately**. 6. In **How would you like to display results**, select **5-point scale**. The algorithm detects the importance of a prediction. 7. In the **Define the value of the score name parameter** section, enter a user-friendly name for the prediction score. The name is shown as the value of the `scoreName` parameter in the `snr.prediction.score` event. 8. Click **Apply**. 9. To finish and calculate the prediction, click **Save & Calculate**. **Result:** The prediction results are saved as `snr.prediction.score` events in customer profiles. ## What's next --- You can use the prediction results in your work, for example to [Automated Emails for Customer Retention Using Churn Predictions](/use-cases/predictions-automation) or [Evaluate results of churn prediction](/use-cases/predictions-dashboard). A more advanced example of using a segmentation created from a churn prediction is described in [Promote discounted items to customers at risk of churn](/use-cases/boost-discounts-for-churn-risk). ## Check the use case set up on the Synerise Demo workspace --- You can check all configurations directly in Synerise Demo workspace: - [Segmentation](https://app.synerise.com/analytics/segmentations/81b51633-7dea-4c03-9d6a-9e385d337085) - [Expression](https://app.synerise.com/analytics/expressions/2f5a598f-56db-4aa3-914e-567ec5de135b) - [Audience segmentation](https://app.synerise.com/analytics-v2/segmentations/bd85a7e3-6700-4367-9906-471811dd1c76) - [Prediction](https://app.synerise.com/ai-v2/predictions/generic-scoring/bgycsoovxgby) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`snr.prediction.score`](/docs/assets/events/event-reference/predictions#snrpredictionscore) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Expressions](/docs/crm/expressions) - [Predictions](/docs/ai-hub/predictions) - [Segmentation](/docs/analytics/segmentations) # Automated email campaign performance reports Take your email performance tracking to the next level using the data context Jinjava tag. Automate the delivery of a detailed weekly report summarizing key metrics from your sent email campaigns, ensuring you stay informed and can take timely action. An alert can be sent through any channel, for example as an email, SMS or to an external tool such as Microsoft Teams or Slack. This particular use case shows how to send once a week an alert with data referencing email performance in the form of an email. To streamline implementation, a ready-made email template is included for a quick setup. ## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes). - [Configure email account](/docs/campaign/e-mail/configuring-email-account). ## Process --- In this use case, you will go through the following steps: 1. [Create an email template](#create-an-email-template) with the HTML block with accurate Jinjava tag. 2. [Create a workflow](#create-a-workflow) sending the notification. ## Create an email template --- You can use a [ready-made template with an HTML block](https://app.synerise.com/campaigns/email/content-manager/template/158990) (available on the Synerise Demo workspace) that inserts the data you want to send in a table format. Just copy it and edit according to your needs. 1. Click the table in the template, and then **Configure** on the right panel.
Email notification on email performance template
The configuration of the Email notification on email performance template
2. You can provide the name of the node and change the colors of the table in the configuration. 1. Click **Next**. 3. Edit the template according to your needs. 4. Click **Save as**. 5. On the pop-up, you can change the name and select the folder where the template will be saved. **Result**: The template is saved in the selected folder.
If you want to make your own template, you can switch to the html editing mode of this ready-made template, where you will find an example of jinjava syntax using data reference
## Create a workflow --- In this part of the process, prepare a workflow that sends an email message with a weekly report summarizing the key statistics of your sent email campaigns. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ## Define the trigger node --- At this stage, we will configure the conditions that launch the workflow. We will create a scheduled workflow, that starts every week on Monday at 9:45 A.M. 1. As the first node of the workflow, add **Scheduled Run**. In the configuration of the node: 1. In the **Run trigger** section, leave the default **all time** option. 2. In the **Repeat runs** section, choose suitable timezone. 3. To launch the workflow every week at the defined time, click the **Every week** tab below. 4. Select the desired day, in our case **Monday**. 5. Click **Add time** and set it according to your needs, in our case to `9:45`. 5. Confirm by clicking **Apply**.
Scheduled Run Node
The configuration of the Scheduled Run node
## Configure the Get Statistics Node --- As the next node, choose **Get Statistics** to retrieve email campaign statistics from a specified time range. 1. Click **Then** and add the **Get statistic** node. In the configuration of the node: 1. Select the **By time range** tab. 2. From the **Campaign type** dropdown list, select **Email**. 3. In the **Set time range** field, select the time range from which you would like to export the statistics. In our case, in the **Relative time range** section, select the **Last week** option. 5. The default setting includes statistics exclusively for campaigns sent through Experience Hub. If you also want to include statistics for campaigns launched through Automation Hub, enable the **Include automation statistics** option. If this option is selected, the output will include campaigns set up by Automation Hub that meet one of the following criteria: - the date of creation is within the indicated time range, - at least one sending event has occurred in the indicated time range. 6. Optionally, if you want to export variants of one campaign as separate records, enable the **Breakdown by variants** toggle.
By default, if statistics of a campaign selected for export contains more than one version (due to A/B testing), the statistics for each variant are a single aggregated record.

Campaign statistics data retrieved through the **Get Statistics** node before sending can be [transformed](/docs/automation/data-transformation-and-imports/introduction) to better align their format with specific requirements. To simplify building validation rules, you can download sample data in various formats (.csv, .json, .jsonl).
8. Confirm by clicking **Apply**.
Get Statistics Node
The configuration of the Get Statistics node
## Define the Email Alert Node --- 1. Click **Then** and add the **Email Alert** node. In the configuration of the node: 1. In the **Content** section, select [the email template created in the previous step](#create-an-email-template) and in the **Subject** field, enter your message subject. 2. In the **Recipient** section, use the text field to find recipients or enter an email address to add recipients outside the contact base. 3. Confirm the selection by clicking **Add**. 4. Optionally, you can save the list by clicking **Save list**. This way you can use this list in the future. 3. Confirm by clicking **Apply**.
Email Alert Node
The configuration of the Email Alert Node
## Add the finishing node --- 5. Add the **End** node. 6. In the upper right corner, click **Save & Run**.
Data Reference Workflow
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of every element of this process directly in Synerise Demo workspace: - [Configuration of the email template](https://app.synerise.com/campaigns/email/content-manager/template/158990), - [Configuration of the workflow](https://app.synerise.com/automations/workflows/automation-diagram/bbb24d8a-f1ae-44ac-a614-36d1f6f37667). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1). ## Read more --- - [Automation Inserts](/developers/inserts/automation#data-context) - [Creating email templates](/docs/campaign/e-mail/creating-email-templates) - [Creating workflows](/docs/automation/creating-automation) - [Get Statistics node](/docs/automation/actions/synerise-integrations/get-statistics) # Dynamic content campaign with personalized recommendations Creating personalized dynamic content tailored to the individual customer's journey, serves as a powerful communication channel. This strategic approach allows you to seamlessly connect with customers at precisely the right moment, delivering a message that resonates with their needs and preferences. In different industries, the objectives of dynamic messaging may vary, but one thing remains constant - the undeniable effectiveness of this form of communication. Its adaptability allows it to be used in countless ways, turning out to be a versatile tool in the arsenal. This use case illustrates how you can create your dynamic content using drag & drop builder and predefined HTML blocks with product recommendations.
Low stock campaign
## Prerequisites --- - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable personalized recommendations. - [Import your product feed to AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). ## Process --- In this use case, you will go through the following steps: 1. [Prepare AI recommendations](/use-cases/recommendations-bestsellers#prepare-ai-recommendation). 2. [Create dynamic content campaign](/use-cases/recommendations-bestsellers#create-dynamic-content). ## Prepare AI recommendation --- In this part of the process, you will create recommendations which will be used in dynamic content in the further part of the process. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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. Define the minimum and maximum number of products displayed in the frame according to your needs. 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.
Learn more about [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors) and [additional settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#additional-settings).
14. Click **Save**.
AI recommendation configuration
AI recommendation campaign configuration
## Create dynamic content --- In this part of the process, create a dynamic content campaign with personalized product recommendations using drag & drop builder and predefined HTML block with product recommendations. 1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Web layer** type. 4. As an audience, select the user segment for which you want to display the recommendation. ### Define Content 5. In the **Content** section, click **Define**. 6. In the **Content tab**, click **Create Message**. 6. In the upper right corner, click **+ New template**. 7. On the pop-up, select **Drag & Drop builder**. 8. Create a dynamic content template by customizing the message style and copy using standard design elements such as Title, Paragraph, List, Image, Button, Divider, Social, HTML, Icons and Menu. 9. Use **HTML blocks** element to add predefined product recommendations block. 1. On the right side of the screen, select and drag the **HTML blocks** element to the template. **Result**:
The HTML block added to the template
The HTML block added to the template
2. On the **HTML blocks** you added to the template, click **Configure**. **Result**: A pop-up appears.
Predefined blocks folder
Predefined blocks folder
3. Choose **Predefined blocks** folder. 4. Select block with recommended products. #### Edit the block in the Config tab The form in the **Config** tab is already filled with default values. You can keep them or change them to fit your business needs. 1. In the **Recommended products** section from the **Recommendation campaign ID** dropdown list, select the [recommendation you prepared in the previous step](/use-cases/dynamic-content-with-drag-and-drop-builder#prepare-ai-recommendation). You can find it by typing its name or ID in the search box. 2. In the section below, you have the option to customize width, number of products in row, product title font color, button background color, button font color, button border radius, button text. 3. After you make changes to the template, you can check the preview. 1. On the upper left side, click the **Preview Contexts** button. 2. Enter the ID of a customer. 3. Click **Apply**.
The view of the html block
Html block preview
9. To save this block as a template, click an arrow on the left to the **Next** button, and select **Save as**. On the pop-up, enter the name of the template and select the folder in which the template will be saved. 10. To use this block in a dynamic content template, click **Next**.
We recommend placing the HTML block as the sole element in the row. Additionally, ensure that the styling of the block is compatible with the styling of the template.
### Preview dynamic content template --- You can check the preview of the dynamic content directly in the template builder using [Preview Contexts](/docs/campaign/dynamiccontent/testing-dynamic-content/previewing-dynamic-content#preview-in-the-template-builder) option or you can use the [Live preview](/docs/campaign/dynamiccontent/testing-dynamic-content/previewing-dynamic-content#the-live-preview-option) option to see how dynamic content looks on the target website. 9. To save this dynamic content template, on the left to the **Next** button, click an arrow and select **Save as**. On the pop-up, enter the name of the template and select the folder in which the template will be saved. 10. To use this template in a dynamic content campaign, click **Next**. 11. Confirm by clicking **Apply**. ### Define schedule and display settings 9. In the **Schedule** section, select the date when the dynamic content is activated. 10. In **Display settings**, define the circumstances for displaying the content.
Instructions how to do it are available [here](/docs/campaign/dynamiccontent/creating-dynamic-content/creating-dynamic-content#schedule-dynamic-content).
11. Confirm by clicking **Apply**. 12. Optionally, you can define the UTM parameters for your dynamic content campaign. 13. Activate the dynamic content. ## What's next --- Feel free to choose any HTML block that fits your business campaign. Additionally, you can use the recommendation ID in various communication types, as explained [here](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distributing-recommendations). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [AI recommendation](https://app.synerise.com/ai-v2/recommendations/7NKlKKkRBQ2d), - [Dynamic content](https://app.synerise.com/campaigns/create/68ffe89d-bc76-41a2-9c1e-37dd79f8b4d0). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Dynamic content using drag & drop builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-drag-and-drop) - [Recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Using recommendations in dynamic content](/developers/inserts/recommendations-v2) # Dynamic SMS campaign with promotion at customer's preferred stationary store You can use SMS channel to effectively inform your customers about upcoming or ongoing promotions both in online or brick-and-mortar stores. The key to the success of these campaigns is personalization. Imagine you have a large customer base and you want to notify them about an exciting promotion in specific stores. Instead of creating multiple campaigns for each store, you can achieve this with just one campaign using Synerise. With Jinjava, you can effortlessly customize your message content. You can dynamically change store names, locations, and other crucial details with a simple Jinjava code. This means less work for you and more personalized experience for your customers.
Dynamic SMS campaign
This use case describes a scenario that begins by explaining how to assign IDS of customers' top-choice stores as attributes to their profiles. The further part of the process outlines how to create a dynamic SMS campaign targeting customers from the selected stores. Additional assumptions used in this use case: - The promotion is created on the client side, - The created catalog contains only those stores where the promotion is implemented, - Information about the current promotion is sent to users who have assigned a store ID to their profile. ## Prerequisites --- - Permissions that allow access to Catalogs section and adding new catalogs. - Prepare a CSV file with the stores where the promotion you are creating a campaign for will be available. The file used in this use case contains the following columns: `StoreId`, `StoreName`, `Street`, `City`.
Example file
Sample file
Sample file
- Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). Implement a custom parameter to the event that refers to the store where the transaction occurred. In this case, we will use the `StoreId` parameter. - Meet all requirements listed in the [introduction to SMS](/docs/campaign/SMS/introduction-to-sms#requirements). - Promotion must be implemented on the client side. ## Process --- 1. [Create an aggregate](/use-cases/dynamic-sms-campaign#create-an-aggregate) that identifies the top store for customers based on their transactions. 2. [Create a workflow](/use-cases/dynamic-sms-campaign#create-a-workflow-that-assigns-a-store-id-to-customer-profile) that assigns a store ID to customer profile. 3. [Create a catalog](/use-cases/dynamic-sms-campaign#create-a-catalog) with the store details. 4. [Prepare an SMS message template](/use-cases/dynamic-sms-campaign#prepare-an-sms-message-template). 5. [Create a workflow for the SMS campaign](/use-cases/dynamic-sms-campaign#create-a-workflow-for-the-sms-campaign). ## Create an aggregate --- Create an aggregate to find the top store for customer based on transaction history. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Top**. 4. From the **Choose event** dropdown list, select the **transaction.charge** event. 5. As the event parameter, select **StoreId**. 6. Using the date picker in the lower-right corner, set the time range to **Lifetime**. Confirm your choice with the **Apply** button. 7. Click **Save**.
Final configuration of the aggregate
Final configuration of the aggregate
## Create a workflow that assigns a store ID to customer profile --- Create a workflow that assigns a **StoreId** attribute to customers who do not have this attribute yet and update it for the customers who have switched to another store over time. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- 1. Add the **Profile Event** node. 2. From the **Choose event** dropdown list, select the **transaction.charge** event. 3. Click **Apply**. ### Define the Update Profile node --- In this part of the process, you will add an attribute **StoreId** to the customers who do not have this attribute yet and update it for the customers who have switched to another store over time. 1. Add the **Update Profile** node. 2. From the left dropdown list, select **Attributes > StoreId**. 3. From the right dropdown list, select **Change**. 4. In the text field, add a Jinjava with the ID of the aggregate [created earlier](/use-cases/dynamic-sms-campaign#create-an-aggregate). This Jinjava will return the top StoreId for the individual customer. Jinjava used in the use case:
{% aggregate 6b686d01-758f-328a-859b-91e3542c5bbe %} {{ aggregate_result[0] }} {% endaggregate %}
The above Jinjava contains the ID of the aggregate created in this use case. Make sure to replace this ID with the ID of your aggregate.
5. Click **Apply**. ### Add the final node --- 1. Add the **End** node. 3. Save and activate the automation by clicking **Save&Run**.
Automation Hub workflow for assigning the top-choice store ID as a customer profile attribute
Final configuration of the workflow
## Create a catalog --- In this part of the process, create a catalog and import there your CSV file you prepared as a part of prerequisites. 1. Go to **Data Modeling Hub > Catalogs > New Catalog**. 2. Enter the name of the catalog and confirm it by clicking **Apply**.
Don't use diacritical letters and spaces.
3. Click the catalog on the list and click **Import Local File**. If you prepared a CSV file in Excel, open it in a text editor to check whether commas are used as separators. If not, replace them with commas. 4. Click the **Upload a new file** button and select the file to be uploaded, then click the **Next** button. 5. You will see the information that your file has been successfully uploaded. To continue the import process, click the **Next** button. 6. In the **Primary key** field, type the name of the column whose values are treated as the key. In this case, it will be `StoreId`. To continue the process, click the **Next** button .
Catalog primary key configuration
Catalog primary key configuration
7. In the next screen you will find the summary of your import. If no changes are needed, click **Run import** button.
Import success
Import success
## Prepare an SMS message template --- Create a dynamic SMS template using Jinjava that customizes the store details for each customer. 1. Go to **Experience Hub > SMS**. 2. In the menu on the left, click **Templates**. 3. Click **Create new**. 4. Click **Text editor**. The text editor and SMS preview open. 5. In the text box on the right, enter the contents of your message. This use case uses the following content:
{% set mainShop = customer.StoreId %}
   {% catalogitemv2.UC-ShopsSale11092023(mainShop) %}
   Get ready for shopping at your favorite local spot, {{ catalog_result.StoreName }}! 🌟
   🎁 Enjoy jaw-dropping discounts of up to 30% off on absolutely everything in-store!
   📍 Find us at {{ catalog_result.Street }} in the heart of {{ catalog_result.City }}.
   {% endcatalogitemv2 %}
Where: - `StoreId` - the name of the attribute assigned to the user profile reflecting the store ID, - `UC-ShopsSale11092023` - is the name of the created catalog, - `StoreName`, `Street`, `City` - are the names of the columns defined in the catalog.
SMS template example
Example of a SMS template
6. Save the template. ### Create a workflow for the SMS campaign --- Create a workflow that sends a personalized SMS message to a selected segment of customers, informing them of a promotion at a store of their choice. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Audience node --- Choose the **Audience** node as the trigger. In this scenario, we are creating a group of customers who have agreed to receive SMS messages and have assigned StoreId attribute to their profile.
The audience should consist of users who have an attribute used as the **Primary key** in the catalog, otherwise the message will have an **sms.notSent** event with **Jinava rendering failed** as the parameter.
1. Start the workflow with the **Audience** node. 2. In the configuration of the node, leave the **Run trigger** as **one time**. 3. Choose the day and time when the process starts. 4. In **Define audience**, choose **New Audience** and define the conditions according to your needs. The following screen shows the audience configuration used in this use case.
Audience configuration
Audience configuration
### Define the Send SMS node --- 1. Add the **Send SMS** node. In the node settings: 1. In the **Content** section, choose the phone number from which the message will be sent. 2. From the **SMS template** drop-down, select [the template you created earlier in the process](/use-cases/dynamic-sms-campaign#prepare-an-sms-message-template). 2. Click **Apply**. ### Add the finishing node and set capping --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending a personalized SMS campaign about store promotions
Final 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](https://app.synerise.com/analytics/aggregates/6b686d01-758f-328a-859b-91e3542c5bbe) - [Workflow to assign StoreId to customer profile](https://app.synerise.com/automations/workflows/automation-diagram/73ee4841-ffc1-48b1-a273-3f3e58415aac) - [Catalog](https://app.synerise.com/assets/catalogs/182901) - [Workflow for the SMS campaign](https://app.synerise.com/automations/automation-diagram/4c02a16a-4455-4f31-bc50-1b2a2f563281) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~2), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~2), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1), [`sms.send`](/docs/assets/events/event-reference/sms#smssend) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [SMS campaigns](/docs/campaign/SMS) # Message Duplication Prevention for SMS Campaigns Based on Unique Phone Numbers This use case presents a solution to prevent sending the same message to the profiles who have the same phone number. Sharing the same phone number by profiles may happen for example, when a person leaves the company and a new employee takes over a work phone with the phone number of the previous employee; or when a person creates two accounts with different personal data but the same phone number. The core idea of this use case is to check the database for the same phone number and ensure that only one message is sent out when multiple profiles have the same number. This solution is designed to save costs and ensure that profiles do not receive unnecessary messages. The assumption of this use case is importing all customers with unique phone numbers and enabled marketing agreement in the SMS channel to a catalog. All these customers will have a `phone_unique` tag assigned to them. Then, every time a customer enables SMS marketing agreement a workflow will verify whether the phone number for this customer is unique. If so, it will be tagged with `phon_unique`.
We recommend using the `phone_unique` tag for addressing recipients in mass campaigns to all customers (for example, general information about important changes that do not contain personalization). It is not necessary for real-time campaigns, especially those triggered by specific user behaviors and activities such as entering a page, purchasing, and so on, because there is a small probability of sending the same message several times to one number. However, this risk is high with large and mass shipments. It is important to be careful with the personalization of such messages, especially without additional verification of ness of the phone number.
## Prerequisites --- - Create a catalog in Synerise in which you will store customers with unique phone numbers This will allow you to select customers with a `phone_unique` tag as the recipients of your future SMS campaigns - this way you will make sure each customer won't receive the same message several times. - In **Data Modeling Hub > Profile Tags**, [add the following tag](/docs/assets/tags): `phone_unique` It will be used later in the process. - Create a workspace [API Key](/docs/settings/tool/api) which you will use in the process. ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](/use-cases/double-phone-number#create-a-segmentation) to group customers who have a phone number assigned and enabled marketing agreement in the SMS channel. 2. [Create a workflow which sends the customers from the segmentation to the catalog](/use-cases/double-phone-number#create-a-workflow-which-sends-the-customers-from-the-segmentation-to-the-catalog). 3. [Download the file with customers from the catalog](/use-cases/double-phone-number#export-the-file-from-the-catalog). 4. [Transform data](/use-cases/double-phone-number#transform-data) in the file: add a column with a `phone_unique` tag, remove `item_key` column, and rename the `id` column. 5. [Create a workflow which imports the modified file with customers to Synerise](/use-cases/double-phone-number#create-a-workflow-which-imports-the-modified-file-with-customers-to-synerise). 6. [Create a workflow that verifies uniqueness of the phone number and assigns a tag to a customer](/use-cases/double-phone-number#create-a-workflow-that-verifies-uniqueness-of-the-phone-number-and-assigns-a-tag-to-a-customer). 7. [Create a workflow that deletes a tag when a customer withdraws consent for receiving SMS](/use-cases/double-phone-number#create-a-workflow-that-deletes-a-tag-when-a-customer-withdraws-consent-for-receiving-sms). ## Create a segmentation --- In this part of the process, you will create a segmentation of customers who have a phone number and enabled a marketing agreement in the SMS channel. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. From the **Add condition** dropdown list, select the `phone` attribute. 4. Click the **Choose** button, and from the list of operators, choose **Boolean**, and then select **Is true**. 5. From the **Add condition** dropdown list, select the `SMS agreement` attribute. 6. Click the **Choose** button, and from the list of operators, choose **Boolean**, and then select **Is true**. 7. Save the segmentation.
Decision Hub segmentation configuration filtering customers with a phone number and SMS agreement
Segmentation configuration
## Create a workflow which sends the customers from the segmentation to the catalog --- In this part of the process, you will create a workflow that imports customer data (phone number) to a file and sends it to the catalog you created as a part of prerequisites. The data will be deduplicated, which means the catalog will contain only unique phone numbers. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, configure the conditions that trigger the workflow. 1. As the trigger node, select **Scheduled Run**. 2. In the configuration of the node: 1. Select the **Run once** option. 2. Choose the **Immediately** option. 3. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configured for a one-time immediate run to trigger customer data export to catalog
The configuration of the Scheduled Run node
### Select customers to export --- In this part of the process, select a [segmentation of customers you created in the previous part of the process](#create-a-segmentation). Then, you will select the attribute (`phone`) whose value will be exported to a catalog in further steps. 1. Add the **Get Profiles** node. 2. In the configuration of the node: 1. Select **Segments** and then the segmentation you [created in the previous step](#create-a-segmentation) to extract customers’ data. 2. In the **Attributes values** section, select **phone**. 3. Confirm by clicking **Apply**.
Automation Hub Get Profiles node selecting customers by segmentation with phone attribute to export
The configuration of the Get Profiles node
### Add the Import to Catalog node --- In this part of the process, select a catalog to which the customer data will be imported. 1. Add the **Import to Catalog** node. 2. In the configuration of the node: 1. Select the catalog created as a part of the prerequisites to which the data will be imported. 2. In the **Primary key** field, enter the `phone` attribute. 3. Select **Import mode** as **Create or overwrite records**. 4. Confirm by clicking **Apply**.
The configuration of the Import to Catalog node
The configuration of the Import to Catalog node
### Prepare the final settings --- 1. Add the **End** node and connect it to the **Import to Catalog** node. 2. Optionally, add titles to each node so the workflow will be more understandable to your colleagues.
Screenshot presenting workflow
Prepare workflow
3. Activate the workflow by clicking **Save & Run**. **Result**: The data will be sent to a catalog and de-duplicated during import. ## Export the file from the catalog --- In this part of the process, you will download the file you imported to the catalog. 1. Go to **Data Modeling Hub > Catalogs**. 2. Choose the catalog from the list. 3. To download the file with your data, click **Download CSV**. In the next step, you will use the exported file to create a transformation which you will use further in the process in the Data Transformation Studio node. ## Transform data --- In this part of the process, you will perform the following modifications to the file: - remove the `item_key` column - rename the `id` column to `clientId` - add the `tags` column with the `phone_unique` value 1. Go to Automation Hub icon **Automation Hub > Transformations > New transformation**. 2. Enter the name of the transformation. 3. Click **Upload a new file or drag one here**. ### Add file with sample data --- Upload a file to add the sample data to be modified. In further steps, you define how the data in the file will be modified. Later, when this transformation is used in the workflow in the [Data Transformation Studio node](/docs/automation/operation/data-transformation-node), the system uses the rules to transform a file selected in the workflow. 1. Upload the file exported in [the previous step](/use-cases/double-phone-number#export-the-file-from-the-catalog). 2. Click **Apply**. ### Remove Columns --- Use the **Remove Columns** step, which allows you to remove the `item_key` column. 1. On the right panel, click **Add step**. 2. From the dropdown list, select **Remove Columns**. 3. In the configuration of the step: 1. Leave the **Remove** option selected in the dropdown menu. 2. Leave the default value in the dropdown (**Equal**). 3. In the text field, enter `item_key`.
The configuration of the Remove Columns step
The configuration of the Remove Columns step
4. Confirm by clicking **Apply**. ### Rename Columns --- In this part of the process, change the name of the `id` column to `clientId`. 1. On the right panel, click **Add step**. 2. From the dropdown list, select **Rename Columns**. 3. Click the **Rename Columns** step. 4. In the configuration of the step: 1. Select the **id** column. 2. Under **Rename by**, select **Replacing**. 3. In the text field, enter `clientId`.
The configuration of the Rename Columns step
The configuration of the Rename Columns step
5. Confirm by clicking **Apply**. ### Add the new column --- In this part of the process, you will add the new `tags` column with the `phone_unique` value. 1. On the right panel, click **Add step**. 2. From the dropdown list, select **Add Column**. 3. Click the **Add Column** step. 4. In the configuration of the step: 1. In the **Add Column** field, enter the name of the column. In this use case, it's `tags`. 2. From the dropdown list, select **Static value**. 3. In the value box, enter `phone_unique`. 4. Leave **Handle incomplete data** at default (**Skip row if error occurred**) to skip missing or invalid data which may occur during transformation. 5. Confirm by clicking **Apply**.
The configuration of the Add Column step
The configuration of the Add Column step
### Preview and save the transformation --- 1. Preview the final results in the **Output** tab.
The preview of modifications to the file
The preview of modifications to the file
2. In the upper right corner, click **Save**.
Transformation for processing customer data to handle duplicate phone numbers
The transformation configuration
## Create a workflow which imports the modified file with customers to Synerise --- In this part of the process, you will create a workflow that applies the transformation you created in the [previous part of the process](#transform-data) to the file with customers data and import the modified file to Synerise. As a result, the profiles will be updated. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, you will define the conditions that launch the workflow. 1. As the trigger node, add **Scheduled Run**. 2. In the configuration of the node: 1. Select the **Run once** option. 2. Choose the **Immediately** option. 3. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configured for a one-time immediate run to trigger modified customer data import to Synerise
The configuration of the Scheduled Run node
### Select file to import --- Select the file you exported in [part of the process](#export-the-file-from-the-catalog). 1. Add the **Local File** node. 2. In the configuration of the node: 1. Upload the file. 2. Confirm by clicking **Apply**.
Local File transfer
Local File transfer
### Select the transformation --- Select the transformation you created [in this part of the process](#transform-data). 1. Add a **Data Transformation Studio** node. 2. In the configuration of the node, keep the default **From workflow context** option. 3. In the editor, click **Templates library**: 1. Select the [transformation you have created before](#transform-data). 2. Click **Use template**. 4. Confirm by clicking **Apply**.
The configuration of the Data Transformation Studio node
The configuration of the Data Transformation Studio node
You can also create a transformation directly in the **Data Transformation Studio** node instead of selecting a template.
### Add import profiles and finishing node --- In this part of the process, you will import the transformed file with customers to Synerise. 1. Add the **Import Profiles** node. 2. Add the **End** node. 3. In the upper right corner, click **Save & Run**.
Automation Hub workflow for handling customers with duplicate phone numbers
The workflow configuration
## Create a workflow that verifies uniqueness of the phone number and assigns a tag to a customer --- In this part of the process, you will create a workflow that is launched when a customer enables marketing agreement in the SMS channel. The workflow checks whether the phone number is unique, if so the customer is assigned with a `phone_unique` tag and the catalog which stores unique phone numbers is updated. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- The workflow is triggered by **Profile Event** where the triggering event is `profile.updated` with the `profile.receivesmses` parameter which is set to true. 1. Add the first node - **Profile Event**. In the node configuration: 1. From the **Choose event** dropdown list, choose the **profile.updated** event. 2. Click where icon button. 3. From the **Choose parameter** dropdown list, select **profile.receivesmses**. 4. From the **Choose operator** dropdown list, select **Is true(Boolean)**. 2. Click **Apply**.
The view of the Profile Event node configuration
Configuration of the Profile Event node
### Add the Profile Filter node --- In the next stage, using the Profile Filter node, you check if the customer already has the `phone_unique` tag and phone number. You take into account customers who have phone but do not have the `phone_unique` tag. 1. Add the **Profile Filter** node. 2. In the settings of the node, choose **Profiles > Attributes** and select the `phone_unique` tag. 3. As **Operator**, choose **Boolean - Is true** and modify the "Profile `matching` attribute" to "`not matching` attribute." 4. Click **Choose filter** and select the attribute `phone`. 5. As the **Operator**, choose **Boolean - Is true**. 6. Click **Apply**. 7. For the **Not Matched** path, add the **End** node. 8. Click **Apply**.
Automation Hub Profile Filter node checking customer has a phone number but does not have the phone_unique tag
The Profile Filter node configuration
### Configure the Outgoing Integration node --- In this part of the process, you will send a request to [retrieve all items from the catalog](https://hub.synerise.com/api-reference/data-management#tag/Catalogs/operation/getItemsByBag) to check if the phone number exists in the catalog. 1. To the **Matched** path, add the **Outgoing Integration** node. In the configuration of the node: 1. Choose **Custom webhook**. 2. In the **Webhook name** field, enter `getPhoneFromCatalog`. 3. In the **URL** section: 1. Choose the **GET** method. 2. Enter the following endpoint: `https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}`, replace `XXXX` with the ID of your catalog. 4. As the method of authorization, select **by API key**. 5. From the dropdown list, select the API key you created as a [part of prerequisites](#prerequisites). 2. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to check if a phone number exists in the catalog
Webhook settings
### Configure the Event Filter node The workflow will wait for the webhook to return the value of the body.metaData.totalCount parameter. If it's other than 0, the workflow will end. If it is 0, the profile will be updated with the `phone_unique` tag. 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 5 minutes. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `webhook.response` event. 4. Click the **+ where** button and select `name`. 5. As the logical operator, select **Equal (String)**. 6. As the value, add the name of the event used in the previous node: `getPhoneFromCatalog`. 7. Click the **+ where** button and select `body.metaData.totalCount`. 8. As the logical operator, select **Equal (Number)**. 9. As the value, add `0`. 2. Click **Apply**. 3. For the **Not matched** path, add the **End** node.
Event Filter node settings
Event Filter node settings
### Add the Update Profile node --- 1. For the **Matched** path, add the **Update Profile** node. 2. From the dropdown list, select **phone_unique** tag. 3. Leave the right dropdown list at default (**Add**). 4. To save the changes, click **Apply**.
Screenshot presenting update profile node
The configuration of the Update Profile node
### Configure the Outgoing Integration node --- In this step, [your catalog with unique phone numbers will be updated](https://hub.synerise.com/api-reference/data-management#tag/Catalogs/operation/addItems). 1. Add **Outgoing Integration** node. In the configuration of the node: 1. Choose **Custom webhook**. 2. In the **Webhook name**, enter `addPhoneToCatalog`. 3. In the **URL** section: 1. Choose the **POST** method. 2. Enter the following URL: `https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}`, where `XXXX` is the ID of your catalog. 4. In the **Body** section, enter:
{
           "itemKey": "{{client.phone}}",
           "value": {
           "id": "{{client.id }}",
           "phone": "{{client.phone}}"
           }
           }
5. As the authorization method, select **by API key**.
Automation Hub Outgoing Integration node configured as a webhook to add a phone number to the catalog
Webhook settings
### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for verifying phone number uniqueness and assigning the phone_unique tag
The workflow configuration
## Create a workflow that deletes a tag when a customer withdraws consent for receiving SMS --- The next step is to create a workflow that will be triggered when a customer withdraws their consent. The workflow has similar structure to the previous one. What changes here is the trigger, instead of Profile Event, you will use the Audience node that is repeatedly triggered, for example every day, at a certain time. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- The workflow is triggered for specific group of customers every day at a defined time. 1. Start the workflow with the **Audience** node. 2. In the configuration of the node, set the **Run trigger** option to **repeatable**. 3. Set the interval to 1 per day. 4. Choose the day and time when the process starts. 5. Select the time zone. 6. In **Define audience**, choose **New Audience** and click **Define conditions**. Our audience will be a group of users who has `phone_unique` tag and change their sms agreement. 1. As the first condition, from the **Choose filter** dropdown menu, choose `phone_unique` attribute. 2. Choose operator as **Is true (Boolean)**. 3. As the second condition, from the **Choose filter** dropdown menu, choose the `SMS agreement` attribute. 4. Choose operator as **Equal (String)** and add the value. In our case it will be `false`.
Configuration of the Segment in the Audience node
Configuration of the segmentation in the Audience node
7. Click **Apply**.
Automation Hub Audience node configuration for targeting customers with unique phone numbers
Configuration of the Audience node
### Add the Profile Filter node --- In the next stage, using the Profile Filter node, you check if the customer has the `phone_unique` tag and phone number. 1. Add **Profile Filter** node. 2. In the settings of the node choose **Profiles > Attributes** and select the tag `phone_unique`. 3. As the **Operator**, choose **Boolean - Is true**. 4. Click **Choose filter** and select the attribute `phone`. 5. As the **Operator**, choose **Boolean - Is true**. 6. Click **Apply**. 7. For the **Not Matched** path, add the **End** node.
Automation Hub Profile Filter node checking customer has both the phone_unique tag and a phone number
The Profile Filter node configuration
### Configure the Outgoing Integration node --- In this part of the process, you will send a request to [retrieve all items from the catalog](https://hub.synerise.com/api-reference/data-management#tag/Catalogs/operation/getItemsByBag) to check if the phone number exists in the catalog. 1. To the **Matched** path, add the **Outgoing Integration** node. In the configuration of the node: 1. Choose **Custom webhook**. 2. In the **Webhook name** field, enter `getPhoneFromCatalog`. 3. In the **URL** section: 1. Choose the **GET** method. 2. Enter the following endpoint: `https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}`, replace `XXXX` with the ID of your catalog. 4. As the method of authorization, select **by API key**. 5. From the dropdown list, select the API key you created as a [part of prerequisites](#prerequisites). 2. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to check if a phone number exists in the catalog
Webhook settings
### Configure the Event Filter node --- The workflow will wait for the webhook to return the value of the body.metaData.totalCount parameter. If it's equal 0, the workflow will end, because it means that the number is not in the catalog and no need to remove the tag since the number was not unique and the workflow ends. If it's 1, it means the number exists in the catalog because it was unique and the workflow must go on. 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 5 minutes. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `webhook.response` event. 4. Click the **+ where** button and select `name`. 5. As the logical operator, select **Equal (String)**. 6. As the value, add the name of the event used in the previous node: `getPhoneFromCatalog`. 7. Click the **+ where** button and select `body.metaData.totalCount`. 8. As the logical operator, select **Equal (Number)**. 9. As the value, add `1`. 2. Click **Apply**. 3. For the **Not matched** path, add the **End** node.
Event Filter node settings
Event Filter node settings
### Add the Update Profile node --- 1. For the **Matched** path, add the **Update Profile** node. 2. From the dropdown list, select **phone_unique** tag. 3. Click the right dropdown list and select **Remove**. 4. To save the changes, click **Apply**.
Screenshot presenting update profile node
The configuration of the Update Profile node
### Configure the Outgoing Integration node --- In this step, [you will remove a customer with their phone number from the catalog](https://hub.synerise.com/api-reference/data-management#tag/Catalogs/operation/deleteItem). 1. Add the **Outgoing Integration** node. In the configuration of the node: 1. Choose **Custom webhook**. 2. In the **Webhook name** field, enter `removePhoneFromCatalog` 3. In the **URL** section: 1. Choose the **DELETE** method. 2. Enter the following URL: `https://api.synerise.com/catalogs/bags/XXXX/items/{{event.params['body.data[0].id']}}`, where `XXXX` is the ID of your catalog. 4. As the authorization method, select **by API key**. 5. From the dropdown list, select the API key you created as a [part of prerequisites](#prerequisites). 2. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to remove a phone number from the catalog
Webhook settings
### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for removing the phone_unique tag when a customer withdraws SMS consent
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [segmentation configuration](https://app.synerise.com/analytics-v2/segmentations/8e08c002-e0bf-4e66-bb28-7bf276918ee0) - [workflow configuration](https://app.synerise.com/automations/automation-diagram/cd94653c-b2a6-43c2-afa8-7090dee0d81e) - [transformation](https://app.synerise.com/automations/data-transformation/8888bd88-53a8-4f3a-89c6-93fddf4e6392) - [workflow which imports modified file with customers back to Synerise](https://app.synerise.com/automations/automation-diagram/3f15df7f-10fb-428c-aa52-047d56dfe7d9) - [workflow which updates the customer's profile](https://app.synerise.com/automations/automation-diagram/9bf58473-d660-4f4b-a7be-61b4605b0673) - [workflow that deletes a tag when a customer withdraws consent for receiving SMS](https://app.synerise.com/automations/automation-diagram/afbc1610-892e-43cb-ac8c-e6e49eea56f3) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~2), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~5), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~2). ## Read more --- - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Data Transformation](/docs/automation/data-transformation-and-imports) - [Import](/docs/assets/imports/introduction-to-imports) - [Segmentation](/docs/analytics/segmentations) - [SMS campaigns](/docs/campaign/SMS) # Calculate transactions with the use of promotional codes To implement effective promotional campaigns, it is important to carefully analyze the results of past campaigns, draw conclusions and use this knowledge in the future. This use case describes how to calculate the number of transactions with the use of promotional codes. ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration). - Implement [transactional events](/developers/web/methods-reference#tracking-transactions). - Create and activate a [promotion](/docs/ai-hub/promotions). ## Process --- In this use case, you will go through the following steps: 1. [Prepare a regular expression](/use-cases/event_data_modification#prepare-a-regular-expression). 2. [Create an expression](/use-cases/event_data_modification#create-an-expression). 3. [Create an aggregate](/use-cases/event_data_modification#create-an-aggregate). 4. [Create a metric](/use-cases/event_data_modification/#create-a-metric). ## Prepare a regular expression --- When a promotion is assigned to a customer, the event appears on the customer’s profile (for example, a `handbill.assign` event). This event contains a parameter (in this use case, `promo3`) with the promotion number. If a customer uses the promotion code during the purchase, a transaction event appears on the customer’s profile with the parameter that contains the promotion number as well. However, the values of these parameters are slightly different for the two events. In the transaction event, two zeros at the beginning of the promotion number are deducted, so the challenge is to turn these values into an identical format as it is in the **handbill.asign** event.
Comparison of the handbill.assign and transaction event
Comparison of the handbill.assign and transaction event
For this purpose, prepare a regular expression that will extract the number of promotion from the parameter of the transaction event. In our use case, the regular expression will take the following form `(?<="promoId":")(.+?)(?=\"|$)`. You will use it in the next part of the procedure.
The regular expression matches a promoID in an example value of the transaction event parameter
The regular expression matches a promoID in an example value of the transaction event parameter
## Create an expression --- Create an expression for the transaction event. Using the **Concat** function in the expression, add two zeros to the **loyalRewards** parameter (which contains the number of the promotion). As a result, the two zeros are added at the beginning of the promotion number and the expression returns the number of promotion which matches the number of promotion in the **handbill.asign** event. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression. 3. Set the Expression for option to **Event**. 4. From the dropdown list, select **transaction.charge**. 5. In the Formula definition section of the page, click **Select**. Result: A dropdown list appears. 6. From the list that opens, select **Function > Concat**. 7. In the brackets, click the left **Select** button and from the list, select again **Function > Concat**. 8. In the brackets, click the left and right Select button from the list and select **Constant** with value `0`. 9. After the brackets click the **Select** button and from the list select **Function > Regexp**. 10. In the brackets, click the left Select button and from the list, select **Event attribute loyalRewards**. 11. Click the right **Select** button and from the list, select **Constant** with value `(?<="promoId":")(.+?)(?=\"|$)`. 12. Save the expression.
Expression adding zeros to the parameter
Expression adding zeros to the parameter
## Create an aggregate --- In this part of the process, create an aggregate that returns the id of the assigned promotion from promo3 parameter. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **Last Multi**. 3. In the Size field choose how many values you would like to return. 4. Select **Consider only distinct occurrences of the event parameter**. 5. Select the **handbill.assign** event. 6. Select the **promo3** parameter. 7. Select the **id** and **variantName** parameter for which you want to get results.
An aggregate that will return the most recently assigned promotions
An aggregate that will return the most recently assigned promotions
## Create a metric --- In this step you will create a metric that calculates the number of transactions made by customers who had the promotional code assigned to their profile and used it during the purchase process. 1. Go to Behavioral Data Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. Leave the Aggregator at default **(Count)**. 4. Select the **product.buy event**. 5. Add the ”**promoId z loyalRewards**” parameter - additional parameter created with [expression](/use-cases/event_data_modification#create-an-expression). 6. Select **In** operator. 7. Keep clicking the icon next to the logical operator until you get **Choose value** button. 8. Select the aggregate that returns last multi assigned personalized promotions created in [this step](/use-cases/event_data_modification#create-an-aggregate). 9. Add a filter with people who had a `handbill.assign` event from a specific campaign id. 10. Select the date range of the metric. 11. Save the metric.
Metrics configuration
Metrics configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of every element of this process directly in Synerise Demo workspace: - [Expression](https://app.synerise.com/analytics/expressions/c0d65888-178e-4c48-84f1-f348b553c486) - [Aggregate](https://app.synerise.com/analytics/aggregates/f1b6d24c-8541-3f85-b7e5-ec5482d0c3f4) - [Metric](https://app.synerise.com/analytics/metrics/44da8800-568f-4f1c-9014-0627580225f1) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) # In-App Swipe Campaign for Gathering Customer Preferences In-app campaigns are designed to enhance the customer experience in the mobile application. Thanks to them, on the one hand, we are able to present personalized products based on the analysis of customers behavior and activities. As a result, you always reach your target group with relevant, personalized messages tailored to each customer's specific actions. We can also go a step further and give the customer the opportunity to decide for themselves what products they really like and what are their preferences. One of such actions may be adding a product to your favorites. This activity can be used as a trigger for the campaign which displays the current bestsellers. Based on the swipe mechanism, customer can either like specific product or reject and see another product. In this way, we get to know the customer's taste and preferences better. The products you show to your customers depend on your business needs. These could be bestsellers, but you can also specify a static group of products or use other type of AI recommendations. Moreover, products marked as liked or disliked by the customer can be used in further communication with them. You can boost recommendation campaigns results with the liked products or filter the campaigns and exclude products that were disliked. The results of AI campaigns can be used in personalized mailings and in any other touchpoint, ensuring that you show customers only products they really like. In this use case, we will describe the process of creating an in-app mechanism presenting bestsellers with the swiping system. The campaign will be displayed after the customer adds any product to the favorites. The customer has the option of swiping the products to the right or left and based on the customer decision an event with information that someone like/dislike the specific product is send to Synerise. The mechanism consists of two in-app campaigns: one to display the bar at the bottom of the screen encouraging to display bestsellers, and second one, appearing after clicking the bar, with the proper swiping system.
In-app message example
## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search). Enable **Top items** recommendations. - Implement the `product.addToFavorite` event in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-favorites). The event must be sent to Synerise after adding any product to favorites by the customer. - In **Data Modeling Hub > Events**, [configure the event actions](/docs/assets/events/event-definitions#adding-event-definitions) that your in-app campaign will use to trigger displaying of the swipe mechanism and to send data about liking/disliking a product. In the JS SDK event settings section, you should set the way of authorizing these events to **Make this event available to anonymous profiles without JWT**. In this use case, the event actions are `preferences.action` and `preferences.trigger`. ## Process --- In this use case, you will go through the following steps: 1. [Create AI recommendations](/use-cases/in-app-bestsellers#create-ai-recommendations) with bestsellers. 2. [Create an in-app campaign to propose the swiping mechanism](#create-an-in-app-campaign-to-propose-the-swiping-mechanism) presenting the bar encouraging to display bestsellers after adding any product to favorites. 3. [Create an in-app campaign to display the swiping mechanism](#create-an-in-app-campaign-to-display-the-swiping-mechanism) presenting bestselling products with a swipe mechanism after clicking the bar. ## Create AI recommendations --- In this stage, you will create an AI recommendation campaign which will be used to display products in your in-app message. The customer will have the ability (implemented in the next stage by using an in-app campaign) to express liking or disliking the presented products. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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. 5. Select the **Top products** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 6. In the **Items** section, click **Define**. 7. Click **Add slot**. 8. Click the **Unnamed slot** that was created. 8. Define the minimum and maximum number of products displayed in the frame according to your needs. 9. In **Static filters**, select the **availability** parameter and set it to **is defined**, so the recommendations will show only available items. 9. Optionally, you can use filters to include specific items in the recommendation frame. 10. Confirm the configuration by clicking **Apply**. 10. In the **Additional settings**, click **Define**. 11. From the **Sort metric** dropdown list, select **Sold items count in the last 7 days**. 12. Confirm the configuration of **Additional settings** by clicking **Apply**. 12. Click **Save**.
AI recommendation configuration
AI recommendation campaign configuration
## Create an in-app campaign to propose the swiping mechanism --- In this part of the process, you create an in-app campaign triggered by the `product.addToFavorite` event. After that, the bar encouraging to display bestsellers is displayed. The campaign lets the customer decide if they want to launch the swiping mechanism with the proposed products. The ready-to-use code presented below generates a custom event (`preferences.trigger`) after the customer clicks the bar. This event triggers the second in-app campaign, described [further in this article](#create-an-in-app-campaign-to-display-the-swiping-mechanism). 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create in-app** 2. Enter a meaningful name for the in-app campaign. 3. In the **Audience** section: 1. Click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. 4. In the **Content** section: 1. Click **Define**. 2. Click **Create message** and select **Code Editor** 3. Create the content of your in-app campaign. You can reuse the code snippets presented below in your in-app template.
Check the HTML code
<div class="in-app-wrapper bottom_bar"> <div class="in-app-close"> <svg viewBox="0 0 24 24" class="close-m"> <path fill="none" d="M0 0h24v24H0z"></path> <path d="M13.06 12l4.72-4.72a.75.75 0 00-1.06-1.06L12 10.94 7.28 6.22a.75.75 0 00-1.06 1.06L10.94 12l-4.72 4.72a.75.75 0 101.06 1.06L12 13.06l4.72 4.72a.75.75 0 001.06-1.06z"> </path> </svg> </div> <div class="in-app-content"> <p class="in-app-title">Do you like our products?</p> <p class="in-app-subtitle">Let us know your taste 🔥</p> </div> </div>
Check the CSS code
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;900&display=swap"); .in-app-wrapper.bottom_bar { margin: 15px; background-color: whitesmoke; height: 95px; border-radius: 30px; box-shadow: 0 0px 10px 0 rgba(35, 41, 54, 0.2); display: flex; flex-direction: column; flex-wrap: nowrap; align-content: center; justify-content: center; align-items: center; } .in-app-close { cursor: pointer; position: absolute; padding: 10px; top: 15px; right: 15px; } .in-app-close svg { width: 32px; height: 32px; } .in-app-content { text-align: center; } .in-app-title { margin: 0; font-weight: 600; font-size: 20px; margin-bottom: 2px; font-family: "Nunito", sans-serif; } .in-app-subtitle { margin: 0; font-size: 14px; font-family: "Nunito", sans-serif; }
Check the JS code
(function () { var inApp = document.querySelector('.in-app-wrapper.bottom_bar'); var close = inApp.querySelector('.in-app-close'); close.addEventListener('click', function () { SRInApp.close(); }) var content = inApp.querySelector('.in-app-content'); content.addEventListener('click', function () { SRInApp.close(); setTimeout(function() { SRInApp.trackCustomEvent('preferences.trigger', {}, 'Preferences trigger event'); }, 0) }) })();
1. In the **Trigger events** section: 1. Click **Define**. 2. Select **Add event** and from the dropdown list, choose the `product.addToFavorite` event. 2. Click the **+ where** button and as the parameter, choose `source`. 3. As the logical operator, select **Contain** and as the value add **MOBILE** to analyze events only from the mobile application. 4. Click **Apply**.
Trigger event settings
Trigger event settings
1. In the **Schedule** section: 1. Click **Define**. 2. Choose the **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Change**. 2. Define the **Delay display** as **0** and **Priority index** as **2**.
The mobile application can display one in-app message at a time. If the conditions allow the triggering of several in-apps at a time, the priority is a decisive factor for displaying the message. The messages with lower priority aren’t queued for displaying after the first one is closed.
3. Enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we set it to once per day. 3. Click **Apply**. 1. Optionally, you can define the **UTM parameters**. Otherwise, click **Skip step**. 2. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**.
In-app campaign settings
In-app campaign settings
## Create an in-app campaign to display the swiping mechanism --- In this part of the process, you create an in-app campaign triggered by the `preferences.trigger` event. After that, the AI recommendation campaign with top products will be displayed. The campaign lets the customer swipe and like or reject displayed products. The ready-to-use code presented below generates a custom event telling you which products the customer liked/disliked. 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create in-app** 2. Enter a meaningful name for the in-app campaign. 1. In the **Audience** section: 1. Click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. 1. In the **Content** section: 1. Click **Define**. 2. Click **Create message** and select **Code Editor**. 2. In the right upper corner, change the **Bottom bar** default option to **Fullscreen** by using the dropdown menu. 2. Create the content of your in-app campaign. You can reuse the code snippets presented below in your in-app template.
Check the HTML code
<div class="in-app-close" style="width: 100%;text-align: right;width: 90%;"> <svg viewBox="0 0 24 24" class="close-m"> <path fill="none" d="M0 0h24v24H0z"></path> <path d="M13.06 12l4.72-4.72a.75.75 0 00-1.06-1.06L12 10.94 7.28 6.22a.75.75 0 00-1.06 1.06L10.94 12l-4.72 4.72a.75.75 0 101.06 1.06L12 13.06l4.72 4.72a.75.75 0 001.06-1.06z"> </path> </svg> </div> <div class="frame"></div> <div class="icons"> <svg id="hate" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128.07 127.89"> <path class="a" d="M128.07,64.07c-.5,36.31-28,63.57-64,63.82S-.17,99.33,0,63.29C.17,28.25,29.23-.3,64.43,0A63.88,63.88,0,0,1,128.07,64.07ZM45.32,38.54c-2.44.36-4.63,1.12-6,3.68a6.39,6.39,0,0,0,.94,7.83A143,143,0,0,0,50.42,60.36c2.73,2.48,3.44,4.31.2,7a98.44,98.44,0,0,0-9.52,9.53c-3.62,4-3.66,7.48-.47,10.59,2.82,2.76,7.12,2.54,10.7-.79,3.05-2.83,5.91-5.86,8.85-8.8,2.58-2.57,5.16-2.53,7.73,0,2.83,2.81,5.62,5.67,8.52,8.42,3.87,3.68,8.08,4.08,11,1.15,3.23-3.21,3-6.85-.83-11C83.57,73.21,80.44,70,77.1,67c-2.37-2.13-2.71-3.65-.13-5.91,3.24-2.85,6.15-6.08,9.2-9.15,4.17-4.2,4.66-8,1.45-11.34-2.93-3-7.58-2.61-11.49,1.19-3.34,3.25-6.66,6.52-9.85,9.91-1.64,1.74-2.85,1.73-4.49,0-3.32-3.5-6.84-6.81-10.21-10.26A9,9,0,0,0,45.32,38.54Z" /> <path d="M45.32,38.54a9,9,0,0,1,6.26,2.87c3.37,3.45,6.89,6.76,10.21,10.26,1.64,1.73,2.85,1.74,4.49,0,3.19-3.39,6.51-6.66,9.85-9.91C80,38,84.69,37.52,87.62,40.57c3.21,3.34,2.72,7.14-1.45,11.34-3,3.07-6,6.3-9.2,9.15-2.58,2.26-2.24,3.78.13,5.91,3.34,3,6.47,6.24,9.53,9.52,3.87,4.16,4.06,7.8.83,11-2.95,2.93-7.16,2.53-11-1.15-2.9-2.75-5.69-5.61-8.52-8.42-2.57-2.54-5.15-2.58-7.73,0-2.94,2.94-5.8,6-8.85,8.8-3.58,3.33-7.88,3.55-10.7.79-3.19-3.11-3.15-6.6.47-10.59a98.44,98.44,0,0,1,9.52-9.53c3.24-2.72,2.53-4.55-.2-7A143,143,0,0,1,40.28,50.05a6.39,6.39,0,0,1-.94-7.83C40.69,39.66,42.88,38.9,45.32,38.54Z" /> </svg> <svg id="like" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128.06 127.99"> <path class="a" d="M128.06,63.83a63.65,63.65,0,0,1-64,64.16A63.57,63.57,0,0,1,0,64a64,64,0,0,1,128.06-.13ZM96,56.53c0-5.82-3.9-13.3-10.19-16.05-6.9-3-13.67-2.67-19.37,2.82-2,1.9-3.16,1.41-4.93-.17-2.34-2.08-4.86-3.89-8.25-4.24-9.13-.92-15.31,2.3-19.11,10.25-3.89,8.11-2.42,17.27,4,23.34,7.5,7,15.22,13.88,22.77,20.89,2.06,1.92,3.76,2.27,6,.21C74.36,86.7,82,80,89.39,73.09,93.57,69.21,96.06,64.45,96,56.53Z" /> <path d="M96,56.53c.08,7.92-2.41,12.68-6.59,16.56C82,80,74.36,86.7,66.93,93.58c-2.23,2.06-3.93,1.71-6-.21-7.55-7-15.27-13.84-22.77-20.89-6.46-6.07-7.93-15.23-4-23.34,3.8-8,10-11.17,19.11-10.25,3.39.35,5.91,2.16,8.25,4.24,1.77,1.58,2.95,2.07,4.93.17,5.7-5.49,12.47-5.84,19.37-2.82C92.08,43.23,96,50.71,96,56.53Z" /> </svg> </div>
Check the CSS code
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;900&display=swap"); html, body { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; overflow: hidden; font-family: "Nunito", sans-serif; background-color: rgba(0, 0, 0, 0.4); } .frame { position: relative; width: 90%; height: 70%; max-width: 400px; max-height: 600px; z-index: 1; } .icons { margin-top: 3vh; user-select: none; z-index: 1; } .icons>svg { width: 10vh; height: 10vh; max-width: 60px; max-height: 60px; border-radius: 50%; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); cursor: pointer; } .icons>svg:nth-child(1) { fill: #fb4f68; margin-right: 2vh; } .icons>svg:nth-child(2) { fill: #4dca93; } .icons>svg>path:nth-child(1) { fill: #fff; } .card { background-color: #fff; position: absolute; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100%; color: #f1f1f1; border-radius: 10px; user-select: none; cursor: pointer; overflow: hidden; background-size: cover; background-repeat: no-repeat; background-position: center; touch-action: none; } .card .is-like { width: 100%; height: 100%; position: absolute; opacity: 0; } .card .is-like::after { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%) rotate(-10deg); width: 30%; height: 13%; font-size: 3em; letter-spacing: 0.2em; font-weight: 600; border-radius: 0.15em; display: flex; align-items: center; justify-content: center; } .card .like::after { content: "👍"; } .card .nope::after { content: "👎"; } .card .bottom { width: 100%; height: 25%; background: linear-gradient(to top, #000000b8, #00000000); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding-left: 7%; font-weight: 400; padding-bottom: 25px } .card .bottom .title>span:nth-child(1) { font-size: 2em; font-weight: 700; margin-right: 0.2em; } .card .bottom .title>span:nth-child(2) { font-size: clamp(13px, 1.5em, 25px); } .card .bottom .title>span:nth-child(2)>b { font-size: 0.6em; margin-right: 0.2em; } .card .bottom .info { margin: 0; } @media screen and (max-height: 540px) { .frame { width: 90%; height: 70%; font-size: 13px; } } @media screen and (max-height: 440px) { .frame { font-size: 8px; } } .in-app-close svg { width: 32px; height: 32px; cursor: pointer; background-color: #000; fill: #fff; } .in-app-close { max-width: 400px; margin-bottom: 16px; }
Check the JS code
let imgCount = 0; const data = {% set arr = [] %}{% recommendations3 campaignId=CAMPAIGN-ID %}{% for p in recommended_products3 %}{% set obj = {itemId: p.itemId, img: p.image_link, name: p.title, price: p.price, distance: p.category} %}{% do arr.append(obj) %}{% endfor %}{{arr|tojson}}{% endrecommendations3 %} const frame = document.body.querySelector(".frame"); data.forEach((_data) => appendCard(_data)); let current = frame.querySelector(".card:last-child"); let likeText = current.children[0]; let startX = 0, startY = 0, moveX = 0, moveY = 0; document.querySelector("#like").onclick = () => { moveX = 1; moveY = 0; complete('like'); }; document.querySelector("#hate").onclick = () => { moveX = -1; moveY = 0; complete('hate'); }; function appendCard(data) { const firstCard = frame.children[0]; const newCard = document.createElement("div"); newCard.className = "card"; newCard.setAttribute('data-sku', data.itemId); newCard.setAttribute('data-brand', data.name); newCard.setAttribute('data-title', data.distance); newCard.style.backgroundImage = `url(${data.img})`; newCard.innerHTML = `
                
LIKE
${data.name} ${data.price}zł
${data.distance}
`; if (firstCard) frame.insertBefore(newCard, firstCard); else frame.appendChild(newCard); imgCount++; } function initCard(card) { card.addEventListener("pointerdown", onPointerDown); } function setTransform(x, y, deg, duration) { current.style.transform = `translate3d(${x}px, ${y}px, 0) rotate(${deg}deg)`; likeText.style.opacity = Math.abs((x / innerWidth) * 2.1); likeText.className = `is-like ${x > 0 ? "like" : "nope"}`; if (duration) current.style.transition = `transform ${duration}ms`; } function onPointerDown({ clientX, clientY }) { startX = clientX; startY = clientY; current.addEventListener("pointermove", onPointerMove); current.addEventListener("pointerup", onPointerUp); current.addEventListener("pointerleave", onPointerUp); } function onPointerMove({ clientX, clientY }) { moveX = clientX - startX; moveY = clientY - startY; setTransform(moveX, moveY, (moveX / innerWidth) * 50); } function onPointerUp() { current.removeEventListener("pointermove", onPointerMove); current.removeEventListener("pointerup", onPointerUp); current.removeEventListener("pointerleave", onPointerUp); if (Math.abs(moveX) > frame.clientWidth / 2) { current.removeEventListener("pointerdown", onPointerDown); complete(String(moveX).match('-') ? 'hate' : 'like'); } else cancel(); } function complete(type) { try { const flyX = (Math.abs(moveX) / moveX) * innerWidth * 1.3; const flyY = (moveY / moveX) * flyX; setTransform(flyX, flyY, (flyX / innerWidth) * 50, innerWidth); SRInApp.trackCustomEvent('preferences.action', { actionType: type, itemId: current.getAttribute('data-sku'), title: current.getAttribute('data-title'), brand: current.getAttribute('data-brand') }, 'Preferences action'); const prev = current; const next = current.previousElementSibling; if (next) initCard(next); current = next; likeText = current.children[0]; // appendCard(data[imgCount % 4]); setTimeout(() => frame.removeChild(prev), innerWidth); } catch(error) { document.querySelector('body').style.backgroundColor = 'rgba(0, 0, 0, 0.6)'; document.querySelector('body').innerHTML = '<h1 style="color: #fff; width: 90%; max-width: 400px;">Thank you!<br>We will reach out to you</h1>'; setTimeout(function(){ SRInApp.close(); }, 3000) } } function cancel() { setTransform(0, 0, 0, 100); setTimeout(() => (current.style.transition = ""), 100); } var close = document.querySelector('.in-app-close svg'); close.addEventListener('click', function () { SRInApp.close(); }) initCard(current);
In the JS code section, replace the CAMPAIGN-ID with the [ID of your campaign created in the previous step](/use-cases/in-app-bestsellers#create-ai-recommendations).
1. In the **Trigger events** section: 1. Click **Define**. 2. Select **Add event** and from the dropdown list, choose the `preferences.trigger` event. 2. Click the **+ where** button and as the parameter, choose `source`.
If you cannot find the `source` parameter on the dropdown list, go to **Data Modeling Hub > Events**, find `preferences.trigger` event on the list and add `cource` parameter by clicking **Add property** button.
3. As the logical operator, select **Contain** and as the value add **MOBILE** to analyze events only from the mobile application. 4. Click **Apply**. 1. In the **Schedule** section: 1. Click **Define**. 2. Choose **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Change**. 2. Define the **Delay display** as **0** and **Priority index** as **1**.
The mobile application can display one in-app message at a time. If the conditions allow the display of several in-apps at a time, the priority is a decisive factor for displaying the message. The messages with lower priority aren’t queued.
3. Click **Apply**. 1. Optionally, you can define the **UTM parameters**. Otherwise, click **Skip step**. 2. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**. ## What's next --- After the campaign is implemented, the event `preferences.action` is added on the client's card. This event has an `itemId` (product id) and `actionType` parameter with a value `like` or `hate`. Based on this event, you can create an [aggregate](/docs/crm/aggregates) with products liked or rejected by the customer. Remember, that before creating an aggregate, you should either have this event already somewhere in your history, or have its definition added in [Data Modeling Hub](/docs/assets) in Synerise. Otherwise it will not be available in analysts.
Check how to build this aggregate
  1. Go to Behavioral Data Hub icon Behavioral Data Hub > Live Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter the name of the aggregate.
  4. Click Analyze profiles by and select Last Multi.
  5. In the Size field choose how many values you would like to return - in this case it might be 100.
  6. Select Consider only distinct occurrences of the event parameter.
  7. Select the `preferences.action` event.
  8. Select the itemId parameter.
  9. Click the + where button, and add the actionType parameter.
  10. Choose operator Equal.
  11. Define the parameter value as `like`.
  12. Save the aggregate.
Decision Hub Last Multi aggregate returning the distinct IDs of products liked by the customer using the preferences.action event
Configuration of the aggregate

To create an aggregate with product rejected by the customer, duplicate the aggregate created above and change the value of the parameter to `hate`.

**Here are some ideas for using the aggregate:** - You can [add such an aggregate to the Boosting](/use-cases/boost-favorite-products) section in other recommendation campaigns and enrich the proposed recommendations with products that have been liked by the customer, or to exclude those which they have rejected. - You can use the aggregate with the customer's favorite products and display them as the section on the website or in the cart, as an incentive to buy products that the customer liked and in this way - increase the value of the basket. - You can use this aggregate also in the [price drop campaign](/use-cases/price-drop-alert). If the customer does not buy a specific product they liked and its price drops, you can send them this information to encourage them to come back and make a purchase. - You can use disliked products in AI search filters, and in this way - exclude those products from the search results. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [AI recommendation configuration](https://app.synerise.com/ai-v2/recommendations/4TohwHGOPXVQ), - [in-app campaign with the bottom bar](https://app.synerise.com/communications/in-app/00880268-6c60-43cd-b79a-99db6e1efc83), - [in-app campaign with the swiping mechanism](https://app.synerise.com/communications/in-app/197099f1-4dde-48c8-96a3-5a71c7aa71e9), - additional [aggregate with liked products](https://app.synerise.com/analytics-v2/aggregates/4af1a1ab-7339-3c6f-85a7-706b316b6d0c). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`product.addToFavorite`](/docs/assets/events/event-reference/items#productaddtofavorite) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~2), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), `preferences.trigger` (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), `preferences.action` (~5). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Mobile campaigns](/docs/campaign/Mobile) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Recommendations inserts](/developers/inserts/recommendations-v2) # Personalized in-app campaign with like/dislike swipe feature In today's digital landscape, the majority of internet users access the web through mobile devices. In-app campaigns offer companies a unique opportunity to engage with this large and growing customer base in a personalized and meaningful way. By using a variety of triggers, in-app campaigns can increase customer engagement, conversions, and provide valuable insights into customer preferences. The swiping mechanism is a user-friendly feature commonly used in in-app campaigns. It allows customers to quickly and easily swipe left or right to indicate their level of interest in a product or offer. The mechanism provides companies with valuable insight into customer tastes and behavior, enabling them to make informed decisions about future campaigns and product offerings. Finally, the swipe mechanism adds a fun and interactive element to in-app campaigns, increasing customer engagement and overall user experience. This use case outlines the process of creating an engaging in-app campaign featuring a swiping mechanism with personalized product recommendations. With the use of a predefined in-app template for the swiping mechanism, there is no need for time-consuming creation of a template from scratch, making it quick and easy to launch the campaign. The campaign will be displayed to customers as soon as they add a product to their favorites list, providing a seamless user experience.
In-app swiping mechanism
## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search). Enable **Personalized recommendations**. - Implement the `product.addToFavorite` event in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-favorites). The event must be sent to Synerise after adding any product to favorites by the customer. ## Process --- In this use case, you will go through the following steps: 1. [Create AI recommendations](/use-cases/in-app-swiping-mechanism#create-ai-recommendations) with personalized products. 2. [Create an in-app campaign](/use-cases/in-app-swiping-mechanism#create-an-in-app-campaign) with swiping mechanism using the predefined template. ## Create AI recommendations --- In this step, create an AI recommendation campaign that will be used to display products in your in-app message. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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. 5. Select the **Personalized** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 6. In the **Items** section, click **Define**. 7. Click **Add slot**. 8. Click the **Unnamed slot** that was created. 8. Define the minimum and maximum number of products displayed in the frame according to your needs. 9. Optionally, you can use filters to include specific items in the recommendation frame.
Learn about the difference among [elastic, static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter).
10. Confirm the configuration by clicking **Apply**. 11. Optionally, you can use boosting option to promote or demote any items attributes in the recommendation frame. 12. Optionally, you can also define the settings in the **Additional settings** tab according to your needs. 13. Click **Save**.
AI recommendation configuration
AI recommendation campaign configuration
## Create an in-app campaign --- In this part of the process, you will create an in-app campaign triggered by the `product.addToFavorite` event. We will use a predefined template for the swiping mechanism, so there is no need to create a template from scratch. 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create new** 2. Enter a meaningful name for the in-app campaign. ### Define the audience --- 1. In the **Audience** section, click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. ### Define content --- 1. In the **Content** section click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select **Swiping mechanism with recommendation campaign**. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable)) and/or by filling out the form in the **Config** tab. In this use case, we will use the capabilities of the predefined **Config** tab.
#### Edit form in the Config tab --- The **Config** tab already has default values filled in. You can keep them or change them to fit your business needs. The fields in **Config** are split into two types: ones for dynamic (related to Jinja) content and ones for in-app appearance. The dynamic content fields must match the values in the catalog and the names of the attributes returned by the recommendations. The appearance fields only affect the visual layer of the in-app message. 1. From the **Recommendation Campaign** drop-down list, select the personalized recommendation campaign you created in the previous step. You can find it by typing its name or ID in the search box. 2. In the **Product attribute name with image link** field, change the default value of the `imageLink` attribute to the attribute name from your item catalog. In our case, the attribute corresponding to the image link is `image`. 3. In the **Product attribute name with title** field, change the default value of the `title` attribute to the attribute name from your item catalog. In our case, the attribute corresponding to the title is `name`. 4. In the **Header text** text box, type the header you want to display in the in-app message. 5. Define the color in the following fields: **Header text color**, **Wrapper background color** and **Close icon background color** to your needs. 6. Customize the **Header text on a Thank you view** and **Header description on a Thank you view** to your needs.
The **Thank you** view refers to the last view of the campaign when the user has already clicked through all the items that were supposed to be displayed in-app. It can be previewed only after the campaign is pushed on the mobile app.
7. Adjust the remaining fields corresponding to the **Thank you** view, which includes its text color, text and color and background color of the close button. 8. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer or a product. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That's why we suggest checking how this campaign displays altogether directly in the mobile app.
9. If the template is ready, in the upper right corner, click **Save this template > Save as**. 10. On the pop-up: 1. In the **Template name** field, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**.
In-app preview
In-app preview
11. Click **Next** to continue the process of configuring the in-app campaign. 12. Click **Apply** to save your content changes. ### Select events that trigger the in-app message display --- In this part of the process, define the event that triggers the display of the in-app message. In our case, the trigger is adding an item to favorites. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose the `product.addToFavorite` event. 3. Click the **+ where** button and as the parameter, choose `source`. 4. As the logical operator, select **Contain** and as the value add **MOBILE** to analyze events only from the mobile application. 5. Click **Apply**.
The view of In-app trigger event configuration
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you need to set the schedule, display settings configuration, capping, priority of the message among other in-app messages. 1. In the **Schedule** section: 1. Click **Define**. 2. Choose **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Define**. 2. Define the **Delay display** as **0** and **Priority index** as **1**.
The mobile application can display one in-app message at a time. If the conditions allow the display of several in-apps at a time, the priority is a decisive factor for displaying the message. The messages with lower priority aren’t queued.
3. Enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the message to the customer a maximum of two times in 7 days. 4. You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a customer in general. 5. Click **Apply**. 3. Optionally, you can define the UTM parameters in the **UTM & URL parameters** section. Otherwise, click **Skip step**. 4. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**.
In-app campaign configuration settings
In-app campaign configuration settings
## What's next --- Refer to the What's next section from [this use case](/use-cases/in-app-bestsellers#whats-next) for some ideas on how to use data obtained from user swipes in the in-app campaign you've created. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [AI recommendation configuration](https://app.synerise.com/ai-v2/recommendations/iLhCWkFA771c), - [In-app campaign](https://app.synerise.com/communications/in-app/f6cb088d-0f1f-41b0-bca8-80af671fb56c) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`product.addToFavorite`](/docs/assets/events/event-reference/items#productaddtofavorite) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) - [Mobile campaigns](/docs/campaign/Mobile) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Recommendations inserts](/developers/inserts/recommendations-v2) # Optimize sending sales campaigns by predicting the best time While designing a sales campaign communication scenario, it's good to send messages at the time when the customer is most likely to react to them . To achieve this, you can make use of the [time optimizer](/docs/settings/configuration/time-optimizer) feature. This use case describes sending a sales campaign through Automation Hub. The workflow starts with sending an email with a promotional code to all customers. The sending time of the email is adjusted to the customers' activity related to the email channel. If a customer makes a purchase within 3 days after sending the email, they end the workflow. In the case when a customer didn't make the purchase, the system checks if they visited the website. If so, the system sends an email with recommendations of items from the last visit that have the same attributes as the items on sale. The optimization of the sending date of the second email covers activity of your customers in all channels. ## Prerequisites --- - [Implement a tracking code](/developers/web/installation-and-configuration). - [Implement transaction events](/developers/web/transactions-sdk). - [Create a sender account](/docs/campaign/e-mail/configuring-email-account). - Enable [time optimizer](/docs/settings/configuration/time-optimizer). - Create email templates: 1. Email with a discount code 2. Email with recommendations of items from the last visit that match attributes with items on sale
You can find instructions on preparing [email templates here](/docs/campaign/e-mail/creating-email-templates).
## Process --- In this use case, you will go through the following steps: 1. [Create time optimizer modes](/use-cases/increase-effectiveness-of-sales-campaigns#create-modes). 2. [Crete a workflow](/use-cases/increase-effectiveness-of-sales-campaigns#create-a-workflow). ## Create modes --- As the first part of the process, create two time optimizer modes. They will be used in the workflow in further part of the process. - **Email mode** - which analyzes only the interactions in the email channel - **Custom mode** - which analyzes the interactions from all channels you use to communicate with your customers ### Email mode 1. Go to **AI Engine Configuration**. 2. Select **Time optimizer** tab. 3. Click **Define**. 4. Click **Add a new mode**. 5. On the pop-up, select **Templates** tab. 6. Select **Email**. 7. Click **Apply**. ### Custom mode 1. Go to **AI Engine Configuration**. 2. Select **Time optimizer** tab. 3. Click **Define**. 4. Click **Add a new mode**. 5. Select **Custom**. 6. In the **Mode name** field, enter the name of the mode. 7. From the **Predicted event** dropdown list, select **page.visit**. 8. From the **Input events** dropdown list, select 6 events related with communication channels you use (for example, `newsletter.open` and `newsletter.click` (email), `screen.view` and `screen.click` (mobile), `webpush.show` and `webpush.click` (web), `sms.click` (SMS) and so on). 9. Confirm by clicking **Apply**. ## Create a workflow --- As the second part of the process, create a workflow that manages email communication during your sales campaign. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Select audience Select the customers for whom you want to run this workflow. 1. As the first node, select **Audience**. 2. In the configuration of the node: 1. Leave the **Run trigger** option, at default (one time). 2. As the audience, select **New audience** 3. Click **Define conditions** 4. Click **Choose filter** and from the list select the `email.agreement`. Choose operator `Boolean` and the value set as `true`. 5. Click **Apply**. 3. Confirm the settings of the audience by clicking **Apply**. ### Add time optimizer The time of sending the message for each customer is adjusted to their activity in the email channel. 1. Add an **Optimize Time** node. 2. In the configuration of the node: 1. Select the [Email mode](/use-cases/increase-effectiveness-of-sales-campaigns#email-mode) you created in previous part of the process. 2. Select **Custom time period**. 3. Set the period 48 hours. 4. Confirm by clicking **Apply**. ### Send email with discount code 1. Add **Send Email**. 2. In the configuration of the node: 1. In the **Sender details** section, select the account from which you will send emails to your customers. 2. In the **Content** section: 1. Enter the subject of the email which will be visible in the inbox. 2. Select the email template with a discount code. 3. Optionally, in the **URL & UTM paramters** section, define the parameters. If you don't want to do it, click **Skip this step**. 3. Confirm by clicking **Apply**. ### Wait for transaction event The workflow waits for 72 hours (3 days) since the sending of the message, after this time the system verifies whether a customer made a purchase. If a customer made a purchase, the workflow ends. 1. Add **Event Filter**. 2. In the configuration of the node: 1. Set the **Check** option to **for period of time**. 2. Select 72 hours. 3. From the **Choose event** dropdown list, select **transaction.charge**. 3. Confirm by clicking **Apply**. 4. To the *matched* path, add the **End** node. 5. To the *not matched* path, add the **Profile Filter** node. ### Check if customer visited website If a customer didn't make a purchase, the system checks whether they visited a website in the last 3 days. If not, the customer ends a workflow. 1. In the configuration of the **Profile Filter** node: 1. From the **Choose filter** dropdown list, select **page.visit**. 2. As the date range, select **Last 3 days**. 2. Confirm by clicking **Apply**. 3. To the *matched* path, add the **Optimize Time** node. 4. To the *not matched* path, add the **End** node. ### Add time optimizer If a customer visited the website during last 3 days, an email will be sent to them. Before it happens, the system adjust the time of the sending by analyzing the activity of the customers in all channels you used to communicate with them before. 2. In the configuration of the **Optimize Time** node (after the **Profile Filter** node): 1. Select the [Custom mode](/use-cases/increase-effectiveness-of-sales-campaigns#custom-mode) you created in previous part of the process. 2. Select **Custom time period**. 3. Set the period to 48 hours. 4. Confirm by clicking **Apply**. ### Send email with recommendations An email with the recommendation of items visited during last visit is sent to a customer at the best time. 1. Add **Send Email**. 2. In the configuration of the node: 1. In the **Sender details** section, select the account from which you will send emails to your customers. 2. In the **Content** section: 1. Enter the subject of the email which will be visible in the inbox. 2. Select the email template with recommendations of items from the last visit that match attributes with items on sale. 3. Optionally, in the **URL & UTM paramters** section, define the parameters. If you don't want to do it, click **Skip this step**. 3. Confirm by clicking **Apply**. 4. After the **Send Email** node, add an **End** node. 5. To run the workflow, click **Save & Run**. **Result**:
Automation Hub workflow for sending emails with recommendations of sale items matching recent customer visits
The final configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check described [workflow](https://app.synerise.com/automations/workflows/automation-diagram/523bae5d-d9da-4826-a8a6-75c7bc3f31ba) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 12 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`snr.ate.prediction`](/docs/assets/events/event-reference/predictions#snrateprediction) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Automation Hub](/docs/automation) - [Time optimizer](/docs/settings/configuration/time-optimizer) # Automated Birthday Email Sent Before Customer’s Birthday Birthday discounts and offers are a perfect chance to surprise your customers. One of the ideas for a birthday campaign may be sending a happy birthday message two weeks prior to a customer's birthday. This way, not only do you remind them about the celebration day, but can also provide a birthday discount and offer a range of personalized products a customer can treat themselves to for their upcoming birthday. However you choose to wish your customers a happy birthday, it’s a great opportunity to show them how much they mean to your business. In this use case, you will create a dynamic attribute which will be assigned to the customers whose birthday is in 14 days. In the further part of the process, you will use this attribute to group those customers and prepare a workflow which sends an email to them.
You can also check our other use cases for the [birthday campaigns](/use-cases/?query=birthday&ordering=DESC&sortBy=publishDate).
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - Customers' profiles must be supplied with the birthdate (ISO timestamp format). - Configure an [email account](/docs/campaign/e-mail/configuring-email-account). - Optionally, you can create a [voucher pool](/docs/assets/code-pools). ## Process --- In this use case, you will go through the following steps: 1. [Create expressions](/use-cases/is-it-customers-birthday#create-expressions). 2. [Create an email template](/use-cases/is-it-customers-birthday#create-an-email-template). 3. [Create a workflow](/use-cases/is-it-customers-birthday#create-a-workflow). ## Create expressions --- In the first part of the process, you create four expressions. The first three expressions will be components of the last expression, which returns information whether a customer's birthday is in 14 days. ### Return the day of birthday Create an expression which returns only the day of the birthday as a number. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. As the name of the expression, enter `Month day of birthday`. 3. Leave the **Expressions for** option at default (**Attribute**). 4. In the formula of the expression: 1. Click **Select**. 2. From the dropdown list, select **Function > Day of month**. 3. Click the **Select** button in the brackets. 4. From the dropdown list, select **Profile**. 5. Click the **unnamed** node. 6. At the bottom of the page, click **Choose attribute**. 7. From the dropdown list, select the attribute which indicates birthday formatted as an ISO timestamp (Birthdate attribute label). 5. Click **Save**.
The configuration of the expression that returns the day of birthday
The configuration of the expression that returns the day of birthday
### Return the month of birthday Create an expression which returns only the month of the birthday as a number (for example, `8` stands for August). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. As the name of the expression, enter `Month of birthday`. 3. Leave the **Expressions for** option at default (**Attribute**). 4. In the formula of the expression: 1. Click **Select**. 2. From the dropdown list, select **Function > Month**. 3. Click the **Select** button in the brackets. 4. From the dropdown list, select **Profile**. 5. Click the **unnamed** node. 6. At the bottom of the page, click **Choose attribute**. 7. From the dropdown list, select the attribute which indicates birthday formatted as an ISO timestamp (Birthdate attribute label). 5. Click **Save**.
The configuration of the expression that returns the month of birthday
The configuration of the expression that returns the month of birthday
### Return the date 14 days ahead Create an expression that returns the date 14 days ahead (including the current day). In the formula of the expression, you add the product of multiplying 86400000 by 14 to the current date. 86400000 is 24 hours in milliseconds and 14 stands for the 14 days. The expression returns the timestamp of the date in 14 days in ISO 8601. For example, if the current date is `March 23, 2022, 15:00`, the expression will return `2022-04-05T15:00:00.000Z` 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. As the name of the expression, enter `Date 14 days ahead`. 3. Leave the **Expressions for** option at default (**Attribute**). 4. On the dashboard, build the following formula of the expression:
The configuration of the expression that returns the date 14 days ahead
The configuration of the expression that returns the date 14 days ahead
5. Click **Save**. ### Identify customers whose birthday is in 14 days Create an expression that informs if a customer's birthday is in 14 days. In the formula of the expression, you compare the day of the month and the month of birthday with the date 14 days ahead from now. If they are the same, the expression returns `true`, if not, `false`. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Leave the **Expressions for** option at default (**Attributes**). 3. Optionally, you can enable the **Show in profile card** toggle, so the result of the expression is visible in the profile of a customer. 4. On the dashboard, build the following expression formula using the expressions you created in the previous steps:
The configuration of the expression that returns information whether customer has birthday in 14 days
The configuration of the expression that returns information whether customer has birthday in 14 days
5. Click **Save**. ## Create an email template --- In this part of the process, create an email template with a birthday discount code for the customers who will celebrate their birthday in 14 days. 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left pane, click **Templates**. 3. Select the wizard: - **Drag&drop builder** - use ready-made components to build an email template. - **Code editor** - use HTML, CSS and JS to build an email template from scratch. 4. Build a template.
[Insert a voucher](/developers/inserts/insert-usage#code-pools) in an email template. You can use other [inserts](/developers/inserts) as well.
5. Save the template. ## Create a workflow --- In this part of the process, create a workflow that will be targeted at customers who have birthday in 14 days from today. The workflow will be launched automatically every day. 1. Go to Automation Hub icon **Automation > Workflow > New workflow**. 2. Enter the name of the workflow. 3. Set capping to 1 email in 12 months. This configuration means that the capping remains in effect for a customer for 360 days since the day of the workflow launch for this customer (12 months multiplied by 30 days, in context of capping, a month always equals 30 days). 4. As the first node, add **Audience**. 1. In the configuration of the **Audience** node: 1. As the **Run trigger** option, select **repeatable**. 2. Set the interval to 1 day. 3. In the **Begin at** field, select the date.
It can't be the past date.
4. From the **Timezone** dropdown list, select the time zone consistent with the time zone of your workspace. 5. In the **Define audience** section, click **New audience**. 6. Click **Choose filter**. 7. Select the **Clients** tab. 8. Select the previously created [expression which checks if a customer's birthday is in 14 days](/use-cases/is-it-customers-birthday#identify-customers-whose-birthday-is-in-14-days). 9. Click the Boolean icon. 10. Select **Is true**.
Filter settings in the Define audience section
Filter settings in the Define audience section
11. Confirm by clicking **Apply**. 2. As the second node, add **Profile Filter**. 3. In the configuration of the **Profile Filer** node: 1. Select `newsletter_agreement`. 2. As the logical operator, select **Equal**. 3. In the text field, enter `enabled`.
Filter settings in the Profile Filter node
Filter settings in the Profile Filter node
4. Confirm by clicking **Apply**. 4. At the `matched` path of the profile filter node, add a **Send Email** node. 5. In the configuration of the **Send Email** node: 1. In the **Sender details** section: 1. Select the account from which the email will be sent. 2. Confirm by clicking **Apply**. 2. In the **Content** section: 1. Enter the email subject which will be visible in the customer's inbox. 2. Select the [email template you created earlier](/use-cases/is-it-customers-birthday#create-an-email-template). 3. Confirm by clicking **Apply**. 3. In the **URL & UTM parameters** section: - If you don't want to add the parameters, click **Skip this step**. - If you want to add the parameters, click **Define** and define the parameters. 6. Add the **End** nodes to the `not matched` path of **Profile Filter** node and after the **Send Email** node. 7. Click **Save & Run**.
The final configuration of a workflow that sends an email 14 days before birthday
The final configuration of a workflow that sends an email 14 days before birthday
## Check the use case set up on the Synerise Demo workspace --- You can check described expressions below: - [expression that returns the month day of birthday](https://app.synerise.com/analytics/expressions/c0a29824-dbe2-44be-a5b2-c025cbb14086) - [expression which returns the month of birthday](https://app.synerise.com/analytics/expressions/f7978831-9989-485e-9325-e9e898b63d0c) - [expression that returns the date in 14 days ahead](https://app.synerise.com/analytics/expressions/64c5df67-5c51-420f-8e7c-dd7ae4e49f58) - [expression which presents customers whose birthday is in 14 days](https://app.synerise.com/analytics/expressions/826d75b1-5365-4d1a-9638-ed49e5f0c4d8). Check also the created [workflow](https://app.synerise.com/automations/automation-diagram/a17b8b52-0bde-4327-8e4c-b7b4bfd0abe8) that will be targeted at customers who have birthday in 14 days from today. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Configuring an email account](/docs/campaign/e-mail/configuring-email-account) - [Creating email templates](/docs/campaign/e-mail/creating-email-templates) - [Functions in expressions](/docs/crm/expressions/functions-in-expressions) - [Insert usage](/developers/inserts) # Display list of available coupons in a mobile app In this use case, you can easily set up a list of available promotions inside your mobile app, shown to the user after selecting the My Promotions section. All you need is an in-app campaign targeted to all users, with the display of the promotions list triggered by tapping that section. You can adjust the copy and other elements directly in the template, since the entire setup is based on predefined in-app templates that are simple to adapt. ## Prerequisites --- - Create an [item catalog](/docs/assets/catalogs). - Integrate Synerise [mobile SDK](/developers/mobile-sdk) in your mobile application. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Implement [basic loyalty program with points](/use-cases/loyalty-programs-basics). - [Integrate Synerise promotions](/docs/ai-hub/promotions/introduction-to-promotions). ## Implement a promotions catalog template --- This template provides an in-app catalog of coupons that can be redeemed with points. You can: - Display the list of coupons available - Show possibility to copy the code ### Create an in-app message --- In this part of the process, you create an in-app campaign triggered by your custom event. The trigger should come from a dedicated event generated by your mobile application — for example, an action such as tapping the ‘My promotions’ button. This ensures that the in-app is displayed only when the user intentionally requests it. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. 1. In the **Audience** section, click **Define**. 4. Click **Everyone**. 8. To save the audience, click **Apply**. ### Define content --- In this part of the process, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template.
The template is designed so that the user can copy a specific coupon to the clipboard and paste it later in the checkout in the appropriate field.
1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Promotions catalog** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add snippets](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
The view of in-app configuration
In-app configuration
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can change them to fit your business needs.
This template automatically pulls all active promotions from your promotion list in which the customer fits the defined audience. To make sure the more important promotions appear first for the user, adjust their priority. Here’s how to do it:

In the Type and limits section of specific promotion - in the Priority field, enter a number that defines the promotion’s priority.

Priority controls the display order in the customer’s view. 1 is the highest. If multiple applicable promotions share the same priority, the one created earlier will be shown first.

2. Edit the copy using Title, and all the fileds connected with the Headers of the loyalty card. 9. Define the colors and style for the following fields: Borders, Backgrounds,and Text colors. 10. Set up the maximum number of promotion displayed for the user. 10. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the preview directly in the mobile app.
11. If the template is ready, in the upper right corner click **Save this template > Save as**. 12. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 13. To continue the process of configuring the in-app campaign, click **Next**. 14. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the custom event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose your custom event. 4. As the logical operator, select **Exists**. 5. Click **Apply**. ### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application.
You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general.
16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of [promotion catalog in-app campaign](https://app.synerise.com/communications/in-app/a12e8289-4b81-4b10-a631-4c100a597858) in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: `custom trigger event` (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) - [Promotions](/docs/ai-hub/promotions) # Group customers by purchase days In this use case, you will learn how to create a segmentation that allows you to divide your customers into segments based on the time of week on which they bought a product. You may use that information further for targeted communication. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). ## Create a segmentation --- Create a segmentation that organizes customers into two groups: - Weekend - It gathers the customers who bought products on weekends, - Week days - It gathers the customers who bought products on week days. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New Segmentation**. 2. Enter the name of the segmentation. 3. Name the first segment, in our case `Weekend` 4. To add the first step to the segment, click the **Performed event...** button. 5. From the dropdown list, select the `product.buy` event. 6. For the event parameter, click the **+ where** button and select `TIMESTAMP`. 7. As the logical operator, select **Custom** date. 8. Click **Start date -> End date**: 1. In the **Relative date range** section, click **Custom**, type 365 and from the the dropdown list, select **Days**. 2. In the **Filter** section, click **Add filter** and then **Every week**. 3. Select **Sat** and **Sun**. 4. Click **Add time**. 4. Click **Apply**.
Conditions of the date range
Conditions of the date range
9. Click **Apply**. 10. In the calendar in the right bottom of the page: 1. In the **Relative date range** section, click **Custom**, type 365 and from the the dropdown list, select **Days**. 2. Click **Apply**.
Conditions of the segment
Conditions of the segment
11. Create the second segment by duplicating the one you have just created. 12. Name this segment `Week days`. 13. Change the date range: 1. In the **Filter** section, click **Change** . 2. Click on **Select all** and clear selection of **Sat** and **Sun**. 4. Click **Add time**. 3. Click **Apply**.
Conditions of the date range
Conditions of the date range
14. Click **Apply**.
Conditions of the segment
Conditions of the segment
15. In the calendar in the right bottom of the page: 1. In the **Relative date range** section, click **Custom**, type 365 and from the the dropdown list, select **Days**. 2. Click **Apply**. 16. Click **Save**. The segments are saved and can be viewed in **Preview** where you can preview how your customer base splits according to the defined conditions. ## What's next --- To use this segments in **Experience Hub**: 1. Click **Define** in the **Audience** section. 2. Click **New Audience**. 3. Click **Define conditions**. 1. Click **Choose filter** and from the dropdown list choose the segmentation you have created in [this step](/use-cases/number-of-transactions-weekend-vs-workdays#create-a-segmentation). 2. Choose operator **Equal**. 3. Type the name of the segment. Depending on whether you want to send the communication to customers who buy on the weekend, enter the name of the segment `Weekend`, and if to those who buy during week days - `Week days`. 4. Click **Apply**. 4. Click **Apply**.
Example of audience
Example of audience
## Check the use case set up on the Synerise Demo workspace --- You can also check the [segmentation configuration](https://app.synerise.com/analytics-v2/segmentations/0d06b767-6168-4e8f-8c08-9bfb2ad6544c) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Segmentations](/docs/analytics/segmentations) # Evaluate results of churn prediction You can create a dashboard to monitor churn predictions. The scenario in this example is a continuation of [Predict churn](/use-cases/churn-prediction), but with some tweaks it can be used for other predictions.
Reducing churn
Reducing churn
## Prerequisites --- - The prediction from [Predict churn](/use-cases/churn-prediction) is ready. - You are familiar with [expressions](/docs/crm/expressions), [metrics](/docs/analytics/metrics), and [dashboards](/docs/analytics/analytics-dashboard). ## Process --- In this use case, you will go through the following steps: 1. [Create metric](/use-cases/predictions-dashboard#create-metric) to calculate the conversion of customers who were at different risks of churn. 2. [Create dashboard](/use-cases/predictions-dashboard#create-dashboard). ## Create metric --- In this stage, you create two metrics to calculate the conversion of customers who were at different risks of churn. 1. Create new metric. 2. As the metric type, select **Formula metric**. 3. As the first node, add a `product.buy` event: 1. Set the **aggregator** to **Count**. 2. Set **Occurrence type** to **All**. 3. Add a contact filter with the following event conditions: - Action: `snr.prediction.score` - `modelId` equal to the model ID of your prediction.
The model ID can be copied from the Three-dot icon menu in the Prediction list.
- `score_label` equal to `Low`
Contact filter for product.buy event
Contact filter for product.buy event
4. As the second node, add a `snr.prediction.score` event: 1. Set the **aggregator** to **Count**. 2. Set **Occurrence type** to **All**. 3. Set the following conditions: - `modelId` equal to the model ID of your prediction. - `score_label` equal to `Low` 3. Set the mathematical operator between the nodes to division. 4. Encase the nodes in brackets. 5. Multiply the result by 100.
Completed metric formula
Completed metric formula
6. Save the metric. **Result:** This metric shows the percentage of customers who were at low risk of churn and made a purchase. 7. Repeat steps 1-8 to create a second metric, but replace the value of `score_label` with `High`. This will create a metric showing the percentage of customers who were at high risk of churn and made a purchase. ## Create dashboard --- In this stage, you create a dashboard that counts customers at risk of churn and shows the results of the metrics created in the previous stage. You can use this information to assess the effectiveness of churn prediction. 1. Go to Decision Hub icon **Decision Hub > Dashboards > Add dashboard**. 2. Add a segment to the dashboard: 1. In the menu above the canvas, click Segment icon. 2. Click the widget that appears. 3. In the panel on right, from the **Segmentation** drop-down list, select **Create new**. **Result:** The segmentation editor opens. 4. Add the segment with customers whose probability of churn is high: 1. Click **Choose filter** and select the `snr.prediction.score` event. 2. Add the following condition: `modelId` equals the ID of the model of the prediction you want to analyze.
The model ID can be copied from the Three-dot icon menu in the Prediction list.
3. Add the following condition: `score_label` parameter equals `high`. 4. Enter a meaningful name for the segment. 1. Add a new segment by clicking the plus icon next to the current segment. 2. Repeat step **d** for the new segment, but change the condition to `score_label` parameter equals `low`. 3. Click **Save & Exit**. **Result:** You are returned to the dashboard creator. 1. Add the metrics to the dashboard: 1. Click Metric icon. 2. Click the widget that appears. 3. From the **Metric** drop-down list, select one of the metrics that you created previously. 4. On the **Style** tab, change **Data format** to **%**. 5. Repeat steps **3a-3d** to add the other metric. 2. Click **Save dashboard**. **Result:** The dashboard becomes available for viewing and sharing. You can change the date range when viewing the results. ## Check the use case set up on the Synerise Demo workspace --- You can check the [dashboard](https://app.synerise.com/analytics/dashboards/027184a7-d282-43c4-8acd-8fb192fb5e58) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Dashboards](/docs/analytics/analytics-dashboard) - [Metrics](/docs/analytics/metrics) - [Predictions](/docs/ai-hub/predictions) # Boost or Demote Recommended Products by Profit Margin Recommendations suggest items based on a customer's behavioral history - purchases, page visits, interactions with previous recommendations, etc. However, it may be beneficial for your business to override the recommendations by increasing the frequency (promoting) of suggesting items with a higher profit margin and decreasing the frequency (demoting) of suggesting items with a lower margin. This can be done by using **recommendation boosting**. Boosting rules are built using the same editor as the filters, but unlike filtering, boosting does not entirely exclude items that do not meet the conditions - it only tells the AI model to assign a different weight to the profit margin parameter when calculating the final recommendation score of an item. ## Prerequisites --- - **Recommended**: Become familiar with [creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign). This article does not explain every step of creating a recommendation in detail. - The item feed includes a parameter that denotes the profit margin. In this example, the parameter is called `margin` and its values are `high` and `low`. ## Creating the recommendation --- ### Choose source, type, and add slots 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. In the **Type & Items feed** section: 1. Select an item catalog. 2. Select a recommendation type.
Boosting can be used with all recommendation types.
3. Click **Apply**. 3. In the **Items** section, configure at least one slot and click **Apply**. ### Build the boosting rules In this part of the process, you add two co-existing rules: - Promote items with the `margin` attribute equal to `high` - Demote items with the `margin` attribute equal to `low` 1. In the **Boosting** section, click **Define**. 2. Click **Add rule**. 3. Click **Define rule** and select **Visual Builder**. **Result** The Visual Builder window opens. 4. From the **Select attribute** drop-down list, select the margin attribute. You can use the search field. 5. From the **Operator** drop-down list, select **Equals**. 6. From the **Select value** drop-down list, select **high**.
Visual Builder screenshot: boosting filter that matches high-margin items
Boosting filter that matches high-margin items
7. Click **Apply**. 8. In the **Promote/Demote** selector, select **Promote** (default value). 9. Use the slider to adjust how much you want the rule to affect the results. 10. Add the rule for demoting low-margin items by repeating steps 2-9 with the following changes: 1. Change the value of **margin** to **low**. 2. Change the **Promote/Demote** selector to **Demote**. 11. Save the **Boosting** section settings by clicking **Apply**.
After applying the settings, you can use the **Preview** tab (available in the upper left part of the recommendation creator screen) to see how your rule changed the recommendation result. If necessary, you can return to the settings and adjust the boosting strength to meet your expectations.
Screenshot of the recommendation creator: two rules applied at once: one for promotion, the other for demotion
Two rules applied at once: one for promotion, the other for demotion
### Additional settings and saving 1. Configure the **Additional settings** section and click **Apply**. 2. Save the recommendation. ## What's next --- You can use the ID of the recommendation and [inject it with a snippet](/docs/assets/snippets) in other types of communication, such as: - [dynamic content](/docs/campaign/dynamiccontent) - this way you can show the recommendations on your website. - [email](/docs/campaign/e-mail) - this way you can send out recommended items through emails. - mobile application - you can use [documents](/docs/assets/documents) to build your own mobile app and show the recommended items. - [mobile push](/docs/campaign/Mobile) - you can send recommendations through notifications in your mobile application. - [web push](/docs/campaign/Webpush) - this way you can send notifications to your customers through a web browser. - [SMS](/docs/campaign/SMS) - this way you can reach your customers with recommendations on their mobile. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Recommendations](/docs/ai-hub/recommendations-v2) # Recommendations for new and returning app users Mobile apps are a powerful marketing channel for many businesses. They help companies to conveniently connect with customers, keep them engaged and build the best possible online experience for them. It is another great channel for offering personalized offers to customers that make them feel closer to the brand. To build the most enjoyable customer experience possible, it's a great idea to differentiate designed campaigns among customers who meet specific criteria. For example, differentiation based on the customer's level of activity in the app. This use case refers to a scenario where customers are divided into different segmentations - completely new to the app and those returning. The segmentation the customer belongs to will determine the type of recommendation they receive at the end. ## Prerequisites --- - [Implement Synerise SDK in your mobile application](/developers/mobile-sdk). - Implement `product.view` event in your [mobile application](/developers/mobile-sdk/event-tracking#product-viewed) - [Create two different recommendation campaigns](/docs/ai-hub/recommendations-v2) that will be directed to new and returning customers. Ex. top products for new customers, personalized products for returning customers. You can add additional [filters](/docs/ai-hub/recommendations-v2/recommendation-filters) if needed. - [Create two documents](/docs/assets/documents/introduction-to-documents) with the recommendation campaigns created before.
Exemplary content of a document
{ "name": "Top Products", "recommendations": "{% recommendations_json3 campaignId=COhsCCOdu8Cg %} {% endrecommendations_json3 %}" }

Where "campaignId" is the ID of your recommendation.

## Process --- 1. [Prepare segmentations](/use-cases/recommendations-for-new-and-returning-users#prepare-segmentations) for new and returning users. 2. [Create screen views](/use-cases/recommendations-for-new-and-returning-users#create-screen-views) with dedicated documents with AI campaigns created before. ## Prepare segmentations --- In this part of the process, create segmentations for new and returning users. This use case considers a returning user as a user who viewed at least two products in the mobile application. Users who do not match this condition are considered new. This logic is exemplary and may vary depending on your business needs. ### Segmentation for returning users 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Give the segmentation a meaningful name, for example `Returning users`. 3. Click **Choose filter** and select the **product.view** event. 4. Click **Add funnel step** and select the **product.view** event once again. 5. As the date range, select **Lifetime**. 6. Click **Apply**.
An example of segmentation of returning users
An example of segmentation of returning users
### Segmentation for new users 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Give the segmentation a meaningful name, for example `New users`. 3. Click **Choose filter** and select the segment you created in the [previous step](/use-cases/recommendations-for-new-and-returning-users#segmentation-for-returning-users). 4. From the **Choose operator** dropdown list, select **Is false (Boolean)**. 5. Click **Apply**.
An example of segmentation of new users
An example of segmentation of new users
## Create screen views --- In this part of the process, create screen views for the segmentations defined in the previous steps. Thanks to this, while fetching the screen views, the mobile application automatically receives content dedicated for a certain user. ### Create a screen view for returning users Create a screen view for returning users using the documents with recommendations targeted to those users. 1. Go to Experience Hub icon **Experience Hub > Screen views > Create screen view**. 2. Enter the name of the screen view. 3. Optionally, to let other users know about the purpose of this screen view, write a short description. 4. To define the recipients of your screen view, in the **Audience** section click the **Define** button and choose the [returning users segmentation](/use-cases/recommendations-for-new-and-returning-users#segmentation-for-returning-users). 5. Confirm your choice by clicking the **Apply** button. 6. To create the content of your screen view, in the **Content** section click the **Define** button. 7. Prepare and paste the JSON code with the collection of dashboards you want to include in the screen view. The code needs to define the way of presenting the dashboards (for example, as a vertical list). 8. Below the code text field, select the document with the recommendation for returning users by clicking the **Add document** button. 9. To define the schedule of the screen view, in the **Schedule** section click the **Define** button. 10. From the Timezone dropdown list, select a timezone for the schedule. 11. Select the start date by performing one of the following actions: - To launch the screen view immediately, select the **Immediately** option. - To select the start date: 1. Select the **Scheduled** option. 2. Click the **Select time** field. 3. Pick a date and select time. 4. Confirm by clicking **Apply**.
Screen views schedule overrides the schedule of individual documents.
12. **Optional**: In the **Type of period** section, define the times of day, days of the week, or days of the month when the screen view is active. 13. To complete the process, click the **Publish** button.
The configuration of the screen view for returning users
The configuration of the screen view for returning users
### Create a screen view for new users Create a screen view for new users using the recommendation documents targeted to those users. 1. Go to Experience Hub icon **Experience Hub > Screen views > Create screen view**. 2. Enter the name of the screen view. 3. Follow the same steps mentioned in the [previous step](/use-cases/recommendations-for-new-and-returning-users#create-a-screen-view-for-returning-users) using the [segmentation of new users](/use-cases/recommendations-for-new-and-returning-users#segmentation-for-new-users) and relevant document dedicated to those users. ## What's next --- For a campaign to be visible in a mobile app, it must fetch screen views and display defined campaigns using the appropriate SDK Method for [iOS](/developers/mobile-sdk/method-reference/ios/content#generate-screen-view) and [Android](/developers/mobile-sdk/method-reference/android/content#generate-screen-view), [React Native](/developers/mobile-sdk/method-reference/react-native/content#generate-screen-view), [Flutter](/developers/mobile-sdk/method-reference/flutter/content#generate-screen-view). ## Check the use case set up on the Synerise Demo workspace --- You can also check the configuration for [returning users](https://app.synerise.com/analytics-v2/segmentations/2ebfc8cb-a030-41f7-af7b-b19cc165b532) and [new users](https://app.synerise.com/analytics-v2/segmentations/605f7434-8544-4a1d-a0c0-6ba4c49aff3e) directly in the Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Documents](/docs/assets/documents/introduction-to-documents) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Screen views](/docs/campaign/screen-views/introduction-to-screen-views) - [Segmentations](/docs/analytics/segmentations/introduction-to-segmentations) # Referral program Want an effective way to attract new customers? Use referral programs to work for you. Referral marketing is a great way to reach out to future customers while engaging your current ones to endorse your brand. A win-win benefit for both parties. Referral programs are one of the most powerful tools in building your sales by encouraging your customers to share something valuable with their friends. The power of a customer recommending your product to their friends is undeniable. When they do, they not only help you win business, but also increase awareness of your brand, which ultimately helps you reap big profits. This use case describes the process of creating a refferal program by which current users of a mobile app can refer it to their friends and earn additional loyalty points for this action. **The main principles of the referral program:** **Referrer** An active user of the application can refer it by distributing its unique code among friends and will receive 500 loyalty points as a reward. The list below contains the business assumptions this use case is based on: - A unique code is generated for each active app user, which they can share with their friends as a part of the referral program. In order to see their code, users must verify phone number first. Only after the phone number is correctly verified, the code is displayed in the user's account. - A user can only receive 500 loyalty points when the invitee downloads the app, makes a purchase for min. $20, and has a verified phone number. - A user can recommend the app to a maximum of 3 people. When as all 3 invited users make a purchase, the referrer receives points (3x500) and the code section disappears which means the user can no longer continue to refer the app. - Loyalty points can only be awarded to the referrer. - The referrer is informed each time after receiving loyalty points for referring the application through a mobile push. **Invitee** - A new user does not receive additional loyalty points for using the provided code. - The new user must have a verified phone number for the referrer to receive loyalty points. To simplify naming in this use case, in further steps of the process referrer will be represented as `user 1` and invitee will be described as `user 2`. ## Prerequisites --- - Implement [loyalty programs basics](/use-cases/loyalty-programs-basics) - Integrate Synerise [mobile SDK](/developers/) in your mobile application. - Implement [mobile pushes](/developers/mobile-sdk/configuring-push-notifications) in your mobile application. - [Configure mobile push notifications](/docs/campaign/Mobile/mobile_campaign) ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/referral-program#create-an-aggregate-that-counts-the-sum-of-all-user-transactions) that counts the sum of all user transactions. 2. [Create a segment](/use-cases/referral-program#create-a-segment-of-users-who-meet-the-requirements-of-the-referral-program) of users who meet the requirements of the referral program. 3. [Create an expression](/use-cases/referral-program#create-an-expression-that-determines-the-number-of-points-awarded-for-each-referral) that determines the number of points awarded for each referral. 4. [Create an expression](/use-cases/referral-program#create-an-expression-to-determine-the-maximum-number-of-points-to-be-awarded) to determine the maximum number of points to be awarded. 5. [Create a workflow](/use-cases/referral-program#create-a-workflow-that-generates-a-unique-referral-code) that generates a unique referral code for the user 1. 6. [Create a workflow](/use-cases/referral-program#create-a-workflow-that-adds-referral-points) that adds referral points to user 1. 7. [Create an expression](/use-cases/referral-program#create-an-expression-that-calculates-the-number-of-points-remaining-for-user-1) that calculates the number of points left. 8. [Prepare a mobile push notification](/use-cases/referral-program#prepare-a-mobile-push-notification). 9. [Create a workflow](/use-cases/referral-program#create-a-workflow-that-assigns-the-number-of-points-awarded) that assigns the number of codes awarded to user 1. ## Create an aggregate that counts the sum of all user transactions --- In this part of the process, create an aggregate that returns the sum of all transactions a user made. This aggregate will be used to describe a condition (an invited user must spend at least $20, so the referring person can receive loyalty points for a referral) in a segmentation that will be created in further part of the proces. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Sum**. 4. From the **Choose event** dropdown list, select the **transaction.charge** event. 5. As the event parameter, select **$revenue**. 6. Set the period from which the aggregate will analyze results to **Lifetime**. 7. Save the aggregate.
Decision Hub Sum aggregate returning the total revenue from transaction.charge events over a customer's lifetime
Aggregate settings
## Create a segment of users who meet the requirements of the referral program --- The conditions that **user 2** must meet include: - execution of transactions for a minimum of $20, - verification of the phone number, - user 1 can receive loyalty points for a successful referral of a friend only once - the last condition is a security feature: **webhook.response** with the addition of points to **user 1** can not occur more than 1 time. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New Segmentation**. 2. Enter the name of the segmentation. 3. Choose **Add condition** and find the [aggregate counting the sum of all user transactions](/use-cases/referral-program#create-an-aggregate-that-counts-the-sum-of-all-user-transactions), created in the previous step. 4. From the **Choose operator** dropdown, choose **Number**, and then select **More or equal to**. 5. In the next field, enter the required transaction value, in our case it is `20`. 6. Choose **Add condition** and find **phoneVerified** tag. 7. From the **Choose operator** dropdown, choose **Is true**. 8. Choose **Add condition** and find **webhook.response** event. 9. Click the + where button, from the **Choose parameter** dropdown menu, choose **name**. 10. From the **Choose operator** dropdown, choose **Contain**. 11. In the next field, type `add points to user 1`.
`add points to user 1` is the name of the Outgoing Integration node used in [this automation](/use-cases/referral-program#create-a-workflow-that-adds-referral-points).
12. Change the **Performed** action to **Not performed** by clicking the **Performed** word. 13. Set the period from which the aggregate will analyze results to **Lifetime**. 14. Save the aggregate.
The segmentation settings
The segmentation settings
This segmentation will be used [in a workflow that assigns loyalty points to user 1](/use-cases/referral-program#create-a-workflow-that-adds-referral-points). ## Create an expression that determines the number of points awarded for each referral --- In this part of the process, create an expression that will later be used to assign a defined number of points to **user 1** for an application referral. In our case, each user receive 500 points for each referral. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Leave the **Expression** option at default (**Attribute**). 4. Click the **Select** button. 5. Choose **# Constant**. 6. Open the settings of Constant value by clicking `0`. 7. In the field below, type `500` 8. Click **Save**. ## Create an expression to determine the maximum number of points to be awarded --- In this part of the process, you will create an expression that determines the maximum number of points that can be awarded to **user 1**. In our case, it is 1500 points. This expression will be used to [calculate the number of points remaining for user 1](/use-cases/referral-program#create-an-expression-that-calculates-the-number-of-points-remaining-for-user-1). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Leave the **Expression** option at default (**Attribute**). 4. Click the **Select** button. 5. Choose **# Constant**. 6. Open the settings of Constant value by clicking `0`. 7. In the field below, type `1500` 8. Click **Save**. ## Create a workflow that generates a unique referral code --- In this part of the process, you will create a workflow that will generate a unique referral code for both new users who are about to join the application and existing ones, which will be stored in the **my_referral_code** attribute. In addition, you will generate a special attribute that will be used to count the number of codes granted to **user 1** - **referral_points_received**. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger nodes Configure the conditions that will trigger the workflow. In this case, you will run a workflow for new users who are just joining the application and for existing users for whom the code has not been generated yet. #### Define the Profile Event node 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From **Choose event** dropdown menu, choose `client.add` event. 2. Confirm by clicking **Apply**. #### Define the Audience node 1. Add the **Audience node**. 2. In the configuration of the node, leave the value of the **Run trigger** option at default (**one time**). 3. In **Define audience**, choose **New Audience** and click **Define conditions**. 1. As the first condition, from **Choose filter** dropdown menu, choose `anonymous_type` attribute. 2. From the **Choose operator** dropdown list, select **Equal**. 3. **Result**: A text field appears. 4. In the text field type `NONE`.
The `anonymous_type` attribute determines whether the profile is anonymous or recognized. By selecting the value `NONE`, you will include only recognized users.
5. Click **Choose filter** and from the dropdown list, select **my_referral_code**. 6. From the **Choose operator** dropdown list, select **Boolean - Is true**. 7. Change the **Profiles matching attribute** option to **Profiles not matching attribute** by clicking the **matching** word. 8. Click **Apply**. ### Add the Merge Paths node Join the paths of the triggers created in the previous step by adding a **Merge Paths** node. ### Configure the Delay node 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `3`. 2. From the dropdown list, choose **Second**. 2. Click **Apply**. ### Define the Profile Filter node In this step, you will check whether the user passing this workflow already has the **my_referral_code** attribute assigned to their profile. If the user does not have the **my_referral_code** attribute, it will be generated in the next step of the workflow. If the user already has this attribute assigned, the flow ends. 1. Add the **Profile Filter** node. 2. In the settings of the node, click **Choose filter** and from the dropdown list, select **my_referral_code**. 3. As the **Operator**, choose **Boolean - Is false**. 4. Click **Apply**. 5. Add the **End** node to the unmatched path from the **Profile Filter** node. ### Define the Update Profile node In this part of the process, you will create an attribute **my_referral_code** for users who do not have this attribute yet. - The attribute value with a unique referral code will be generated using the Jinjava code presented in the following steps. - The generated code will be used by **user 1** to invite friends to the application. For later tracking of points received by **user 1**, an additional attribute is added - **referral_points_received**, which is initially assigned the value `0`, since the user has not yet received points for the referral. 1. Join the matched paths from the **Profile Filter** node with the **Update Profile** node. 2. From the left dropdown list, select **Attributes > my_referral_code**. 3. From the right dropdown list, select **Change**. 4. In the text field, add Jinjava that will generate a unique reference code for **user 1** based on the user's unique client ID.
For security reasons, we do not publish any examples. In case you need any support in creating such a unique mechanism, do not hesitate to contact us, we will be happy to help.
5. Click **Add field** and from the dropdown list, select **Attributes > referral_points_received** 6. From the right dropdown list, select **Change**. 7. In the text field, enter `0`. 8. Click **Apply**.
The configuration of the Update Profile node
The configuration of the Update Profile node
9. Select the **End** node.
Automation Hub workflow for generating a unique referral code for each eligible customer
Final configuration of the workflow
## Create a workflow that adds referral points --- In this part of the process you will create a workflow that will add points to **user 1** if all the necessary conditions are met, such as: - **user 2** has made a transaction for a minimum of $20, - **user 2** has a verified phone number, - **user 1** has not exceeded the limit of the possible number of referrals (3 referrals). 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger nodes Configure the conditions that will trigger the workflow. In this case, the workflow is triggered for invited users who have already verified their phone number or completed a transaction. Meeting both conditions will also be checked in a further step of the workflow. #### Define the Profile Event node 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From **Choose event** dropdown menu, choose `transaction.charge` event. 2. Confirm by clicking **Apply**. #### Define the Profile Event node 1. Add **Profile Event**. In the configuration of the node: 1. From **Choose event** dropdown menu, choose `client.addTag` event. 2. Click the + where button, from the **Choose parameter** dropdown menu, choose **name**. 3. From the **Choose operator** dropdown, choose **Equal**. 4. In the next field, type `phoneVerified`.
The tag name shown in this case is only an example. You can use any other tag that is dedicated to recognizing a verified phone number.
2. Confirm by clicking **Apply**. ### Add the Merge Paths node Join the nodes defined in the previous step into a single path using the **Merge Paths** node. ### Configure the Delay node 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `10`. 2. From the dropdown list, choose **Second**. 2. Click **Apply**. ### Define the Profile Filter node In this step, you will verify if all conditions have been met in order to assign points to **user 1** . If not, the workflow ends for a user. 1. Add the **Profile Filter** node. 2. In the settings of the node click **Choose filter** and from the dropdown list, select the segmentation you already created in [this step](/use-cases/referral-program#create-a-segment-of-users-who-meet-the-requirements-of-the-referral-program). 3. As the **Operator**, choose **Boolean - Is true**. 4. Click **Apply**. ### Define the Outgoing Integration node In the **Outgoing Integration** node, you will create a webhook that will find the user to whom the points should be assigned - **user 1**. Outgoing Integration will be performed only for users who meet the conditions defined in the **Profile Filter** node, otherwise the flow is finished - to the **Not matched** path from the **Profile Filter** node, add the **End** node. 1. Add the **Outgoing Integration** node for the matching path. 2. In the **Definition** section, choose the **Custom webhook** tab. 3. In the **Webhook name** field, enter a name for the webhook. In this case `find user 1`. 4. Select the **GET** method. 3. In the URL of the endpoint, enter `https://api.synerise.com/crm/v1/list?search=my_referral_code:{{client.friends_referral_code}}`.
We are looking for a profile in Synerise whose attribute value corresponds to the referrer.
5. In the **Authorization** section, select **by API key** as your method of authorization. 6. From the dropdown list below, select your **API key**. 7. Click **Apply**. ### Define the Event Filter node In this step, you will check whether: - **user 1** has been found, - **user 1** has already reached the maximum number of possible points received from the referral program, - there are no phone fraud tags for this user (the number of that user isn't used in more than one profile). 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Check** field, leave the default value **without limits**. 2. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `webhook.response` event. 3. Click the + where button, from the **Choose parameter** dropdown menu, choose **name**. 4. From the **Choose operator** dropdown, choose **Equal**. 5. In the next field, type `find user 1`. 6. From the **Choose parameter** dropdown menu, choose **body.customers[0].referral_points_received**.
In order for such a parameter to appear in the webhook.response options, you need to launch the automation at least once for a test user.
7. From the **Choose operator** dropdown, choose **Less or equal**. 8. In the next field, type `3` 2. Confirm by clicking **Apply**. ### Define the Outgoing Integration node In this **Outgoing Integration** node, you will create a webhook that sends the **points.upcharge** event that adds points to **user 1**. 1. Add the **Outgoing Integration** node for the matching path. 2. In **Definition** section, choose the **Custom webhook** tab. 3. In the **Webhook name**, field enter a name for the webhook. In this case `add points to user 1`. 4. Select the **POST** method. 3. In the URL of the endpoint, enter `https://api.synerise.com/v4/events/custom`. 5. In the headers section: - set `content-type` value to `application/json` - set`accept` value to `application/json` - define `api-version` to `4.4` 6. Enter the request body. The structure of the request body includes: - the expression created in [this step](/use-cases/referral-program#create-an-expression-that-determines-the-number-of-points-awarded-for-each-referral) - dynamic reference to a customer ID
{
        "time": "",
        "label": "refer a friend points",
        "action": "points.upcharge",
        "client": {
            "id": {{event.params['body.customers[0].id']}}
        },
        "params": {
            "points": {% expression %} f05e644c-7009-49d0-9208-18e9319af4a5 {% endexpression %},
            "description": "referral_points"
        }
      }
7. In the **Authorization** section, select **by API key** as your method of authorization. 1. From the dropdown list below, select your **API key**. 8. Click **Apply**. ### Add the End node 1. On the **Outgoing Integration** node, click the plus button. 2. From the dropdown list, select **End**. 3. Save and activate the automation by clicking **Save&Run**.
Automation Hub workflow for verifying referral conditions and adding loyalty points to the referring customer
Final configuration of the workflow
## Create an expression that calculates the number of points remaining for user 1 --- In this part of the process, you will create a formula that will calculate the number of points remaining for **user 1**. To do this, you will subtract the value of the **points.upcharge** event from [the expression with the maximum number of points](/use-cases/referral-program#create-an-expression-to-determine-the-maximum-number-of-points-to-be-awarded). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Leave the **Expression** option at default (**Attribute**). 4. In the formula of the expression: 1. Click **Select**. 2. From the dropdown list, select **Function > Profile**. 3. Click the **unnamed** node. 4. At the bottom of the page, click **Choose attribute**. 5. From the dropdown list, select the [expression with the maximum number of points](/use-cases/referral-program#create-an-expression-to-determine-the-maximum-number-of-points-to-be-awarded) you created earlier. 6. Click + button and from the dropdown list select **Profile**. 7. Click the **unnamed** node. 8. At the bottom of the page, click **Choose attribute**. 9. From the dropdown list, select the **points.upcharge** attribute. 10. Click the + button and change it to `-`. 11. In the upper-right corner, click **Save**. 12. In the upper-right corner, click **Publish**.
Final configuration of the expression
Final configuration of the expression
## Prepare a mobile push notification --- Prepare a mobile push notification informing about the number of points awarded and points remaining for **user 1**, which will be used in the workflow created in the next steps of the process. 1. Go to **Experience Hub > Mobile > Templates**. 2. Create your mobile push using the code editor or Drag&drop builder. 3. If you use the code editor, you can use the code sample available below and adjust it as needed.
Remember to change the expression IDs in this code, as they refer to the expressions created in this use case.
Check the Jinjava code
{ "notification": { "title": "You have earned 500 points!", "body": "Congratulations!!! You just earned 500 points for the registration of a new referred user!", "sound": "default", "priority":"high" }, "data": { "issuer": "Synerise", "message-type": "static-content", "content-type": "simple-push", "content": { "notification": { "action": { "type": "OPEN_APP" } } }, "payload": { "type": "points-earned", "pointsReward": "{% expression %} f05e644c-7009-49d0-9208-18e9319af4a5 {% endexpression %}", "title": "You have earned 500 points!", "subtitle": "Thank you for being with us!", "description": "You receive 500 points for the registration of a new user. You can earn {% expression %} 819f23f5-4f97-4039-b3ef-eb83130ac7c6 {% endexpression %} more points for the registration of additional users in the application." } } }
## Create a workflow that assigns the number of points awarded --- In this part of the process, you will create a workflow that will assign the amount of times that points have been awarded to **user 1**. This information is stored in the **referral_points_received** attribute. Once the **referral_points_received** attribute is updated, **user 1** will receive information about the number of points still to be earned, in the form of a mobile push. ### Define the Profile Event node Configure the condition that will trigger the workflow. This workflow will be triggered by the event generated in the previuos step - `points.upcharge`. 1. Add the **Profile Event** node. In the configuration of the node: 2. From **Choose event** dropdown menu, choose `points.upcharge` event. 3. Click the + where button, from the **Choose parameter** dropdown menu, choose **description**. 4. From the **Choose operator** dropdown, choose **Contain**. 5. In the next field, type `referral_points`. 6. Confirm by clicking **Apply**. ### Configure the Delay node 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `3`. 2. From the dropdown list, choose **Second**. 2. Click **Apply**. ### Define the Profile Filter node In this step, as well as in further steps related to the **Profile Filter** node, you will check whether the **user 1** **referral_points_received** attribute is equal to `0`, `1` or `2`, presenting the total number of times user 1 has received referral points. Depending on the value of the attribute, it will be increased by one. For example: - if the attribute value is equal to `0`, it will be updated to `1`; - if the attribute value is equal to `1`, it will be updated to `2`; - if the attribute value is equal to `2`, it will be updated to `3`. 1. Add the **Profile Filter** node. 2. In the settings of the node, click **Choose filter** and from the dropdown list, select **referral_points_received**. 3. As the **Operator**, choose **Equal**. 4. In the next field, enter `0`. 5. Click **Apply**. 6. To the **Matched** path, add the **Update Profile** node. ### Define the Update Profile node In this part of the process you will update the **referral_points_received** attribute by increasing its value by a unit. 1. Select the **Update Profile** node. 2. From the left dropdown list, select **Attributes > referral_points_received**. 3. From the right dropdown list, select **Change**. 4. In the text field, type `1`. 5. Click **Apply**. ### Define the Send Mobile Push node Add **Send Mobile Push** node. This node will send a mobile push to **user 1** with information about the number of points still available to earn from the referral campaign. 1. Select the type of the mobile push notification as **Simple Push**. 2. Select the push template, created [in this step](/use-cases/referral-program#prepare-a-mobile-push-notification) with the information about points gained. 3. Skip the **Additional parameters**. 3. Confirm the settings by clicking **Apply**. ### Add the End node Add the **End** node for this part of the flow. To the **Not Matched** path from the [Profile Filter node](/use-cases/referral-program#define-the-profile-filter-node-2) add **Profile Filter node**. ### Define the Profile Filter node In this step, you will check whether the attribute **referral_points_received** of **user 1** is equal to `1`. 1. Add the **Profile Filter** node after the first **Profile Filter** node. 2. In the settings of the node, click **Choose filter** and from the dropdown list, select **referral_points_received**. 3. As the **Operator**, choose **Equal**. 4. In the next field, type `2`. 5. Click **Apply**. 6. Define the **Update Profile** node for the **Matched** path. For the **Matched** path: 1. Define the **Update Profile** node in the same way as in the [previous node](/use-cases/referral-program#define-the-update-profile-node-1), but updating the value of the **referral_points_received** attribute to `2`. 2. Add **Send Mobile Push** node with the same settings as in [this step](/use-cases/referral-program#define-the-send-mobile-push-node) of the process. 3. Add the **End** node. For the **Unmatched** path of the [Profile Filter node](/use-cases/referral-program#define-the-profile-filter-node-3): 1. Define **Profile Filter** node that will check whether the attribute **referral_points_received** of **user 1** is equal to `2`. For the **Unmatched** path, add the **End** node. 2. For the **Matched** path: 1. Define **Update Profile** node updating the value of the **referral_points_received** attribute to `3`. 2. Add **Send Mobile Push** node. 3. Add the **End** node. 3. Save and activate the automation by clicking **Save&Run**.
Automation Hub workflow for tracking referral point awards and sending mobile push notifications to the referring customer
Final configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of all process steps directly in the Synerise Demo workspace: - [Aggregate that counts the sum of all user transactions](https://app.synerise.com/analytics/aggregates/8072b100-e090-3d59-8067-c27df1e1d735) - [Segment of users who meet the requirements of the referral program](https://app.synerise.com/analytics-v2/segmentations/9323140e-6226-4117-8b79-06bb088d828c) - [Expression that determines the number of points awarded for each referral](https://app.synerise.com/analytics/expressions/f05e644c-7009-49d0-9208-18e9319af4a5) - [Expression to determine the maximum number of points to be awarded](https://app.synerise.com/analytics/expressions/3581a34e-6dbb-431a-a84d-987826a28b94) - [Workflow that generate a unique refferal code for user 1](https://app.synerise.com/automations/automation-diagram/5928505b-2814-4f20-b160-405bb2607877) - [Workflow that add referral points to the user 1](https://app.synerise.com/automations/automation-diagram/5c270e53-3b72-462e-985b-b2eac91e5a0e) - [Expression that calculate the number of points remaining for user 1](https://app.synerise.com/analytics/expressions/819f23f5-4f97-4039-b3ef-eb83130ac7c6) - [Workflow that assign the number of codes granted by user 1](https://app.synerise.com/automations/automation-diagram/91b849b9-0196-4e5a-aa04-8db479c9143c) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 31 events per profile that completes the flow: [`client.add`](/docs/assets/events/event-reference/profiles#clientadd) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~3), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~14), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~3), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~2), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`client.addTag`](/docs/assets/events/event-reference/profiles#clientaddtag) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~2), `points.upcharge` (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Expressions](/docs/crm/expressions) - [Segmentation](/docs/analytics/segmentations) # Report with top purchased products per store Tracking top purchased products for each store offers a valuable way to understand customer behavior and optimize product exposure. This use case shows how to generate daily reports that calculate and display the 10 best-selling products for every individual store (represented as profiles in the CRM), based on transaction data. The report is created dynamically and filtered with flexible business rules. Once generated, these results can be used for many purposes, for example: – you might send the top products to an external tool and display them as personalized banners in a given store or use them in targeted campaigns. - top-product reports can be used to adjust local inventory planning. - items that perform well in a particular store can be positioned more prominently. - you can create discounts offers based on each store's top performers. Knowing what sells best in each store gives you an edge – not just for backend analytics, but for improving the customer journey. You can **highlight bestsellers on local pages, power in-store digital signage, or inform stock planning**. It enables better personalization and relevance across channels and improves business responsiveness to customer demand in specific locations. This specific use case was used by our customer to present top 10 products per store in digital signage in offline stores. Displaying top-performing products on screens inside the store draws customer attention to popular items, reinforces social proof, and can drive impulse purchases. ## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes). - Implement the [transaction events](/developers/web/transactions-sdk). Your transactions must be properly tracked and include identifiers of the shop (`StoreId`) to enable product-level reporting. - Stores must be created as individual profiles in the CRM. Every store profile must include a `StoreId` parameter – this should be a unique identifier for each store. It is required to group transaction data and generate reports per store. Additionally we assign [profile tags](/docs/crm/customer-tag) to all stores (in our case, `store-top-products`) to make it easier to find and extract them. To correctly identify the store in the system: - Add a `custom_identify` field to the store’s profile with the same value as `StoreId`. In the Synerise platform, this will appear as Custom identifier. - You can use Jinjava that references a store through the `custom_identify` parameter (for example, when sending events through an outgoing integration). This setup ensures consistent and reliable store identification across processes. - Create a workspace [API Key](/docs/settings/tool/api) and assign the following permissions: - `ANALYTICS_BACKEND_REPORT_READ` - it lets you [retrieve a summary of all reports in the workspace](https://hub.synerise.com/api-reference/analytics-suite#operation/previewAllGroupingsCSVPOST_v4). Make sure the API Key used for sending events has the necessary event send permissions enabled. - `API_BATCH_EVENTS_CREATE` ## Process --- In this use case, you will go through the following steps: 1. [Create a metric](/use-cases/report-with-top-products#create-a-metric) which counts the number of transactions for each store. Thanks to setting a dynamic key, in the following steps we will be able to properly filter events within a given store. 2. [Create a report](/use-cases/report-with-top-products#create-a-report) based on the metric created earlier, which lists the top 10 purchased products per store. 3. [Create a workflow](/use-cases/report-with-top-products#create-a-workflow) that dynamically refers to the report, retrieves the top 10 products for each store based on defined business conditions (e.g., availability), and generates an event for each top product on the profile card of each store. 4. [Create a final metric](/use-cases/report-with-top-products#create-final-metric) based on events generated in the workflow. 4. [Create final report](/use-cases/report-with-top-products#create-final-report) based on the metric whose conditions are built on the events generated in the workflow. ## Create a metric --- In this part of the process, create a metric which counts the number of transactions for each individual store. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the metric type, select **Event**. 3. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `product.buy`. 6. Click **+ where** button and from the dropdown list, choose `StoreId` parameter. 7. From the **Choose operator** dropdown, select **Contain (String)**. 8. Click the icon next to the **Equal** operator two times to find dynamic key icon Dynamic key icon 9. In the first box add `StoreId` and in the second add any value (in our case it might be `0`). 10. Define the period from which the metric will return products from the event as **7 days**. 11. Click **Save**.
Metric settings
Metric settings
## Create a report --- In this part of the process, create a report to clearly show the list of top products purchased in the shops. 1. Go to Behavioral Data Hub icon **Decision Hub > Report > New report**. 2. Enter the name of the report. 3. Select the metric you created in [the previous part of the process](/use-cases/report-with-top-products#create-a-metric). 4. From the **Range** dropdown list, select the number of top (the most frequently added to favorites) products to be shown in the preview of the report. In this case it will be **TOP 100** products.
When creating a consolidated report of top-selling products across multiple stores, it is recommended to retrieve more than just the top 10 products (e.g., top 100 or more). This is because the combined list of bestsellers does not always reflect the top 10 products in each individual store. Some products that rank in the top 10 in specific stores might not appear in the overall top 10 list. By increasing the number of products included in the report, you ensure that local top-performing items are not missed and that it's possible to accurately identify the top 10 for each store.
5. In the **Dimension** section, from the dropdown list select **Events > Parameters**. To be able to show products name in the report, choose `$name`. 6. Click **Add dimension**. 7. From the list, choose `$sku`. 8. Below, add additional dimension - `StoreId`.
In this particular use case, we use three dimensions: name, storeID and SKU. This way, we will receive the SKU and name of the products in the report and information in which shop it was bought. You can use any number of dimensions based on your business needs.
6. In the date range, select the time that will be analyzed. In this case it will be **7 days**.
Select the same date range as you selected for the metric.
7. Save the report.
Report settings
Report settings
## Create a workflow --- In this part of the process, you will create the workflow which sends an event with the current top 10 products from each store. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Add the Audience node In this step you will create the audience who will get the report you have created. 2. From the list of available triggers, select **Audience**. 3. Click the node. 4. Set the **Run trigger** to repeatable. 5. Define the frequency of launching the workflow (the **Interval** field) and when your workflow will be launched for the first time (the **Begin at** field). 4. In the **Define audience**, select the **New audience**. Choose the tag used to extract the group of stores - `store-top-products` created as a part of [prerequisites](#prerequisites). 5. As the parameter choose **Is true**. 5. Click **Apply**.
The Audience node settings
The Audience node settings
### Add the Outgoing Integration node This webhook will be used to get the storeID from the report created in the [previous step](#create-a-report). We send here all top products, ID of the store and products. We will make a request to [this endpoint](https://hub.synerise.com/api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-recalculate-report-override).
This step uses a webhook to automatically retrieve the contents of the report via API, based on the store’s ID. This is necessary because: - reports in Synerise are calculated dynamically, - store-specific filtering must happen at runtime, per each store profile in the audience, - the API enables automation – instead of downloading and filtering data manually, each store profile receives its own filtered results based on the same report definition. This makes the workflow scalable across hundreds of stores, ensures daily updates, and avoids manual effort.
1. Select the **Custom webhook** tab. 7. Select the method of authorization as **Synerise API key**. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/azure-blob-storage/get-file-azure-blob-storage). - If you selected an existing connection, proceed with the integration settings. 2. In the **Webhook name** field, enter `ReportTopProducts`. 4. Click on the **Event name** and choose **Create event** 5. In **Name**, enter `topProducts.webhook`. 6. In **Display name**, enter the label for the event. 3. Select the **POST** method. 4. Enter the endpoint: `https://hub.synerise.com/api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-recalculate-report-override` - Replace with the unique ID of your own report. You can find the report ID in the URL when you open the report in Synerise (e.g., https://app.synerise.com/analytics/reports/32bf9328fb8). 4. Leave the **content-type** at default (`application / json`). 5. In the request body, paste the code presented below.
Check the examplary JSON body of the report
{ "variables": [ { "name": "storeId", "value": "{ customer storeId %}" } ] }
If you want to send more information about the products and transactions, just add them to the code on your own, based on your business needs.
8. From the dropdown list, select the API key you created as a [part of prerequisites](#prerequisites). 7. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to trigger Analytics Suite report recalculation
Webhook settings
### Define the Event Filter node --- This node will wait for the webhook response. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. Add the name of the node. 2. Set the **Check** option to **for period of time**. 2. Set the time range. In our case, it is **10 minutes**. 3. In the **Define conditions** section, from the **Choose event** dropdown menu, choose `topProducts.webhook` event. 4. Confirm by clicking **Apply**.
Event Filter node settings
Event Filter node settings
### Add the Outgoing Integration node To the **matched path** add the Outgoing Integration. In this node, we retrieve the results from reports generated by previous nodes in the workflow. The goal is to extract relevant product data (like SKU, name, URL, price, and brand) and construct a structured event that can be used downstream — for example, in product recommendations or messaging flows. 1. Select the **Custom webhook** tab. 7. Select the method of authorization as **Synerise API key**. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/azure-blob-storage/get-file-azure-blob-storage). - If you selected an existing connection, proceed with the integration settings. 2. In the **Webhook name** field, enter `Top products per store`. 4. Click on the Event name and choose **Create event** 5. Add the new event. 4. As the event name add `topBoughtProducts.perStore`. 6. In **Display name**, enter the label for the event. 3. Select the **POST** method. 4. Enter the endpoint: `https://hub.synerise.com/api-reference/data-management#tag/Events/operation/BatchSendEvents` 4. Leave the **content-type** at default (`application / json`). 5. In the request body, paste the code presented below.
Check the examplary JSON body of the report
{# Here we retrieve the results of reports from previous nodes #} {% set raport1 = automationPathSteps['data1'].event.params['body.data[0].values[0]'] %} {% set allRaports = [raport1] %} {# We iterate over retrieved reports and add arrays of skus of products from them to the skusArrays #} {% set skusArrays = [] %} {%- for raport in allRaports -%} {% set arr = [] %} {%- for entry in raport -%} {% do arr.append(entry.name[0]) %} {%- endfor -%} {% do skusArrays.append(arr) %} {%- endfor -%} {% set finalArr = [] %} {%- for skuArr in skusArrays -%} {%- for sku in skuArr -%} {%- if finalArr|length < 10 -%} {% catalogitemv2.store-1(sku) allowEmpty=True %} {% set prod = catalog_result %} {%- if prod.name and prod.brand -%} {#Here we can add conditions to check#} {%- do finalArr.append({ 'sku': sku, 'name': prod.name, 'productUrl': prod.productUrl, 'price': prod.price, 'brand': prod.brand.label }) -%} {%- endif -%} {% endcatalogitemv2 %} {%- endif -%} {%- endfor -%} {%- endfor -%} {% set data = [] %} {# Here we set the final object to send #} {%- for promotion in finalArr -%} {% do data.append({ "client": { "customId": "{% customer StoreId %}" }, "label": "Magic products", "action": "magic.products", "type": "custom", "params": promotion, }) %} {%- endfor -%} {# We convert the object to JSON and this is the body of our request #} {% if data|length > 0 %} {{ data|tojson }} {% else %} {{ [{ "client": { "customId": "{% customer StoreId %}" }, "label": "Magic products", "action": "magic.products", "type": "custom", "params": { "alert": "No products matched the conditions" } }] | tojson }} {% endif %}
This part of the workflow processes the top products per store: - It retrieves the list of SKUs from the report results (fetched via the webhook from the previous step). - For each SKU, it queries the catalog feed to enrich the product data with: additional parameters like e.g. name, price, brand, etc. - It builds an array of up to 10 enriched product items, skipping those that are incomplete (e.g., missing name or brand). - This webhook generates a custom event with action top.products, containing enriched product data (sku, name, price, etc.). This event becomes the source for the final metric and report that summarize the top products per store. It is also ready to be used in other systems (e.g., digital signage, product recommendations, banners, etc.).

Once the product data is collected, it’s structured into a standardized event format, with fields like label, action, type, and params, making it suitable for downstream use—such as powering features like **top.boughtproducts.perStore**.

As a safeguard, if no valid product data is found (for example, due to empty results or filtering logic), the system includes a clear message in the output indicating that no products were available, allowing for graceful fallback handling in the display or integration logic. 7. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to generate a custom event with enriched top products data
Webhook settings
### Prepare the final settings --- 1. Add the **End** nodes. 2. Optionally, define capping. 3. Optionally, add titles to each node so the workflow will be more understandable to your colleagues. 4. Activate the workflow by clicking **Save & Run**.
Workflow settings
Workflow settings
## Create final metric --- In this part of the process, create the metric based on the events generated in the workflow. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the metric type, select **Event**. 3. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `top.products`. 6. Click **+ where** button and from the dropdown list, choose `sku` parameter. 7. From the **Choose operator** dropdown, select **Is not empty**. 6. In the date range, select the time that will be analyzed. In this case it will be **7 days**. 11. Click **Save**.
Metric settings
Metric settings
## Create final report --- As the last step, create the final report, presenting the results of the report, created based on the events generated in workflow. 1. Go to Behavioral Data Hub icon **Decision Hub > Report > New report**. 2. Enter the name of the report. 3. Select the metric with top products you created in [the previous part of the process](#create-final-metric). 4. From the **Range** dropdown list, select the number of top (the most frequently added to favorites) products to be shown in the preview of the report. In this case it will be **TOP 100** products. 5. In the **Dimension** section, from the dropdown list select **Events > Parameters**. To be able to show products name in the report, choose `sku`. 6. Click **Add dimension**. 7. From the list, you can choose more dimensions - in our case it will be `brand` and `customIdentify` 6. In the date range, select the time that will be analyzed. In this case it will be **7 days**.
Select the same date range as you selected for the metric.
7. Save the report. 8. Click preview to see the results.
Report settings
Report settings
## What's next --- Information from this report might be used in the following campaigns: 1. **Integrate with in-store digital signage systems** Once the daily top 10 product reports per store are generated, the data can be automatically pushed to digital signage platforms. This enables real-time, localized content that reflects actual customer behavior in each specific store. Set up automated workflows to refresh signage content daily or as frequently as needed, ensuring that each store highlights its current bestsellers without manual intervention. 2. **Support merchandising decisions** Use these insights to test different product placements and monitor their performance visually and analytically, linking digital presentation with physical outcomes. 3. **Extend to omnichannel experiences** Consistent messaging across in-store signage, local landing pages, and mobile apps builds a seamless customer journey, with top products tailored to the customer's location. You’re free to use it however you like—whether that means simply downloading it or sending it to other tools for external analysis. There are a few ways to handle this: - You can also export it as a file. - You can send the data to an API. - You can use our existing nodes and integrations to forward it to other tools—depending on the number of products, certain requirements may apply. In such cases, we recommend getting in touch with our CSI team if you plan to process the data externally.
Each method has its own limitations and constraints, so please remember to contact our CSI team beforehand to avoid issues.
## Check the use case set up on the Synerise Demo workspace --- You can check the [metric](https://app.synerise.com/analytics/metrics/e45130c3-8015-4e18-acb7-6d93e09182d4), [report](https://app.synerise.com/analytics/reports/71161920-de46-4d23-a0c6-4d3073f44cca) and [workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/552bdef6-6980-48f6-8398-eea112320e9f), [final metric](https://app.synerise.com/analytics/metrics/4d04834f-fda1-4dce-af5f-3160d5071d8d) and [final report](https://app.synerise.com/analytics/reports/63d98cfc-cacf-4f6c-a656-1134a5d9d076) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 17 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `topProducts.webhook` (~1), `topBoughtProducts.perStore` (~1), `magic.products` (~10). ## Read more --- - [Automation Hub](/docs/automation) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) # Social proof A lot of purchases are made due to the recommendation heard from friends or people with similar preferences. People generally choose products that regularly sell out and get positive feedback. That is why it is worth putting social proof on the product page to authenticate the fact that customers like a new product. Then the visitors to your website are more likely to buy a product that other customers are happy with. Social proof can shape our decisions and increase the sales. We encourage you to add different types of social proof to the product page: - number of products already purchased during a specific range of time, - number of people who have viewed this product during specific range of time, - number of downloaded materials, - stock availability. ## Example of use - Electronics industry **Challenge** Our client from Electronics industry decided to inform customers how many users were interested in a particular item to convince them to make a purchase. The client did it in 2 ways: - If a product was visited by more than 1 person, customers get the notification how many users were watching the product in the last 1 hour. - Additionally, if a product was bought in last 24 hours, the social proof was enriched with information how many customers bought this product.
Screenshot presenting website with social proof dynamic content
Social proof campaign
**Results** 4% higher coversion than in group without Social proof ## Prerequisites --- - Implement a [tracking code](/docs/settings/tool/tracking_codes). - Manage [transaction events section](/developers/web/transactions-sdk). ## Process --- To prepare social proof, you have to create dynamic content with a metric, which will dynamically count particular event occurrence for each product. Perform the steps in the following order: 1. [Create metric with dynamic key](/use-cases/social-proof-particular-product#create-metric-with-dynamic-key). 2. [Prepare a dynamic content](/use-cases/social-proof-particular-product#prepare-a-dynamic-content). ## Create metric with dynamic key --- Social proof is a metric with a dynamic key, thanks to which the statistics on a product page will be displayed in real time and they will adjust to the product that is being currently viewed. In our case, we will follow two scenarios for the implementation of social proof: - [Metric with a page visit](/use-cases/social-proof-particular-product#metric-with-a-page-visit). - [Metric with the number of bought items](/use-cases/social-proof-particular-product#metric-with-the-number-of-bought-items). ### Metric with a page visit If you want to display a message that X users watched the product in the last X hours, you have to prepare a metric for **page.visit event**. 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **type**, **aggregator** and **occurrence** to default. 3. From the **Choose events** dropdown list, select **page.visit** (product:**retailer_part_no** in our example). 4. Click the **+ where button** and select a parameter that indicated a product ID - in this case its **$sku**. 5. From the **Choose operator** select **Contain**(product id in our example). 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time from which metric counts the page visit, for example last 24 hours (60 minutes in our example)
Screenshot presenting Metric with page visit
Metric for page visit
### Metric with the number of bought items If you want to display a message that X users bought the product in the last x hours, you have to prepare a metric for **product.buy**. 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **type**, **aggregator** and **occurrence** to default. 3. From the **Choose events** dropdown list, select **product.buy**. 4. Click the **+ where button** and select a parameter that indicated a product ID (in this case its **$sku**). 5. From the **Choose operator** select **Contain** (product id. in our example). 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time from which metric counts the page visit (24 hours in our example).
Screenshot presenting Metric Filter
Metric Filter
In the same way you can prepare metric for **addToCart** event
## Prepare a dynamic content --- To show a social prooof on your website, prepare a dynamic content. 1. Go to **Experience Hub > Dynamic content > Create communication**. 2. Choose **Insert Object** type. 3. In the **Audience** section, select **Everyone**. 4. In the **Content** section, select **Simple message** and by inserting CSS selector define where the social proof will display on your website. 5. In the **Content** tab, click **Create Message** and insert a code of the metrics which you prepared in the previous steps. - The customer will receive information about the number of visits to a given page and then how many times the product has been bought.
Check the Javascript with gif
(function(){ var availableMetrics = []; //Adding metric prepared in point 1.1 var firstMetricsVal = "{% socialproof %} xxx {% endsocialproof %}"; //Adding metric prepared in point 1.2 var secondMetricsVal = "{% socialproof %} xxx {% endsocialproof %}"; //Adding variant text for 1st metric one for person var textFirstMetricOnePerson = 'person is watching this product now.'; //Adding variant text for 1st metric for few people var textFirstMetricPeople = 'people are watching this product now.'; //Adding variant text for 2nd metric for person var textSecondMetricOnePerson = 'sold in the last 1 hour.'; //Adding variant text for 2nd metric for few people var textSecondMetricPeople = 'sold in the last 1 hour.'; function handleCounterText(val, variantA, variantB) { if (val.length === 1) { let finalVariant = getWordVariant(+val, variantA, variantB); return `${val} ${finalVariant}`; } else { let lastNumber = val.slice(-1); let finalVariant = getWordVariant(+lastNumber, variantA, variantB); return `${val} ${finalVariant}`; } } function getWordVariant(num, variantA, variantB) { if (num == 1) { return variantA; } else { return variantB; } } var firstMetrics = `
            

${handleCounterText(firstMetricsVal, textFirstMetricOnePerson,textFirstMetricPeople )}

`; var secondMetrics = `

${handleCounterText(secondMetricsVal, textSecondMetricOnePerson, textSecondMetricPeople)}

`; if (firstMetricsVal >= 1) { availableMetrics.push(firstMetrics); } if (secondMetricsVal >= 1) { availableMetrics.push(secondMetrics); } var wrapper = document.querySelector('#synerise-social-proof-place'); wrapper.style.position = "fixed"; var availableMetricsCounter = 0; setInterval(function() { if (document.querySelector('#synerise-social-proof') !== null&&document.querySelector('#synerise-social-proof>p')){ wrapper.removeChild(document.querySelector('#synerise-social-proof')); }; wrapper.insertAdjacentHTML('beforeend', availableMetrics[availableMetricsCounter]); if (availableMetrics.length === 1) { return; } if (availableMetricsCounter >= availableMetrics.length - 1) { availableMetricsCounter = 0; } else { availableMetricsCounter++; } }, 3000); })()
- The customer will get a graphic that will contain information about the number of visits and purchases of the product.
Check the Javascript with graphic
(function(){ //Adding metric prepared in point 1.1 var firstMetricsVal = "{% socialproof %} xxx {% endsocialproof %}"; //Adding metric prepared in point 1.2 var secondMetricsVal = "{% socialproof %} xxx {% endsocialproof %}"; //Adding variant text for 1st metric one for person var textFirstMetricOnePerson = 'person is watching this product now.'; //Adding variant text for 1st metric for few people var textFirstMetricPeople = 'people are watching this product now.'; //Adding variant text for 2nd metric for person var textSecondMetricOnePerson = 'sold in the last 1 hour.'; //Adding variant text for 2nd metric for few people var textSecondMetricPeople = 'sold in the last 1 hour.'; function handleCounterText(val, variantA, variantB) { if (val.length === 1) { let finalVariant = getWordVariant(+val, variantA, variantB); return `${val} ${finalVariant}`; } else { let lastNumber = val.slice(-1); let finalVariant = getWordVariant(+lastNumber, variantA, variantB); return `${val} ${finalVariant}`; } } function getWordVariant(num, variantA, variantB) { if (num == 1) { return variantA; } else { return variantB; } } var firstMetrics = `
                
${firstMetricsVal >= 1?('

'+handleCounterText(firstMetricsVal, textFirstMetricOnePerson,textFirstMetricPeople)+"

"):''} ${secondMetricsVal >=1?('

'+handleCounterText(secondMetricsVal, textSecondMetricOnePerson, textSecondMetricPeople)+'

'):''}
`; var wrapper = document.querySelector('#synerise-social-proof-place'); wrapper.style.position = "fixed"; if(firstMetricsVal >=1||secondMetricsVal >= 1){ if (document.querySelector('#synerise-social-proof') !== null){ wrapper.removeChild(document.querySelector('#synerise-social-proof')); }; wrapper.insertAdjacentHTML('beforeend',firstMetrics ); } })()
6. Schedule when the dynamic content has to be active
Screenshot presenting display settings
Set up display settings
1. Schedule when the dynamic content has to be active. 2. In the **Display settings**, define the circumstances the dynamic content will be shown: - **Always on landing**, on All pages if in CSS selector is unique selector for a product page. - Always on landing, **on a specific URL** which indicates a product page (for example, if a URL contains product), if CSS selector is not unique for a product page. ## Check the use case set up on the Synerise Demo workspace --- Check all items (metrics and dynamic content) created in this use case in our Synerise Demo workspace: - [Metric that returns the number of visits in last 60 minutes](https://app.synerise.com/analytics/metrics/623eaf91-2203-4974-aa1a-4226574d0ff7), -[Metric that returns the number of items sold in last 24 hours](https://app.synerise.com/analytics/metrics/bcf165b4-200b-4efb-8842-dff13d7df829), - [Dynamic content settings](https://app.synerise.com/campaigns/create/88c84fe3-db25-45c9-aef0-17bd1acbf861). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - [Metrics](/docs/analytics/metrics/introduction-to-metrics) # Automated Import of Customer Complaints as Custom Events via SFTP You can use Automation Hub to synchronize your customers' events thanks to the HTTPS and SFTP integrations that allow you to import data from your external sources to Synerise. This use case describes how to prepare an automated workflow that launches every day and imports data about customers' complaints to Synerise as custom events. The automation connects to an external resource using the SFTP protocol and imports data from a CSV file. One of the challenges addressed in this use case is the data transformation that consists of adding and renaming columns in the CSV file. ## Prerequisites --- - Host the .csv file with customer complaint data on an SFTP server. - Prepare sample of data that will be used in transformation. To do this, you can take the real file and remove rows until about 10 are left. ## Process --- 1. [Create a transformation](/use-cases/synchronize-complaint-data-as-custom-events#create-a-transformation) that will transform data from the .csv file. 2. [Prepare a workflow](/use-cases/synchronize-complaint-data-as-custom-events#prepare-a-workflow) that imports events from the SFTP server to Synerise. ## Create a transformation --- In this part of the process, you define the rules of modifying data. Each of the following sub-steps describes the individual changes performed on the file. The transformation which is the output of this part of the process is used later to [automate sending the data](/use-cases/synchronize-complaint-data-as-custom-events#prepare-a-workflow). The sample file is used to configure the transformation and preview its results. With a [library of transformation steps](/docs/automation/data-transformation-and-imports/transformations-and-data-operators) you can modify the file by adding, renaming, and merging columns as well as editing the values in the rows, and so on. In this example, we will use the **Add Column** and **Rename Columns** steps to transform a complaint file so it meets Synerise's import requirements. 1. Go to Automation Hub icon **Automation Hub > Transformations > New transformation**. 2. Enter the name of the transformation. 3. Click **Upload a new file or drag one here**. ### Add file with sample data This step allows you to add a data sample. In further steps, you define how the data must be modified. Later, when this transformation is used in the workflow, the system uses the rules created with the sample data as a pattern for modifying actual data. 1. Upload the file with the sample data. This is the sample used in this article: ``` reporter,complaint,date test@test.com,the item is faulty,2022-03-09T10:22:06.305+01:00 ``` 2. Set **Delimiter** and provide **Quotation mark** and **Escape character**.
Transformation file upload showing sample complaint data with reporter, complaint, and date columns
The configuration of the file upload
3. Click **Apply**. ### Add Column You can use the **Add Column** step to create a new column to the file, with a defined value. In this example, we need to add following columns: **type**, **label**, **action**. 1. On the right panel, click **Add step**. 2. From the dropdown list, select **Add Column**. 3. Click the **Add Column** step. 4. In the configuration of the step: 1. In the **Add Column** field, enter the unique column name. In our case: `type`. 2. Select the **Static value** option. The rows in the new column will be filled with the value you define. 3. As the value, enter `custom`.
Example of the configuration of the Add Column step, type
Example of the configuration of the Add Column step, type
4. Before you save the settings, you can check the preview of the file after changes in the **Results** tab. 5. Confirm by clicking **Apply**. 5. Add two more **Add Column** steps by repeating steps 1-4 with the following changes: - as the first column, add `label` and as the value to insert, enter `complaint` - as the second column, add `action` and as the value to insert, enter `complaint.reported`
Example of the configuration of the Add Column step, label
Example of the configuration of the Add Column step, label
Example of the configuration of the Add Column step, action
Example of the configuration of the Add Column step, action
### Rename Columns The column name is the key under which the data will be imported to Synerise and appear in the output file. In this example, we will use the **Rename Columns** step to rename the **reporter** column to **client.email**. 1. On the right panel, click **Add step**. 2. From the dropdown list, select **Rename Columns**. 3. Click the **Rename Columns** step. 4. In the configuration of the step: 1. Select the **reporter** column. 2. Under **Rename by**, select **Replacing**. 3. In the text field, enter `client.email`.
Example of the configuration of the Rename Columns step
Example of the configuration of the Rename Columns step
5. Before you save the settings, you can check the preview of the file after changes in the **Results** tab. 6. Confirm by clicking **Apply**. ### Preview and save the transformation 1. Preview the results in the **Output** tab. 2. In the upper right corner, click **Save**. **Result**:
Transformation for importing complaint data as custom events
The transformation configuration
After the transformation is saved, you can use it in the **Data Transformation Studio** node while preparing a workflow that imports the files. ## Prepare a workflow --- As the final part of the process, create a workflow which imports the custom events every day to Synerise. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 1. As the trigger node, add **Scheduled Run**. 2. In the configuration of the node: 1. Select the **Repeat runs** option. 2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace. 3. Define the frequency of the workflow (for example, every day at 6.00 A.M.). The workflow will automatically launch every day at the specified time.
Automation Hub Scheduled Run node configuration for triggering complaint data synchronization as custom events
The configuration of the Scheduled Run node
3. Confirm by clicking **Apply**. ### Configure settings for SFTP protocol Use the **Get File** node to retrieve the file from your server using the SFTP protocol. 1. Add the **Get File** node by clicking **THEN > SFTP - Get File**. 2. In the [**configuration of the node**](/docs/automation/integration/sftp-integrations/sftp-get-file): 1. Select the SFTP connection type as **Public key**, choose the connection in the **Select connection** field, and click **Next**. 2. Enter the path to your server. 3. Select the port. 4. Enter the path to the directory. 5. Enter the name of the file to import. 6. From the **File format** dropdown list, select **CSV**. 7. Verify and modify the delimiters if needed.
The configuration of the SFTP Get File node for importing complaint data
The configuration of the SFTP Get File node
3. Confirm by clicking **Apply**. ### Select the transformation 1. Add a **Data Transformation Studio** node. 2. In the configuration of the node, keep the default **From workflow context** option. 3. In the editor, click **Templates library**: 1. Select the [transformation you have created before](/use-cases/synchronize-complaint-data-as-custom-events#create-a-transformation). 2. Click **Use template**.
Example of the configuration of the Data Transformation Studio node
Example of the configuration of the Data Transformation Studio node
4. Confirm by clicking **Apply**.
You can also create a transformation directly in the **Data Transformation Studio** node instead of selecting a template.
### Import events 1. Add the **Import Events** node. In the settings of the node, you can check the list of the required columns. 2. Confirm by clicking **Apply**. ### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for synchronizing complaint data as custom events
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the [transformation](https://app.synerise.com/automations/data-transformation/64abbea9-fcaf-48a8-a90a-c1f04ff81ade) directly in Synerise Demo workspace. Also, you can check there the created [workflow](https://app.synerise.com/automations/automation-diagram/4f2777ae-7655-4e98-8609-5354bd4d962c). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `complaint.reported` (~1). ## Read more --- - [Data Transformation](/docs/automation/data-transformation-and-imports/introduction) - [Events](/docs/assets/events/introduction-to-events) # Monitor Voucher Pool Levels and Receive Alerts for Replenishment A voucher pool is a form of digital currency that allows businesses to provide rewards and incentives to their customers for engaging with their products or services. The pool of voucher codes can be redeemed for a variety of items, such as discounts, coupons, or special offers. While setting up a voucher pool, you typically add a certain number of codes to the pool, so it's a good practice to implement a kind of monitoring system that alarms you when codes in the voucher pool are slowly running out. In this use case, you will learn how to build a monitoring system for all voucher pools you have in your workspace. The system will alert you when the number of codes in a voucher pool drops below a predetermined threshold (500 codes in a pool). This alert serves as a reminder for the business to replenish the pool with more codes, as well as an alert to customer service teams to communicate with customers to ensure they are aware of the updated balance. There are even more benefits: - the monitoring system helps businesses avoid running out of vouchers, which can lead to customer dissatisfaction and loss of revenue. - it helps businesses ensure they have enough vouchers available to meet customer needs and maximize sales. - it allows businesses to plan ahead and easily adjust their voucher pool when needed. - this system allows businesses to quickly and efficiently track their voucher pools, making it easier to identify any discrepancies or irregularities. In this use case, we present a method in which we create a profile in **Behavioral Data Hub > Profiles** for each voucher pool we want to monitor (1 voucher pool = 1 profile). This will enable us to set up a workflow which will monitor the number of active vouchers and send an alert when the number of codes in a pool drops below 500. ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code). - Configure an [email account](/docs/campaign/e-mail/configuring-email-account). - Depending on your needs, you can send to a customer a general code with promotion, eg. SHOPPING20%, or coupon code individually for each customer. If you decide on this second option, you will have to import coupons to Synerise prepared in your ecommerce platform which will apply the appropriate discount in the shopping cart. In [this](/docs/assets/code-pools) article, you will find the rules and procedures needed to create and use voucher pool in Synerise. - You must have an API key of the **Workspace** type and in the permission matrix: `VOUCHERS_ITEM_LIST_BY_POOL_READ` permission must be checked, otherwise the webhook response will return the 403 error code. ## Process --- In this use case, you will go through the following steps: 1. [Add voucher pools to Profiles](/use-cases/voucherpools#add-voucher-pools-to-profiles). 2. [Prepare an email template](/use-cases/voucherpools#prepare-an-email-template). 3. [Create a workflow](/use-cases/voucherpools#create-a-workflow) which sends the email alert if the number of unassigned codes in a pool will be lower than 500. ## Add voucher pools to Profiles --- In this part of the process, you will create Synerise profiles for each voucher pool you want to monitor, where 1 voucher pool = 1 profile in **Behavioral Data Hub > Profiles**. You can add them manually or using API. In this case, we present how to add them manually, API method is described below in the advanced section. 1. Go to **Behavioral Data Hub > Profiles** 2. Click **Add new > Profile**. 3. In the `firstname` box, add `Voucher Pool 1`. 4. In the `email` box, add any fake email, for example `fakevoucher1@pool.com`. 5. In the properties section, select the `voucherpool_id` attribute, and as the value, add the ID of the voucher pool which you can find in the URL of a specific pool.
If your workspace lacks the `voucherpool_id` attribute, you can add it in **Data Modeling Hub > Profile attributes**.
6. Click **Create**. **Result**: The separated profile for the voucher pool will be generated in the **Behavioral Data Hub > Profiles** in Synerise.
Advanced version of adding pools using API

Below you will find cURL with a ready request, which you can use in the Postman tool, where:

  • `token` - authorization token
  • `firstName` - voucher pool name
  • `voucherpool_id` - voucher pool ID for a specific pool (in Data Modeling Hub > Voucher Pools, enter the details of the voucher to retrieve its ID from the URL)
  • `customId` - voucher pool ID for a specific voucher (in Data Modeling Hub > Voucher Pools, enter the details of the voucher to retrieve its ID from the URL)
  • optionally, `tag` in this case is `voucher_campaign`
curl --location --request POST 'https://api.synerise.com/v4/clients/batch' \ --header 'Accept: application/json' \ --header 'Api-Version: 4.4' \ --header 'Authorization: Bearer xxx' \ --header 'content-type: application/json' \ --data-raw '[ { "customId": "Insert a voucher pool ID here", "firstName": "Insert a voucher pool name", "agreements": { }, "attributes": { "voucherpool_id": "Insert a voucher pool ID here" }, "tags": [ "voucher_campaign" ] } ]'

In this code we used the specific method from our API. Read also about the authorization process.

Send this request as many times as you need, just changing the `voucherpool_id`, `firstName`, and `customId` parameters. The voucher pools created in Behavioral Data Hub > Profiles will be available on the list of unrecognized profiles.

## Prepare an email template --- In this part of the process, prepare an email alert template that includes the information about the number of unassigned codes remaining in a voucher pool. 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left side of the screen, click **Templates**. 3. Select the wizard. 4. In the content of the message, add this insert:
{%set link = "https://app.synerise.com/assets/vouchers/pools/*/coupons"%}
      <p>{{customer.firstname}},</p>
      <h1> Alert for Voucher pool: {{customer.firstname}} </h1>
      <p> Remaining: {{ event.params['voucherCount'] }} vouchers </p>
      <a href='{{link|replace("*",customer.voucherpool_id)}}'>
      <p> Link to voucher pool {{customer.firstname}} </p></a>
5. Adjust the design of the template according to your needs. 6. Save the template. ## Create a workflow --- In this step create a workflow which sends the email alert if the number of codes in a voucher pool is lower than 500. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Configure the Audience node --- In this part of the process, select the audience for which you will run this campaign - all vouchers added as profiles. In our case, we start the workflow everyday at 7 A.M., for profiles (voucher pools) who has the `voucherpool_id` parameter defined.
In this case, we use the `voucherpool_id` parameter, but you can use any other parameter or tag which is assigned to your profiles (voucher pools). In our case based on the contents of cURL presented in previous steps, it might be for example a tag: `voucher_campaign`.
1. Click **Add trigger**. 2. From the dropdown list, select the **Audience** node. 3. Leave the **Run trigger** option as default (**repeatable**). 4. Define the values for the **Interval** (frequency), **Begin at**, and **Timezone** fields according to your business requirements. In our case, it will be every day at 7 A.M. 4. In the **Define audience** section, click **New audience**. 5. Click **Define conditions**. 6. From the **Choose filter** dropdown list, select the `voucherpool_id`. 5. From the **Choose operator** dropdown list, select **String** and **Is not empty**. 14. Confirm by clicking **Apply**.
Automation Hub Audience node configuration filtering customers with an assigned voucher pool ID
Configuration of the Audience node
### Add the Outgoing Integration node --- This node will be used to send a request to get the number of codes available in the voucher pools. You will use the following method: `https://api.synerise.com/v4/vouchers/item/count/{{client.voucherpool_id}}`. 1. Click **THEN**. 2. From the dropdown list, select **Outgoing Integration**. 1. Select the **Custom webhook** tab, and **API Key** authorization. 3. From the dropdown list, select the Workspace API key that has enabled this permission: `VOUCHERS_ITEM_LIST_BY_POOL_READ`. 2. In the **Action name** field, enter **Check Voucher Pool** (you can use different name, it's just an example). 3. Select the **POST** method. 4. In the **Endpoint** field, enter `https://api.synerise.com/v4/vouchers/item/count/{{client.voucherpool_id}}` where `{{client.voucherpool_id}}` will be dynamically replaced with the ID of the monitored voucher pool. 4. Leave **content-type** at default: `application / json`. 5. Click **Add header**. 6. Add **Api-Version** with the value set to `4.4` 5. Click **Add header**. 7. Add **Accept** with the value set to `application/json`. 5. Leave the request body at default (with `{}`). 11. Confirm the settings by clicking **Apply**.
The configuration of the Outgoing Integration node
The configuration of the Outgoing Integration node
### Configure the Event Filter node --- This node will be used to wait for the webhook response. Set the waiting time to 5 minutes, this period is recommended as it eliminates the possibility of the workflow completion due to lags in response. 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 5 minutes. 3. In the **Define conditions** section, from the **Choose event** dropdown list, choose `webhook.response` event. 4. Confirm by clicking **Apply**. 5. For the **Not matched** path, add the **End** node. 6. For the **Matched** path, add the **Generate Event** node.
The configuration of the Event Filter node
The Event Filter node
### Define the Generate Event node --- At this stage, we are checking the difference between the number of assigned and used codes. It will be responsible for showing the difference between the vouchers. This event will be generated only for those persons/vouchers that are in this group. 1. To the **Matched** path, add **Generate Event**. 2. In the **Event name**, enter the name of the event that will be generated on the customer's profile. In this case, it is `custom.event`. 4. In the **Body** section, use the code below, and click **Apply**. { "voucherCount": "{{event.params['body.data.activeCount'] - event.params['body.data.assignedCount']}}" }
The configuration of the Generate Event node
The Generate Event node
### Configure the Event Filter node This node will check if the amount of codes dropped below a certain level. For us, it is 500. We will check it based on the event generated in the [previous step](/use-cases/voucherpools#define-the-generate-event-node). 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 10 minutes. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `custom.event`. 4. Click **+ where**. 5. As the parameter, choose `voucherCount` 5. Choose **Less than (Number**). 6. Set the value to `500`. 2. Confirm by clicking **Apply**.
The configuration of the Event Filter node
The Event Filter node
### Configure the Email Alert node --- In this step, if the number of vouchers has decreased below 500, an email alert will be sent to email addresses selected in the configuration of the node. After sending the email alert, the workflow ends. 1. Add **Email Alert**. Configure according to your business needs. 2. Define Content: 1. In the **Template for content** field, select an alert email template [prepared earlier](/use-cases/voucherpools#prepare-an-email-template). 2. In the **Subject** field, enter your message subject. 3. In the **Recipient** section, create a list of recipients of the alert email. 4. Confirm by clicking **Apply**. 5. Add the **End** node. 6. Click **Save & Run**.
The configuration of the workflow
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the [workflow configuration](https://app.synerise.com/automations/automation-diagram/60a87da1-183c-4180-83c3-41b01dacdd5a) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~5), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1), `custom.event` (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [API](/developers/api) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Voucher pools](/docs/assets/code-pools) # Personalized SMS with discount coupon SMS campaigns give you the opportunity to reach users quickly and very effectively. Even if the user does not take advantage of the promotion, you can be almost sure that he will open the message. It is a good idea not to abuse this channel but to use it only in certain situations. One of them is an engaging campaign with a promotional code that gives a specific user a specific value – in this case discounted shopping. ## Example of use - Retail Industry **Challenge** We prepared an engaging SMS campaign with discount codes. It was sent to customers who gave us permission to send SMS messages. They got an individual code with a discount which they could use in the online shop. ![Screenshot presenting personalized sms](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/general-sms.png) ## Prerequisites --- - Customer data base with phone numbers and marketing consent for sending SMS campaigns. - Discount coupons list. - Integration of [SMS gateway with Synerise](/docs/settings/configuration/sms-account). ## Process --- In this use case, you will go through the following steps: 1. [Add Voucher Pools](/use-cases/sms-with-discount#add-voucher-pools). 2. [Prepare the SMS content](/use-cases/sms-with-discount#prepare-the-sms-content). ## Add Voucher Pools --- 1. Go to Data Modeling Hub icon **Data Modeling Hub > Voucher Pools > Add pool**. 2. On the pop-up, fill in the following fields: 1. In the **Pool name** field, enter the name of the pool (the name is only visible on the list of the voucher pools). 2. Optionally, from the **Barcode** type dropdown list, select the type of codes which will be imported in the CSV file to Synerise.
The selection in the dropdown has no influence on the further process. It serves only informational purposes for the users.
3. Optionally, in the **Voucher prefix** field, enter a number that will be added to the beginning of each code. 4. In the **Emission start** and **Emmision end** fields, select the dates when the distribution of the codes starts and finishes, respectively. 5. Optionally, to limit the size of the pool, fill in the **Pool limit** field. 6. Optionally, in the **Limit per profile**, define how many times a customer can get this voucher from the pool. 7. Optionally, in the **Description** field, enter the internal description of the pool that is visible only on the list of voucher pools. 3. Confirm by clicking **Apply**. After importing them, you will be able to see the code with every voucher and information about whether it is assigned or unassigned to any customer. You can also see the assignment date and the date of use. ![Screenshot presenting voucher pools](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/voucher.png) ## Prepare the SMS content --- 1. Go to **Experience Hub > SMS > Create new** 2. In the **Audience** section, choose the campaign recipients. The system will automatically show you the customers who have given marketing consent for this type of campaign and have phone numbers on their contact card. You can choose to send the SMS to specific segments, create a new one directly from this place or send the message to everyone. 3. In **Content**, you have to choose the sender name (based on previously completed integration with a sending platform) and then you can create a message template in the text editor. 4. Click **Inserts** and choose pools with coupon codes you have created in previous step. Find it on the inserts list and copy its code to your message. 5. Add additional text to your message. 6. Save your template. 7. In **Schedule** section, choose what time the campaign will be sent 8. The last part is testing. If you want to test your SMS, you have to add your phone number and check how the message is displayed. 9. Save and run your campaign. ![Screenshot presenting sms](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/sms10.png) ## Check the use case set up on the Synerise Demo workspace --- Check the [SMS campaign settings](https://app.synerise.com/campaigns/create/d56922c7-9eb6-4a9c-9f5b-bc128b4ac356) in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`sms.send`](/docs/assets/events/event-reference/sms#smssend) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [Catalogs](/docs/assets/catalogs) - [Creating SMS campaign](/docs/campaign/SMS) - [Voucher Pools](/docs/assets/code-pools) # Campaign optimizer - Advanced configuration Campaign optimization is a very important feature that we develop to let you choose the best time and channel for your customers and send them messages with the highest chances for conversion.
Basic information about our campaign optimizer can be found [HERE](/use-cases/campaign-optimizer)
## Prerequisites --- **General** - Implement [Synerise tracker](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Channel optimization configuration. - [Email account configuration](/docs/campaign/e-mail/configuring-email-account). - [SMS account](/docs/settings/configuration/sms-account) configuration (integration e.g. with SMS API). - [Webpush integration](/docs/campaign/Webpush/configuring-web-push). - [Mobile Push integration](/docs/campaign/Mobile/mobile_campaign). - [Transactional events](/developers/web/transactions-sdk) implemented (optional). **AI time optimizer configuration** - Page visits & other campaign visits. ## Create predefined analytics --- At the very beginning, in order to achieve channel optimization, we have to use predefined analytics. Let’s say we want to use basic, predefined, CTR based channel optimization:
We are using this example to go through the process of configuring an optimized campaign. Please be aware that the base on which you calculate the optimization and metrics are fully customizable.
1. Create the predefined analytics. - First of all **segments** Choose the predefined segment matching the channel in which you want to send a campaign. For example: - (Default) Optimal Channel by CTR - mobile push - (Default) Optimal Channel by CTR - web push - (Default) Optimal Channel by CTR - email - (Default) Optimal Channel by CTR - sms Segment is based on scoring calculated in “optimal.channel” event. In its configuration we used the “Last” aggregate for ”optimal.channel” event with parameter “type:CTR”. - **Expressions** for all channels you want to use (e.g. email, sms, newsletter) - **Metrics** for all channels you want to use (e.g. email, sms, newsletter) 2. Create an example expression for a newsletter ratio CTR In these analytics we have to calculate the ratio between clicked and sent messages, but in order to achieve a proper reference we require that those customers be sent at least 5 campaigns. It should look like below. ![Screenshot presenting campaign optimizer](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/newsletterratio.png) For the calculation of the value of each channel, we can add the expression which meet the conditions described below: - Expressions for optimal individual channels are being compared if they are higher than the global metric​ - If the Expression is less than 5, then its value equals 0​ - If the Expression is lower than the metrics, then is not taken into consideration in comparison ​ - If all expressions are lower than metrics, then we randomly select a channel​ - If all expressions return 0, then we randomly select a channel It can look like this:
<!-- candidates -->
{% set NEWSLETTER = {"name": "NEWSLETTER", "expression":0, "metric":0} %}
{% set MOBILE_PUSH = {"name": "MOBILE_PUSH", "expression":0, "metric":0}%}

{% set CANDIDATES = [NEWSLETTER, MOBILE_PUSH]%}

<!-- value assignment -->
{% expressionvar 37368423-6210-4ee4-bd67-5e2143544576 %}{% do
NEWSLETTER.update({"expression": expression_result})%}{%endexpressionvar%}
{metricsvar metric_id:550060f2-4feb-a6a5-46e8ad01b8ac%}{%do
NEWSLETTER.update({"metric_result})%}{% endmetricsvar %}
{% expressionvar 6e3206d9-708a-4fc5-bfe4-88fea18da90f %}{% do
MOBILE_PUSH.update({"expression_result})%}{% endexpressionvar %}
{% metricsvar metric_id:85651a3a-5163-4b1f-971a-4109e83bf753 %}{% do
MOBILE_PUSH.update ({"metric":metric_result})%}{% endmetricsvar %}

<!-- candidates by expression-->
{set expression_winners = [] %}
{% for candidat in CANDIDATES %}
    {% if candidat["expression"] > candidat ["metric"] %}
        {% do expression_winners.append(candidat)%}
    {% endif %}
{% endfor %}

<!-- print winner-->
{% if expression_winners|count !=0 %}
    {% set winner = expression_winners|sort(true, true, 'expression')|first %}
{% else %}
    {% set winner = CANDIDATES|random %}
{% endif %}

{{winner}}
Everything here is based on jinjava, which produced the event at the very end of this calculation. Based on that we can actually select the segment in which we want to send the message automatically. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates/introduction-to-aggregates) - [Automation Hub](/docs/automation) - [Basic optimizer configuration](/use-cases/campaign-optimizer) - [Build segmentation](/docs/analytics/segmentations/creating-segmentations) - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) # Cloning Complex Analyses and Segmentations Across Workspaces For organizations operating in multiple workspaces, transferring analytics from one workspace to another can be challenging and time-consuming, especially when the analytics involved are complex and interdependent. The Synerise's clone feature is designed to alleviate these difficulties by streamlining the transfer process and ensuring that all dependencies and mapping relationships are maintained. In this use case, we delve into a practical implementation of cloning RFM segmentation analytics that requires the transfer of a complex, nested analysis. Using cloning, we ensure that all necessary dependencies are maintained, and mapping conflicts are resolved in a timely and efficient manner. You will find a detailed guide on how to create a RFM analysis in [this use case](/use-cases/rfm-analysis).
For a detailed guide on how to perform object cloning between workspaces, including all possible scenarios that can occur during the cloning, see [this article](/docs/settings/workspace/cloning-objects/cloning-analyses-to-workspaces).
## Prerequisites --- Follow all the prerequisites described in [this article](/docs/settings/workspace/cloning-objects/cloning-analyses-to-workspaces). ## Clone segmentation --- 1. Go to Decision Hub icon **Decision Hub > Segmentations**. 2. On the list of segmentations, find the segmentation you want to clone. 3. To the right side of the analysis author information, click Three-dot icon. 4. From the context menu, select **Clone to workspace**. **Result**: The **Choose destination** pop-up appears. 5. On the pop-up, select the workspace or workspaces to which you want to clone your analysis.
A pop-up with selection of workspaces
A pop-up with selection of workspaces
6. Confirm your choice by clicking **Next**. **Result**: You are directed to the mapping wizard.
Mapping wizard
Mapping wizard
1. In the **Objects to clone** section, click **Change solutions**. 2. Next to the target workspace name, click the downward arrow icon. **Result**: The list displays the analysis to be cloned.
When you clone an object and an object with the same name exists, you need to resolve the conflict. Refer to [this step](/docs/settings/workspace/cloning-objects/cloning-analyses-to-workspaces#cloning-an-object-that-exists-in-the-target-workspace), which explains how to clone an existing object in the target workspace.
3. Click **Apply**. ### Mapping events --- In our case, not all events and their parameters exist in the target workspace. That is why we need to create the missing event/parameter or select an existing event/parameter in the target workspace under which the values of the event/parameter from the source workspace will be saved in the cloned object. 1. In the **Mapping events** section, click **Solve issues**. 2. Next to the target workspace name, click the downward arrow icon. 3. On the dropdown list, perform one of the following action create the missing parameter in the target workspace by clicking **Create `[$totalAmount]`**.
Mapping event parameters that don't exist in the target workspace
Mapping event parameters that don't exist in the target workspace
4. Confirm the mapping settings by clicking **Apply**. ### Mapping parameters --- In our case, not all attributes exist in the target workspace, which is why we need to create the missing parameter or select an existing parameter in the target workspace under which the values of the parameter from the source workspace will be saved in the cloned object. 1. In the **Mapping parameters** section, click **Solve issues**. 2. Next to the target workspace name, click the downward arrow icon. 3. On the dropdown list, create the missing parameter in the target workspace by clicking **Create `[loyaltyCard]`**.
Mapping parameters that don't exist in the target workspace
Mapping parameters that don't exist in the target workspace
4. Confirm the mapping settings by clicking **Apply**. 5. Optionally, before cloning, you can also check the summary, where you can find detailed information about what analytics the segmentation consists of and what solution was applied to each of them, as well as what events and parameters were created.
Cloning summary
Cloning summary
Cloning summary
5. In the upper right corner, click **Clone**. After successful cloning, you can switch to the target workspace and work with the cloned segmentation and all nested analytics. ## What's next --- The cloning option can also be very useful in cases where you already have the same analytics created in different workspaces and want to make changes to them. In that case, all you need to do is make changes to the analytics from one workspace and then clone it to other workspaces where you want to implement that modification. When cloning, you will only need to update the cloned object in the target workspaces. This convenient solution streamlines the process and ensures that all nested objects and dependencies are taken into account. With just a few clicks, you can effortlessly update analytics across all workspaces.
Updating cloned objects
Updated cloned objects
Updated cloned objects
## Generated events This use case does not generate any events. ## Read more --- - [Cloning objects between workspaces](/docs/settings/workspace/cloning-objects/cloning-analyses-to-workspaces) - [RFM analysis](/use-cases/rfm-analysis) # Cleaning and Transforming Data for Optimal Business Performance The better quality data you have at your disposal, the better the actions and analyses you perform on that data. However, the data you have is not always in a state ready for analysis. The files may contain redundant or incorrect data. There may also be duplicate or missing values. To make sure that the data you want to use in your activities and analyses is properly prepared, it is a good idea to clean data before using it. Automation Hub comes to your aid. It gives you the ability to perform a large number of operations on any data you need to modify. This use case describes the process of transformation of a CSV file with electronic card transactions. The data transformations performed in this use case consist of: - removing columns with missing data - adding missing data - removing structural errors by adding suffixes - filtering rows After transformation, the file will be transferred to an SFTP server. ## Prerequisites --- - Save the file which you want to transform to your computer. - You must have a target resource with which you transfer the data (in this use case, an SFTP server is used). - Make a copy of the data file and remove rows from the copy until 10 are left. This copy will be used only as a sample for configuring the Data Transformation rules. ## Process --- 1. [Prepare transformation](/use-cases/data-cleaning#create-transformation) to modify the data to meet the requirements of the external resource data structure. 2. [Prepare a workflow](/use-cases/data-cleaning#prepare-a-workflow) that sends the data of customers from Synerise to the external resource. ## Create transformation --- In this part of the process, you define the rules of modifying data before sending it to the SFTP server, so the data is consistent. Each of the following sub-steps describes the individual changes performed on the file. The data transformation diagram which is the output of this part of the process is used later to [automate sending the data](/use-cases/data-cleaning#prepare-a-workflow). 1. Go to Automation Hub icon **Automation Hub > Transformations > New transformation**. 2. Enter the name of the transformation. 3. Click **Upload a new file or drag one here**. ### Add file with sample data This step allows you to add a data sample. In further steps, you define how the data must be modified. Later, when this transformation is used in the workflow, the system uses the rules created with the sample data as a pattern for modifying actual data. 1. Upload the file with the sample data. 2. Provide **Delimiter**, **Quotation mark** and **Escape character**. 3. Click **Apply**.
Transformations Uploading sample data for data cleaning
The configuration of the file upload
### Remove irrelevant data In this part, use the **Remove Columns** step, to remove the columns that do not contain data, these are the columns named: **Series_title_3** and **Series_title_4**. 1. On the right panel, click **App step**. 2. From the dropdown list, select **Remove Columns**. 3. In the configuration of the step: 1. Leave the **Remove** option selected in the dropdown menu. 2. Leave the default value in the dropdown as **Equal**. 3. In the text field, enter the name of the empty column you want to remove - `Series_title_3`. 4. Click **Add condition**. 5. Repeat steps **3.b-d** to define all the columns you want to delete.
The configuration of the Remove Columns step
The configuration of the Remove Columns step
This resulted in the removal of columns **Series_title_3** and **Series_title_4**:
Output data after applying Remove Columns step
Output data after applying Remove Columns step
6. Confirm by clicking **Apply**. ### Handle missing data Use the **Edit Values** step that allows you to perform basic actions on the dataset. In this example, handle missing data in the **Suppressed** column by replacing its contents (in this example, the column is empty) with the value `false`. 1. On the right panel, click the **Add step**. 2. From the dropdown list, select **Edit Values**. 3. Click the **Edit Values** step. 4. In the configuration of the step: 1. Select the **Suppressed** column. 2. Under **Edit values by**, from the dropdown list, select **Replacing**. 3. In the dropdown below, leave the **Static value** option at default. 4. In the text field, enter `false`.
The configuration of the Edit Values step
The configuration of the Edit Values step
As a result, you will get an updated file:
Output data after applying Edit Values step
The configuration of the Edit Values step
5. Confirm by clicking **Apply**. ### Fix structural errors Structural errors are when you notice strange naming conventions, typos, or incorrect capitalization when measuring or transmitting data. Use **Edit Values** step to make the format of the data in the column **Data_value** consistent. Currently, in the **Data_value** column, the data appears both as number `36422` and float `33317.4`. To make the data consistent, unify the data to float. 1. On the right panel, click the **Add step**. 2. From the dropdown list, select **Edit Values**. 3. Click the **Edit Values** step. 4. In the configuration of the step: 1. Select the **Data_value** column. 2. Under **Edit values by**, from the dropdown list, select **Adding suffix**. 3. In the text field, enter `.0`. 4. Click **If current value**. 5. From the dropdown list select **Not contain**. 6. In the text field provide `.`.
The configuration of the Edit Values step
The configuration of the Edit Values step
As a result, you will get an updated file:
Output data after applying Edit Values step
The configuration of the Edit Values step
7. Confirm by clicking **Apply**. ### Filter records To filter records from the data, use the **Filter Rows** step. In this case, keep only records where the value of the **UNIT** column is equal to `Dollars`. 1. On the right panel, click **Add step**. 2. From the dropdown list, select **Filter Rows**. 3. Click the **Filter Rows** step. 4. In the configuration of the step: 1. Select the **UNITS** column. 2. Under **Where value**, from the dropdown list, select **Contain**. 3. In the text field, enter `Dollars`.
The configuration of the Filter Rows step
The configuration of the Filter Rows step
As a result, you will get an updated file:
Output data after applying Filter Rows step
The configuration of the Filter Rows step
4. Confirm by clicking **Apply**. ### Add the finishing step This step lets you preview the output of the modifications to the sample data. 1. Preview the results in the **Output** tab.
The preview of modifications to the file
The preview of modifications to the file
2. In the upper right corner, click **Save**. **Result**:
Data Transformation configuration for cleaning customer data
The configuration of data transformation
## Prepare a workflow --- The scenario for this use case involves a one-time transformation of a file uploaded from the user's local storage. The transformed data will be exported to the external source using the SFTP protocol. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 1. As the trigger node, add **Scheduled Run**. 2. In the configuration of the node: 1. Select the **Run once** option. 2. Select **Immediately**.
Automation Hub Scheduled Run node configuration for triggering data cleaning operations
The configuration of the Scheduled Run node
3. Confirm by clicking **Apply**. ### Select file to export 1. Add a **Local File** node. 2. In the configuration of the node: 1. Upload the file in which you want to perform the transformation.
Local File transfer
Local File transfer
2. Confirm by clicking **Apply**. ### Select the transformation 1. Add a **Data Transformation Studio** node. 2. In the configuration of the node, keep the default **From workflow context** option. 3. Click **Templates library**: 1. Select the [transformation you have created before](/use-cases/data-cleaning#create-transformation).
The configuration of the transformation template
The configuration of the transformation template
2. Click the **Use template** button.
The configuration of the Data Transformation Studio node
The configuration of the Data Transformation Studio node
4. Confirm by clicking **Apply**. ### Configure settings for SFTP protocol 1. Add the **Send File** node by clicking **THEN > SFTP**. 2. In the configuration of the node: 1. Choose SFTP connection type: 1. Select **Public-key**. 2. Below, choose desired item in the **select connection** field.
The configuration of the SFTP connection type
The configuration of the SFTP connection type
3. Click **Next**. 2. Enter the path to your server. 3. Select the port. 4. Enter the path to the directory. 5. Enter the name of the file that will be created. 6. If needed, in the **File name suffix**, select the suffix of the file name. 7. From the **File format** dropdown list, select the **CSV** format. 8. Verify and modify the delimiters if needed.
The configuration of the SFTP node
The configuration of the SFTP node
9. Confirm by clicking **Apply**. ### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for data cleaning operations
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the [transformation](https://app.synerise.com/automations/data-transformation/bdf77aad-e443-4630-931d-af944f814db3) and [workflow](https://app.synerise.com/automations/automation-diagram/811d3a5b-64c4-4cba-9d93-64add71a7f23) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1). ## Read more --- - [Data Transformation](/docs/automation/data-transformation-and-imports/introduction) - [Workflow](/docs/automation) # Personalized SMS with last visited most expensive product --- Dynamic SMS’s are a type of text message that are sent to user mobile devices. They are an effective way of communicating with your customers and can be used in many ways. Dynamic SMS’s can be a very innovative way to make your communication not only more effective but also more attractive for your customers. You can add to your message interactive content like e.g. specific product or the discount to encourage your customer to finish a purchase. ## Example of use – Retail/Fashion Industry --- A customer from the fashion industry prepared an email campaign with 20% discount for a second item and 40% for the third item on their website. They wanted to engage selected customers who opened the email on their phones and did not add anything to their basket until returning to the site. As a medium, they used general SMS’s and dynamic SMS’s, depending on whether the user visited the product page from the moment the email was opened or not. Users who visited the product card received **a dynamic SMS** containing the most expensive product among those viewed. ![Screenshot presenting recommendations with opinions](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/dynamic-sms.png) Users who did not visit the product card received **a general SMS.** ![Screenshot presenting general sms](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/general-sms.png) Both messages were sent from Automation Hub. ## Requirements --- - Synerise Tracker - Email account configuration - SMS account configuration (integration e.g. with SMS API) ## How to do it --- 1. Prepare **an aggregate** in which you collect information about recent unique visits (e.g. last 10 visits as in the example below) and check products based on their SKU. To do this enter the name of the attribute. We use a regular expression to be able to create code in jinjava that will show us the most expensive product among the last 10 viewed in a specific time range. ![Screenshot presenting general sms](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/aggregate1a.png) 2. Prepare **general sms.** 3. Prepare **the dynamic sms**. Dynamic SMS’s use jinjava, which checks if the user has viewed 1 product or more. If he saw 1 product, it returns information about this specific product. If a user saw more than 1, the mechanism checks which product was more expensive and this product will be sent to him in the SMS message. 4. Prepare a **segment** of people to whom you want to address the campaign. 5. Prepare an **automation**, which includes the user's event page.visit in a given period of time. In our case, the page.visit event contains the OG:type parameter, which takes the value 'product' if the user viewed the product. ![Screenshot presenting general sms](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/automation1a.png) Automation Hub starts with assigning an attribute that has been manually added to users in the created segment. Then we check whether the user has the appropriate value of the assigned attribute. If it meets this condition, we verify its page.visit: - If it has page.visit with the attribute OG:type equal to product, we send him a dynamic SMS - If it has page.visit with the OG:type attribute different from the product, we send him a general SMS
Automations can start from the newsletter.open event and then you can set a delay, after which we check the further conditions of the campaign to avoid manual interference in starting the automation.
## Generated events This use case generates approximately 11 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~4), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1), [`sms.send`](/docs/assets/events/event-reference/sms#smssend) (~1), [`sms.click`](/docs/assets/events/event-reference/sms#smsclick) (~1). ## Read more --- - Read more about [Automation Hub](/docs/automation) - Read more about [SMS campaigns](/docs/campaign/SMS) - Read more about [Segmentation](/docs/analytics/segmentations/creating-segmentations) # Send Bestselling Products to Customers via Email Sometimes your customers are not sure what they are looking for. Help them to decide by sending the best-selling items - promote them further in your communication. When people see the bestseller label on your product, they’ll feel more inclined to buy it over another items offering in the same category. It is called “purchase pressure.” Some buyers go straight to the bestseller list to see what is popular now. You can promote your bestsellers among your customers. You can dynamically add to this email all bestsellers from all categories or just from specific category, often visited by customers. ## Examples of use - Retail industry **Challenge** A client from the retail industry prepared a -20% summer sale for the entire collection. This client have sent an email with information about the discount to half of the customers. The second half received an email with a discount and several best-selling items. The email with bestsellers had better results.
Example email with best-selling items
Example email with best-selling items
**Results** - 2,3% CTR for email with bestsellers - 1,8% CTR for email only with discount ## Prerequisites --- To be able to implement this use case, you must: - [Implement a tracking code](/docs/settings/tool/tracking_codes). - [Upload a product feed](/first-steps/integration/product). - [Configure AI recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - [Create transaction events](/developers/web/transactions-sdk). - [Configure email account](/docs/campaign/e-mail/configuring-email-account). - [Upload subscriber’s database](/docs/automation/actions/synerise-integrations/import-customers). ## Process --- To create an email with top products, perform the steps in the following order: 1. [Configure AI recommendations](/use-cases/email-with-top-products#create-ai-recommendations-with-top-products) with top products. 2. [Create email template](/use-cases/email-with-top-products#create-email-template) with previously created recommendations. 3. [Create an email campaign](#create-an-email-campaign). ## Create AI recommendations with top products ---
If you do not have AI models trained yet, follow this [instruction](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) to import product feed to Synerise.
To be able to recommend items from the top category in various communication types, first you need to initiate the model training for the item feed from which you want to recommend your items. 1. Go to **Settings > AI Engine Configuration > Add feed**. 2. Select the type of the feed.
We recommend using Google Merchant feed due to the size limits for XML files imported to catalogs.
3. After you add the feed, it's added to the list. 4. Double-click the feed on the list of feeds. 5. In the **Recommendation models** section, select **top products**.
Screenshot presenting model of recommendation
Top products recommendations
4. In the **Items** section, define the type of items to be included in the recommendation by using filters.
You can check the [instruction](/docs/ai-hub/recommendations-v2/recommendation-filters) for the recommendation filters and explore [examples of use](/docs/ai-hub/recommendations-v2/recommendation-filters-examples).
1. You must choose **Minimum** and **Maximum** number of items which the recommendation frame includes.` 2. Use elastic and static filters to select items to your recommendation frame. 3. In the **Additional settings** section, you have to influence the arrangement of items in the recommendation. More information is available [here](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors). {{< important >}} Items section requires you to define more details about your recommendation. Obligatory choose **Min.** and **Max.** number of products which user has to get, and in **Sorting** define metric which has to be used to find products to the message. {{< /important >}} 5. After saving the recommendation, get the ID of the message.
Screenshot presenting site with list of campaign
List of email recommendation
6. **Save** your recommendations. ## Create email template --- 1. Go to **Experience Hub > Email > Templates** and add new template. 2. Prepare your email message, according to your business needs. 3. Using **Inserts** choose previously created recommendations from the list and add them to your template as special code with ID of your recommendations. 4. Save your template. ## Create an email campaign --- In this use case, configure an email communication that will reuse the content of the recommendation you created in the previous step. While configuring the email, you must select a group of customers, create the content of the email and set up the final setting. ### Select the audience of the email message Select the customers who will get the email with the top selling items. 1. Choose the customers in [segmentation](https://app.synerise.com/spa/modules/analytics/segmentations/new) or create a new segment directly in the **email message**. 2. Choose users who will get email.
Screenshot with define audience mode
Define the audience
### Create content After selecting the email recipients, create content. 1. Select the **email account** from which the email will be sent. 2. Prepare the subject of the email. 3. Click **Create message** and built the template of your email. To include the top item recommendations, use the following Jinjava code and your own CSS. Let’s look at how to prepare the appropriate jijnava code. {{< accordion "Check the Jinjava code" >}} {{< highlight "jinja" >}} {% recommendations3 campaignId=xxx %} for loop below: {% for r in recommended_products3 %} {{r.itemId}} {{r.title}} {{r.imageLink}} {{r.price.value}} {{r.salePrice.value}} {% endfor %} {% endrecommendations3 %} {{< /highlight >}} {{< /accordion >}} 4. Optionally, add the B variant of the template which will not contain the top product. ### Prepare the final settings 1. Add the title of the email. 2. In the **Schedule tab**, decide when your email is sent. 3. In the **UTM & URL** parameters section, add the parameters to track the email performance. 4. Send **tests** of your message to verify if the content of the email is displayed correctly.
Screenshot with final setings
Set up settings page
{{< important >}} Test message can only be sent when it has a title. {{< /important >}} ## Check the use case set up on the Synerise Demo workspace --- Check the [AI recommendations settings](https://app.synerise.com/ai-v2/recommendations/VrEXZm00A7CK) and [email campaign](https://app.synerise.com/campaigns/create/49d6e315-06ab-4a35-bb45-deb5f5264cec) directly in Synerise Demo workspace. {{% include "/reuse/use-cases/synerise-demo-workspace.md" %}} ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [AI recommendation](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Emails](/docs/campaign/e-mail/creating-email-campaigns) - [Email communication](/docs/campaign/e-mail) # Create Search Rules to Filter Products Based on Price Keywords “Cheap” presumably isn’t a value of any attribute of the indexed products. You can set a rule to properly handle a query phrase entered by the customer. Filtering will be used to ensure that only products that meet the “cheap” requirement are returned. The range considered cheap depends on your business, but for the purpose of this example let’s consider any price below $50 cheap. We will set a rule, where if the word “cheap” appears in the query the returned products will be filtered to the ones that have prices of $50 or less.
The query rule view before changing its default settings
The query rule view before changing its default settings
## Requirements --- - The Search Engine must be enabled for your workspace. - The "price" attribute must be added to filterable attributes. ## How to do it --- 1. Go to **AI Hub > Indexes**. 2. Choose the **Index** for which you want to apply the rule. 3. Go to the **Rules** tab. 4. Click **Add rule**. 5. In the **Conditions** section click the **Define** button. 6. The **Query** option is selected by default. From the **If query** dropdown menu, select **contains**. 7. In the **Phrase** input, type `cheap`. 8. Click **Apply**. 9. In the **Consequences** section, click the **Define** button. 10. Click **Add consequence** and from the dropdown menu choose **Filter query results**. 11. Click **Add filter** and from the dropdown menu choose the attribute that contains the price of your products. 12. From the dropdown menu to the right of the attribute, choose **Less than or equals**. 13. In the next input, specify the maximum price of items displayed in the search results. In our example, it is 50. 14. Click **Apply**. 15. Optionally, you can schedule your rule to be active from a start date to an end date. To do so, click **Define** in the **Schedule** section. Otherwise, your rule will be active immediately, with no end date. 16. In the top left corner of the screen, name your rule. 17. In the top right corner of the screen, click **Save & Publish** button. ## Check the use case set up on the Synerise Demo workspace --- You can check the [query rules settings](https://app.synerise.com/ai-v2/search/indices/98167fa2726dc2460deb41870c0e6d1c1729168383/query-rules/35414) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- Read more about [rules](/docs/ai-hub/ai-search/query-rules). # Offer Installment Payments with Dynamic Price Calculation Many e-commerce stores offer their customers installment purchases. This is especially helpful in case of expensive products. It is very important to have this mechanism under control and be able to manage it effectively and dynamically calculate the installments and prices displayed on the site. We created a dedicated mechanism for one of our clients which helps to do it effectively and be sure that errors are replaced with the proper element of dynamic content. This case shows our flexibility and approach to managing many different problems that occur on the website. ## Example of use - Retail Industry **Challenge** It all started when a customer came to us with a pricing problem. They had displayed the offer in the wrong way in the product pages with 0% installments. **Solution** We helped with this problem by covering the prices with our dynamic content. Knowing the actual price of the products from their product feed, we used jinjava to automatically calculate the amount of the installment that should be displayed on product pages. All we needed to know was the amount of installments per a certain product. Then we prepared a separate catalog in which we put the information about how many installments a certain product had. ![Screenshot presenting installments](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/installments.png) ## Prerequisites --- **General** - [OG:tags](/developers/web/og-tags) implemented (especially retailer part number). - [Product feed](/use-cases/import-product-feed-to-catalog) with actual product prices. - Data about the number of installments we can implement to the catalog. ## How to do it --- ### Create catalogs --- 1. This mechanism is based on our catalogs so we have to create two of them. First of all, we need to know the actual prices of products and place it in the product feed. We need to import those prices to the product catalog. You can do it using a shovel and proper mapping. It’s best if you create a dynamic import that works once an hour (e.g.), because prices change constantly. ![Screenshot presenting installments](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/catalogs.png) 2. We need to have information about how many installments are for a certain product. You should create the catalogue and add the ID of the product in the first column and the number of installments in the second. ### Create a dynamic content --- Create dynamic content based on those two catalogues which counts the values of both of them and the actual number of installments. Remember to have OG:TAG product retailer part number implemented on the website. Thanks to this we can recognize which product the user is viewing at the moment. So the mechanism takes this retailer part number and we then search for it in both catalogs and then we can see that, for example, this product has 6 installments, we take the price of this product from the catalog and we are divide it by the amount of installments and present the results on the product page.
Our dynamic content campaign can not only add something but also alter some content on the website. So, with the proper selector and inner position (in the Content TAB in campaign creator) we can receive this effect. This is especially useful in cases when prices on our customers’ websites were incorrect.
Such cases can show our flexibility and ability to manage the problems of our clients with simple solutions. ## Generated events This use case generates 1 event per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1). ## Read more --- - [Adding Product feed](/developers/product-feed) - [Catalogs](/docs/assets/catalogs) - [Dynamic content campaigns](/docs/campaign/dynamiccontent) # RFM analysis RFM segmentation is a method used to identify clusters of customers for special treatment. It is commonly used in database marketing and direct marketing, and has received particular attention in many different industries. In order to differentiate customers from data sets, the RFM method uses three different attributes: - **Recency of the last purchase (R)** - refers to the interval between the time of the latest customer purchase and the current date. The shorter the interval between current date and last purchase, the higher R score is. - **Frequency of the purchases (F)** - refers to the number of transactions in a particular period. The higher number of transactions, the higher the F score is. - **Monetary value of the purchases (M)** - refers to monetary value of products purchased by the customer. The more the customer spends, the higher the M score is. This lets you isolate groups, identify new or most active customers, and target personalized messages based on transaction data.
RFM analysis
## Prerequisites --- - Come up with the categories you want to organize your customers, for example: Top customers, Recent customers, Churn risk, Heavy buyers, Lost heavy buyers, Lost customers. ## Process --- 1. Create some [basic analyses](/use-cases/rfm-analysis#create-a-set-of-basic-analyses) for later use in more complex calculations. 2. Create a [set of metrics](/use-cases/rfm-analysis#create-metrics) for Recency, Frequency, and Monetary scores to return the value of 0.20, 0.40, 0.60, 0.80 quantiles. This way you receive four thresholds for all scores. 4. Prepare [segmentations](/use-cases/rfm-analysis#create-segmentations) for Recency, Frequency, and Monetary scores based on the values returned by the metrics you created before. The segments in these segmentations are named in the following way: - For Recency score: 500, 400, 300, 200, 100 - For Frequency score: 50, 40, 30, 20, 10 - For Monetary score: 5, 4, 3, 2, 1 5. Create an [expression](/use-cases/rfm-analysis#create-an-expression) that adds all three segmentations, the example result is 555, which is the highest score a customer can get. 6. Create a [RFM segmentation](/use-cases/rfm-analysis#create-a-rfm-segmentation) that contains the segments which correspond to the customer categories (for example, Top customers, Heavy buyers, Lost customers, and so on). Define the range of scores for each category. 7. Create a workflow which automates the process of updating the values of the quantile calculation metrics used in the [Recency](/use-cases/rfm-analysis#recency), [Frequency](/use-cases/rfm-analysis#frequency), and [Monetary](/use-cases/rfm-analysis#monetary) segments. Such automation will ensure that you are always operating with the most up-to-date metrics, maintaining an appropriate range between all segments. 8. Create a [dashboard](/use-cases/rfm-analysis#create-a-dashboard) to conveniently display the results of the metrics.
You can find furhter explanation in the corresponding sections in the article.
## Create a set of basic analyses ---- In this part of the process, you must create a number of analyses which will be reused later in the process. ### Number of transactions Create the aggregate that calculates the number of transactions for a single customer. It will be reused in the further analyses.
The time ranges used in this use case are just an example. Apply such time ranges that suit your business needs.
You can read more about aggregates [here](/docs/crm/aggregates).
1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Set the **Analyze profiles by** option to **Count**. 4. Click the **Choose event** dropdown list. 5. From the dropdown list, select the event that signifies a purchase.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it’s transaction.charge).
9. Using the date picker in the lower-right corner, set the time range to **Lifetime**. 10. Save the aggregate.
The aggregate that returns the number of transactions for a customer
The aggregate that returns the number of transactions for a customer
### Time of the first purchase Create the aggregate which returns the time when a customer made the first purchase. It will be reused in the further analyses. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Set the **Analyze profiles by** option to **First**. 4. Click the **Choose event** dropdown list. 5. From the dropdown list, select the event that signifies a purchase.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it’s transaction.charge).
6. Click **+ where** button. 7. On the dropdown list, click Three dot icon > **Specials**. 8. Choose **TIMESTAMP**. 9. Using the date picker in the lower-right corner, set the time range to **Lifetime**. 10. Save the aggregate.
The aggregate that returns the time of first transaction of a customer
The aggregate that returns the time of first transaction of a customer
### Time of the last purchase Create the aggregate which returns the time when a customer made the latest purchase. It will be reused in the further analyses. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Set the **Analyze profiles by** option to **Last**. 4. Click the **Choose event** dropdown list. 5. From the dropdown list, select the event that signifies a purchase.
Events may have different labels between workspaces , but you can always find them by their action name (in this step, it’s transaction.charge).
6. Click **+ where** button. 7. On the dropdown list, click Three dot icon > **Specials**. 8. Choose **TIMESTAMP**. 9. Using the date picker in the lower-right corner, set the time range to **Lifetime**. 10. Save the aggregate.
The aggregate that returns the time of last transaction for a customer
The aggregate that returns the time of last transaction for a customer
### Value of purchase Create the aggregate that returns the total amount of money a single customer spent. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Set the **Analyze profiles by** option to **Sum**. 4. Click the **Choose event** dropdown list. 5. From the dropdown list, select the event that signifies a purchase.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it’s transaction.charge).
6. Click **+ where** button. 7. On the dropdown list, select the parameter that signifies the total amount of a transaction, for example, `$totalAmount` 9. Using the date picker in the lower-right corner, set the time range to **Lifetime**. 10. Save the aggregate.
The aggregate that returns the total amount of money a customer spent
The aggregate that returns the total amount of money a customer spent
### Number of days since last transaction Create an attribute expression that calculates how many days passed since the last transaction. This expression reuses the [aggregate that returns the timestamp of the last transaction](/use-cases/rfm-analysis#time-of-the-last-purchase) in the last 90 days. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the expression type at default (**Attribute**). 4. Build the following expression formula:
The expression formula that returns the number of days that passed since the last transaction
The expression formula that returns the number of days that passed since the last transaction
Click here to watch the video tutorial
Calculate the number of days from the last transaction.mov
In the formula of the expression, you must deduct the [date of the last transaction](/use-cases/rfm-analysis#time-of-the-last-purchase) from the current date and divide the result by 86400000 to receive the number of days which passed since the last purchase. 5. Save the expression. ### Number of days since the first transaction Create an attribute expression that calculates how much time passed since the first transaction. This expression reuses the [aggregate that returns the timestamp of the first transaction](/use-cases/rfm-analysis#time-of-the-first-purchase) in the last 90 days and it will be reused in the [expression that returns the number of weeks](/use-cases/rfm-analysis#weeks-from-the-first-transaction) that passed from the first transaction. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the expression type at default (**Attribute**). 4. Build the following expression formula:
The expression formula that returns the time that passed since the first transaction
The expression formula that returns the time that passed since the first transaction
Click here to watch the video tutorial
Calculate time from the first transaction.mov
In the formula of the expression, you must deduct the [date of the first transaction](/use-cases/rfm-analysis#time-of-the-first-purchase) from the current date. The result of the expression is given in milliseconds. 5. Save the expression. ### Weeks from the first transaction Create an expression that calculates the number of weeks since the first transaction of a customer in the last 90 days. This expression reuses the [expression that calculates the time from the first transaction](/use-cases/rfm-analysis#number-of-days-since-the-first-transaction). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the expression type at default (**Attribute**). 4. Build the following expression formula: 1. Click the **Select** node. 2. From the dropdown list, select **Profile**. 3. Click the **unnamed** node that has been added to the canvas. 4. Scroll down the page and click **Choose attribute**. 5. Search and select [the expression that calculates the time from the first transaction](/use-cases/rfm-analysis#number-of-days-since-the-first-transaction). 6. Next to the expression on the canvas, click the plus button icon. 7. Select **Constant**. 8. Click **0** that has been added to the canvas. 9. Change the number to `604800000`. 10. Click the mathematical operator between the nodes and change it to a division sign. 5. Save the expression.
The expression formula that returns the number of weeks that passed since the first transaction
The expression formula that returns the number of weeks that passed since the first transaction
### Average number of transactions per week Create an expression that calculates the average number of transactions a customer made per week in the last 90 days. This expression reuses the [aggregate that calculates the number of transactions](/use-cases/rfm-analysis#number-of-transactions) in the last 90 days and the [expression that calculates the number of weeks since the first transaction](/use-cases/rfm-analysis#weeks-from-the-first-transaction) in the last 90 days. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the expression type at default (**Attribute**). 4. Build the following expression formula: 1. Click the **Select** node. 2. From the dropdown list, select **Profile**. 3. Click the **unnamed** node that has been added to the canvas. 4. Scroll down the page and click **Choose attribute**. 5. Search and select the [aggregate that calculates the number of transactions](/use-cases/rfm-analysis#number-of-transactions). 6. Next to the expression on the canvas, click the plus button icon. 7. Select **Profile**. 8. Click the **unnamed** node that has been added to the canvas. 9. Scroll down the page and click **Choose attribute**. 10. Search and select the [expression that calculates weeks from first transactions](/use-cases/rfm-analysis#weeks-from-the-first-transaction). 11. Click the mathematical operator between the nodes and change it to a division sign. 5. Save the expression.
The expression formula that returns the average number of transactions per week
The expression formula that returns the average number of transactions per week
## Create metrics --- In this part of the process, prepare metrics which will calculate the following quantiles: `0.80`, `0.60`, `0.40`, `0.20` for the values of the expressions and an aggregate: - [the number of days that passed since last transaction](/use-cases/rfm-analysis#time-of-the-last-purchase) (**Recency**) - [the average number of transactions in a week](/use-cases/rfm-analysis#average-number-of-transactions-per-week) (**Frequency**) - [total value of transactions in last 90 days](/use-cases/rfm-analysis#value-of-purchase) (**Monetary**) Create four metrics for each score (which means that in total you will create 12 metrics). This way, you can distinguish tresholds for Recency, Frequency, and Monetary scores. ### Recency score 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter a meaningful metric name. 3. Leave the metric kind at default (**Simple**). 4. Change the **Metric** type to **Profile**. 5. Change the **Aggregator** option to **Quantile**. 5. Next to the **Quantile** option, in the text field, enter `0.80`. 6. Click **Choose value**. 7. Search and select the [expression that returns the number of days that passed since the last transaction](/use-cases/rfm-analysis#number-of-days-since-last-transaction). 8. Click **Enable filter**. 9. Click **Choose filter**. 10. Search and select the **transaction.charge** event. 11. Set the time range to **Lifetime**. 12. Confirm the filter settings by clicking **Apply**. 13. Save the metric. 14. Create three metrics with the same settings for the following quantile values: `0.60`, `0.40`, and `0.20`.
The metric that calculates 0.80 quantile of the expression
The metric that calculates 0.80 quantile of the expression
### Frequency score 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter a meaningful metric name. 3. Leave the metric kind at default (**Simple**). 4. Change the **Metric** type to **Profile**. 5. Change the **Aggregator** option to **Quantile**. 5. Next to the **Quantile** option, in the text field, enter `0.20`. 6. Click **Choose value**. 7. Search and select the [expression that returns the average number of transactions in a week](/use-cases/rfm-analysis#average-number-of-transactions-per-week). 8. Click **Enable filter**. 9. Click **Choose filter**. 10. Search and select the **transaction.charge** event. 11. Set the time range to **Lifetime**. 12. Confirm the filter settings by clicking **Apply**. 13. Save the metric. 14. Create three metrics with the same settings for the following quantile values: `0.40`, `0.60`, and `0.80`.
The metric that calculates 0.20 quantile of the expression
The metric that calculates 0.20 quantile of the expression
### Monetary score 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter a meaningful metric name. 3. Leave the metric kind at default (**Simple**). 4. Change the **Metric** type to **Profile**. 5. Change the **Aggregator** option to **Quantile**. 5. Next to the **Quantile** option, in the text field, enter `0.20`. 6. Click **Choose value**. 7. Search and select the [aggregate that returns the value of purchases in last 90 days](/use-cases/rfm-analysis#value-of-purchase). 8. Click **Enable filter**. 9. Click **Choose filter**. 10. Search and select the **transaction.charge** event. 11. Set the time range to **Lifetime**. 12. Confirm the filter settings by clicking **Apply**. 13. Save the metric. 14. Create three metrics with the same settings for the following quantile values: `0.40`, `0.60`, and `0.80`.
The metric that calculates 0.20 quantile of the expression
The metric that calculates 0.20 quantile of the aggregate
## Create segmentations --- Based on the values returned by the metrics you created before, create three segmentations for Recency, Frequency and Monetary scores. Each of the segmentation contains 5 segments. Each segment reuses the result of a quantile calculated by the metrics. The segments are named in the following way: - For Recency score: 500, 400, 300, 200, 100 | Segment | 500 | 400 | 300 | 200 | 100 | |---------|-----------------------------------|-----------------------------------|----------------------------------|-----------------------------------|---------------------------------------| | Conditions | The value lower than
the 0.20 quantile | The value lower than
the 0.40 quantile but higher than 0.20 quantile | The value lower than
the 0.60 quantile but higher than 0.40 quantile | The value lower than
the 0.80 quantile but higher than 0.60 quantile | The value higer than 0.80
quantile | - For Frequency score: 50, 40, 30, 20, 10 | Segment | 50 | 40 | 30 | 20 | 10 | |---------|-----------------------------------|-----------------------------------|----------------------------------|-----------------------------------|---------------------------------------| | Conditions | The value higher than
0.80 quantile | The value lower than
0.80 quantile but higher than 0.60 quantile | The value lower than
0.60 quantile but higher than 0.4 quantile | The value lower than
0.40 quantile but higher than 0.20 quantile | The value lower than 0.20
quantile | - For Monetary score: 5, 4, 3, 2, 1 | Segment | 5 | 4 | 3 | 2 | 1 | |---------|-----------------------------------|-----------------------------------|----------------------------------|-----------------------------------|---------------------------------------| | Conditions | The value higher than
0.80 quantile | The value lower than
0.80 quantile but higher than 0.60 quantile | The value lower than
0.60 quantile but higher than 0.4 quantile | The value lower than
0.40 quantile but higher than 0.20 quantile | The value lower than 0.20
quantile | Customers belong to a specific segment under defined circumstances and based on the segment classification the overall score will be created, for example, a customer can belong to the following segments: 500 (R), 20 (F), 3 (M). In the next part of the process, these values will be added in an [expression](/use-cases/rfm-analysis#create-an-expression) to produce the final RFM score, which in this example will be 523. ### Recency 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful name of the segmentation. 3. As the name of the segment, enter `500`. 4. Click **Add condition**. 5. Search and select the [expression that returns the number of days since the last transaction](/use-cases/rfm-analysis#number-of-days-since-last-transaction). 6. As the logical operator select **Less than**. 7. In the text field, next to the logical operator, enter the number returned by the metrics that calculate the `0.20` quantile. In this use case, the quantile result amounts to `43.3`, so the customers who made a transaction less than 43 days after the date of the last transaction, belong to 500. It means that the R score of the customer is 500, which is the highest. 6. Add the rest of segments by clicking the Plus button icon icon. 7. For the following segments, add the conditions listed below: - For the 400 segment: more than the value of the `0.20` quantile **AND** less than `0.40` quantile - For the 300 segment: more than the value of the `0.40` quantile **AND** less than `0.60` quantile - For the 200 segment: more than the value of the `0.60` quantile **AND** less than `0.80` quantile - For the 100 segment: less than the value of the `0.80` quantile **AND** segment of loyal customers **AND** add the **transaction.charge** event with the **Lifetime** time range.
The configuration of the Recency score segmentation
The configuration of the Recency score segmentation
### Frequency 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful name of the segmentation. 3. As the name of the segment, enter `50`. 4. Click **Add condition**. 5. Search and select the [expression that returns the average number of transactions per week](/use-cases/rfm-analysis#average-number-of-transactions-per-week). 6. As the logical operator select **More than or equal**. 7. In the text field, next to the logical operator, enter the number returned by the metrics that calculate the `0.80` quantile. In this use case, the quantile result amounts to `0.4`, so the customers who make more than 0.4 transaction a week, belong to 50. It means that the F score of the customer is 50, which is the highest. 6. Add the rest of segments by clicking the Plus button icon icon. 7. For the following segments, add the conditions listed below: - For the 40 segment: more than the value of the `0.60` quantile **AND** less than `0.80` quantile - For the 30 segment: more than the value of the `0.40` quantile **AND** less than `0.60` quantile - For the 20 segment: more than the value of the `0.20` quantile **AND** less than `0.40` quantile - For the 10 segment: less than the value of the `0.20` quantile **AND** segment of loyal customers **AND** add the **transaction.charge** event with the **Lifetime** time range.
The configuration of the Frequency score segmentation
The configuration of the Frequency segmentation
### Monetary 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful name of the segmentation. 3. As the name of the segment, enter `5`. 4. Click **Add condition**. 5. Search and select the [aggregate that returns the value of transactions](/use-cases/rfm-analysis#value-of-purchase). 6. As the logical operator select **More than or equal**. 7. In the text field, next to the logical operator, enter the number returned by the metrics that calculate the `0.80` quantile. In this use case, the quantile result amounts to `2243 PLN`, so the customers who spent this amount of money or more, belong to 5. It means that the M score of the customer is 5, which is the highest. 6. Add the rest of segments by clicking the Plus button icon icon. 7. For the following segments, add the conditions listed below: - For the 4 segment: more than the value of the `0.60` quantile **AND** less than `0.80` quantile - For the 3 segment: more than the value of the `0.40` quantile **AND** less than `0.60` quantile - For the 2 segment: more than the value of the `0.20` quantile **AND** less than `0.40` quantile - For the 1 segment: less than the value of the `0.20` quantile **AND** add the **transaction.charge** event with the **Lifetime** time range.
The configuration of the Monetary score segmentation
The configuration of the Monetary segmentation
## Create an expression --- In this part of the process, create an expression that adds the segmentations a customer belongs to, in order to produce the final RFM score. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the expression type at default (**Attribute**). 4. Build the formula of the expression that adds the [three segmentations](/use-cases/rfm-analysis#create-segmentations) you created in the previous part of the procedure. 1. Click the **Select** node. 2. From the dropdown list, select **Profile**. 3. Click the **unnamed** node that appeared on the canvas. 4. Scroll down the page and click **Choose attribute**. 5. On the dropdown list select the [Recency](/use-cases/rfm-analysis#recency) segmentation. 6. Next to the segmentation added to the canvas, click the plus button. 6. Repeat steps from 1 to 6 for the [Frequency](/use-cases/rfm-analysis#frequency) and [Monetary](/use-cases/rfm-analysis#monetary) segmentations. 7. Click the mathematical operator between the nodes and change it to a plus sign.
Behavioral Data Hub expression formula calculating RFM score by summing Recency, Frequency, and Monetary segmentation values
The configuration of the expression
5. Save the expression. **Result**: The table below contains all possible results: | Possible results | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 111, 112, 113, 114, 115, 121, 122, 123, 124, 125,131, 132, 133, 134, 135, 141, 142, 143, 144, 145, 151, 152, 153, 154, 155, 211, 212, 213, 214, 215, 221, 222, 223, 224, 225, 231, 232, 233, 234, 235, 241, 242, 243, 244, 245, 251, 252, 253, 254, 255, 311, 312, 313, 314, 315, 321, 322, 323, 324, 325, 331, 332, 333, 334, 335, 341, 342, 343, 344, 345, 351, 352, 353, 354, 355, 411, 412, 413, 414, 415, 421, 422, 423, 424, 425, 431, 432, 433, 434, 435, 441, 442, 443, 444, 445, 451, 452, 453, 454, 455, 511, 512, 513, 514, 515, 521, 522, 523, 524, 525, 531, 532, 533, 534, 535, 541, 542, 543, 544, 545, 551, 552, 553, 554, 555 | You need to come up with categories of the customers and assign the results to the specific category. Example categories can be: Top customers, Recent customers, Churn risk, Heavy buyers, Lost heavy buyers, Lost customers. ## Create a RFM segmentation --- In the final part of the process, create a segmentation that contains segments. Each segment represents a category of customers. As the condition for each segment, use the [expression created in the previous part of the process](/use-cases/rfm-analysis#create-an-expression) and define the scores that fall into a particular category. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful title of the segmentation. 3. Click **Add condition**. 4. On the dropdown list, search and select the [expression created in the previous part of the process](/use-cases/rfm-analysis#create-an-expression). 5. As the logical operator, select **In**. 6. Enter the score that fall into a category. 7. Click the Plus button icon icon. 7. Repeat steps from 3 to 7 for the rest of the categories.
The configuration of the RFM segmentation
The configuration of the RFM segmentation
8. Save the segmentation.
Example preview of the RFM analysis
Example preview of the RFM analysis
## Create a workflow --- Create a workflow which automates the process of updating the values of the quantile calculation metrics used in the [Recency](/use-cases/rfm-analysis#recency), [Frequency](/use-cases/rfm-analysis#frequency), and [Monetary](/use-cases/rfm-analysis#monetary) segmentations. These segmentations will be updated using webhooks, where each webhook is dedicated to updating the value of the metrics in one segmentation. Before you start creating a workflow, create a test user that you will later use in the trigger node. All webhook responses will be sent to this profile, this way you will be able to check if the update was successful. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Audience node --- Choose the **Audience** node as the trigger. In this step, you will select a test user for whom the automation will be run. 1. Start the workflow with the **Audience** node. 2. In the configuration of the node, set the **Run trigger** option to **repeatable**. 3. Set the interval to 1 per day. 4. Choose the day and time when the process starts. 5. Select the time zone. 6. In **Define audience**, choose **New Audience** and click **Define conditions**. 1. As the first condition, from **Choose filter** dropdown menu, choose `Email address` attribute.
You may have a different naming for the attribute responsible for the email address. Choose the attribute you use for this purpose.
2. From the **Choose operator** dropdown list, select **Equal**. 3. In the right field, enter the email address of your test user. 4. Click **Apply**. 7. Add the **Split Path** node. ### Outgoing Integration --- 1. Add the **Outgoing Integration** node, which will update the value of metrics used in the [Recency score](/use-cases/rfm-analysis#recency) segmentation. 4. In the configuration of the node: 1. Change the webhook type to **Custom**. 2. As the connection type, select **API Key**. 3. Click **Select connection** and select a connection. If you want to create a connection, click **Add connection** and [create it](/docs/automation/actions/webhook-node#set-up-a-connection). 1. Enter the title of the **Outgoing Integration** node. 2. In the **Webhook name** field, enter the value of the `name` parameter of the event generated by this node. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `rfm.reportGenerated` 2. As **Display name**, enter `RFM report generated`
In this use case, you will create 3 nodes. If you want to differentiate between the events they generate, you can set different webhook names and/or event names for each of them.
2. Select the **PUT** method. 3. In the URL of the endpoint, enter the endpoint for the segmentation update: `https://api.synerise.com/analytics/analytics/v2/segmentations/f08a0f4d-4209-40cc-bfe9-4734cd9e0db9`. 4. Replace the segmentation ID in this endpoint (`f08a0f4d-4209-40cc-bfe9-4734cd9e0db9`) with the ID of the Recency score segmentation. 5. Enter the body of the request. In the body, you need to add the payload of the segmentation you want to update. To get the payload perform the following steps: 1. Open the respective segmentation. 2. Open console and go to the Network tab. 3. Refresh the page. 4. Search for preview in the Network. 5. Right click and copy the object.
Click here to see the console view
How to copy an object of segmentation
How to copy an object of segmentation
6. In the copied body replace all constant values with the dynamic values of relevant metrics. Example: You have the folowing constant: "constant": `43.3` `43.3` should be replaced in this case with the relevant metric ID. You can additionally round the value of the metric to three decimal places. The final appearance of the substituted constant will look as follows:
"constant":  {% metricsvar  metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %}
Click here to see the example of body request for the Recency segment
{ "analysis": { "title": "[UC] RFM - Recency Score", "description": "", "segments": [ { "title": "500", "description": "", "filter": { "matching": true, "expressions": [ { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "LESS", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } } ], "expression": { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "LESS", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } } }, "profileMetrics": [] }, { "title": "400", "description": "", "filter": { "matching": true, "expressions": [ { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "MORE_OR_EQUAL", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } }, { "type": "OPERATOR", "logic": "AND" }, { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "LESS", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:e571679c-0f04-466f-aa43-ff6d5023bb09%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } } ], "expression": { "type": "FUNCTION", "function": "AND", "arg1": { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "LESS", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:e571679c-0f04-466f-aa43-ff6d5023bb09%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } }, "arg2": { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "MORE_OR_EQUAL", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:97488c6a-746e-42fc-a1ca-b2fb4b8dfa94%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } } } }, "profileMetrics": [] }, { "title": "300", "description": "", "filter": { "matching": true, "expressions": [ { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "MORE_OR_EQUAL", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:e571679c-0f04-466f-aa43-ff6d5023bb09%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } }, { "type": "OPERATOR", "logic": "AND" }, { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "LESS", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:8031ccf4-2444-42bf-8eba-ba61d952d52f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } } ], "expression": { "type": "FUNCTION", "function": "AND", "arg1": { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "LESS", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:8031ccf4-2444-42bf-8eba-ba61d952d52f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } }, "arg2": { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "MORE_OR_EQUAL", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:e571679c-0f04-466f-aa43-ff6d5023bb09%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } } } }, "profileMetrics": [] }, { "title": "200", "description": "", "filter": { "matching": true, "expressions": [ { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "MORE_OR_EQUAL", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:8031ccf4-2444-42bf-8eba-ba61d952d52f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } }, { "type": "OPERATOR", "logic": "AND" }, { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "LESS", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:fb1c9bff-ce29-42c0-93ee-b56f092ae03f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } } ], "expression": { "type": "FUNCTION", "function": "AND", "arg1": { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "LESS", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:fb1c9bff-ce29-42c0-93ee-b56f092ae03f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } }, "arg2": { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "MORE_OR_EQUAL", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:8031ccf4-2444-42bf-8eba-ba61d952d52f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } } } }, "profileMetrics": [] }, { "title": "100", "description": "", "filter": { "matching": true, "expressions": [ { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "MORE_OR_EQUAL", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:fb1c9bff-ce29-42c0-93ee-b56f092ae03f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } }, { "type": "OPERATOR", "logic": "AND" }, { "name": "", "type": "FUNNEL", "matching": true, "funnel": { "title": "unnamed", "completedWithin": {}, "dateFilter": { "type": "ABSOLUTE" }, "steps": [ { "action": { "id": 68600, "name": "transaction.charge" }, "title": "Unnamed Step", "expressions": [], "eventName": "transaction.charge" } ], "exact": false } } ], "expression": { "type": "FUNCTION", "function": "AND", "arg1": { "name": "", "type": "FUNNEL", "matching": true, "funnel": { "title": "unnamed", "completedWithin": null, "dateFilter": { "type": "ABSOLUTE" }, "steps": [ { "action": { "id": 68600, "name": "transaction.charge" }, "title": "Unnamed Step", "expressions": [], "eventName": "transaction.charge" } ], "exact": false } }, "arg2": { "name": "", "type": "ATTRIBUTE", "matching": true, "attribute": { "expressions": [ { "constraint": { "type": "NUMBER_ONE", "logic": "MORE_OR_EQUAL", "value": { "type": "CONSTANT", "constant": {% metricsvar metric_id:fb1c9bff-ce29-42c0-93ee-b56f092ae03f%}{{ metric_result|round(3,'floor') }} {% endmetricsvar %} } }, "attribute": { "type": "EXPRESSION", "id": "73d13360-2074-463c-9978-79861889dff0" } } ] } } } }, "profileMetrics": [] } ], "unique": true }, "allowNull": true }
This is just an example of the body we are using in this use case, and it contains all the metrics IDs that were created in the previous steps. If your analytics settings differ from the configuration shown in this use case, you will have a different body that matches your custom settings.
3. Click **Apply**.
The view of the Outgoing Integration node configuration
Configuration of the Outgoing Integration node
Configure two **Outgoing Integration** nodes for the remaining Frequency and Monetary segments. Follow the steps described for the configuration of the **Outgoing Integration** node for the Recency score segmantation, but make sure to adjust the configuration for each specific segment. Add the **Merge Paths** node and the **End** node. The workflow continuously updates the metrics in the segmentations at a set frequency, ensuring that all segmentations remain up-to-date.
Final workflow setup view
Final workflow setup view
## Create a dashboard --- In this part of the process, to conveniently preview the results of all metrics you created in the previous part of the process, create a dashboard. 1. Go to Decision Hub icon **Decision Hub > Dashboard > New dashboard**. 2. Enter a meaningful name of the dashboard. 3. Add all metrics you created earlier in the process.
You can learn more about creating dashboards [here](/docs/analytics/analytics-dashboard/creating-dashboards).
4. Save the dashboard.
The example dashboard
The example dashboard
## Check the use case set up on the Synerise demo workspace --- Check the analytics from our use case in Synerise demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/603cb871-beb7-3f40-abbd-6cd59c1e7e41) which counts transactions, - [Aggregate](https://app.synerise.com/analytics/aggregates/85043c5b-a23a-39c6-b95b-9a8680eb20cb) counts first transactions, - [Aggregate](https://app.synerise.com/analytics/aggregates/64dd4cc6-f45d-31a0-b789-8c2eeb17a72f) counts last transactions, - [Aggregate](https://app.synerise.com/analytics/aggregates/ca3285c4-23f4-3b30-a849-fe29517e2323) presented monetary value, - [Expression](https://app.synerise.com/analytics/expressions/73d13360-2074-463c-9978-79861889dff0) counts days from last transaction, - [Expression](https://app.synerise.com/analytics/expressions/6fe20450-5bbb-4cb1-9977-8c49f09effc7) that calculates how much time passed since the first transaction, - [Expression](https://app.synerise.com/analytics/expressions/5d9a091c-727a-4efe-b95e-74edae60653c) that calculates the number of weeks since the first transaction of a customer, - [Expression](https://app.synerise.com/analytics/expressions/f9345935-d637-486a-b802-f533148b2312) that calculates the average number of transactions a customer made per week. See the metrics which will calculate the qunatiles for the values of the expressions and an aggregate" - [Metric 1](https://app.synerise.com/analytics/metrics/fb1c9bff-ce29-42c0-93ee-b56f092ae03f),[Metric 2](https://app.synerise.com/analytics/metrics/8031ccf4-2444-42bf-8eba-ba61d952d52f),[Metric 3](https://app.synerise.com/analytics/metrics/e571679c-0f04-466f-aa43-ff6d5023bb09),[Metric 4](https://app.synerise.com/analytics/metrics/97488c6a-746e-42fc-a1ca-b2fb4b8dfa94), counting the number of days that passed since last transaction (Recency), - [Metric 1](https://app.synerise.com/analytics/metrics/7976c8ab-8047-42d1-8eba-8075d1453e94),[Metric 2](https://app.synerise.com/analytics/metrics/31cac7c2-5e56-4937-80fc-5fbc04ef3b14),[Metric 3](https://app.synerise.com/analytics/metrics/68749154-dea2-4947-91a1-8cf01700f84c),[Metric 4](https://app.synerise.com/analytics/metrics/da817b2a-ce02-4e41-a740-a19061c3e17f), counting the average number of transactions in a week (Frequency) - [Metric 1](https://app.synerise.com/analytics/metrics/430d45b3-6bde-474e-9b6a-86c0554e4d50),[Metric 2](https://app.synerise.com/analytics/metrics/028a3c2a-06ef-40c2-a7fb-8b0fe7667db7),[Metric 3](https://app.synerise.com/analytics/metrics/804ce3bc-73ad-415d-9a7e-dcb53b78b068),[Metric 4](https://app.synerise.com/analytics/metrics/9dc245b1-014c-47f4-93e6-afc42e8f9ab6), counting total value of transactions in last 90 days (Monetary). Check the [dashboard](https://app.synerise.com/analytics/dashboards/6e956c95-27fb-418b-92f1-da45a89291d3) presenting RFM summary. Check three segments, created in this case: - Segmentation - [Recency](https://app.synerise.com/analytics-v2/segmentations/f08a0f4d-4209-40cc-bfe9-4734cd9e0db9), - Segmentation - [Frequency](https://app.synerise.com/analytics-v2/segmentations/280bd3dd-2000-4fc0-8c29-89f8403a255b), - Segmentation - [Monetary](https://app.synerise.com/analytics-v2/segmentations/674c7467-d96e-4139-9fa8-eb2506caf212). Check the [RFM general score](https://app.synerise.com/analytics/expressions/70716383-93cf-479c-99f0-15ad4c826472) and [RFM segmentation](https://app.synerise.com/analytics-v2/segmentations/bcb2ceb6-fa7d-40ec-a6d2-e2e5573e3995). Check the [workflow](https://app.synerise.com/automations/automation-diagram/cdcf3c3f-1f28-4fb2-86f0-ed49729ba4a2). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~4), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `rfm.reportGenerated` (~3). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dashboards](/docs/analytics/analytics-dashboard) - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) - [Segmentation](/docs/analytics/segmentations) # Sending reminder about recently visited category at the very best time A properly personalized campaign can encourage the customer to make a purchase - but it is even more effective if it is sent at the very best time. For this purpose, it is worth using the time optimizer, a solution that allows you to send campaigns at the time best suited to the activity of a specific customer. Thanks to this option, you can be sure that the campaign will reach them during the time of their activity and will not go unnoticed. Using time optimizer, you increase the chances that the customer will read the communication, use the discount, and finalize the purchase. In this use case, we will present sending a reminder to a customer with the information about promotion for a specific product category which they visited 7 days before and did not make a purchase. The email will be sent based on the time optimizer to reach each customer at the time when they open emails most often. We consider the time range between 8-22, during the specific day. ## Prerequisites --- - Configure an [email account](/docs/campaign/e-mail/configuring-email-account). - [Enable time optimizer](/docs/settings/configuration/time-optimizer#enabling-time-optimizer) in Synerise settings. - [Create an Email mode](/docs/settings/configuration/time-optimizer#creating-modes) for time optimizer that will analyze the customer’s activity time in the email channel. - Create an [email template](/docs/campaign/e-mail/creating-email-templates) with information about promotions for specific product category.
Optionally you can implement [coupons](/docs/assets/code-pools) which you can import and add to your email template as the [insert](/developers/inserts/insert-usage#code-pools).
- Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). Make sure that you implement `category` parameter in the transaction events. - Implement [Synerise JS SDK](/developers/web/installation-and-configuration) on your website. - Implement [OG tags](/developers/web/og-tags). Thanks to this, the `product:category` parameter will be available in the `page.visit` events. We will later use this parameter to determine which product category the customer visited. ## Create a workflow --- Prepare a workflow that sends an email with the information about discount for the product category, which customer visited 7 days before but have not made the purchase since then. In our case, it will be a promotion for the `decorations` category. The workflow starts every day at 8 A.M. and it is targeted to people who meet the conditions above. Then, the time optimizer chooses the best time to deliver the email for the next 14 hours for every customer and then, the email is send. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Audience node --- Choose the **Audience** node as the trigger. In this step, you will select the group of customers who have visited the `decorations` category exactly 7 days before but did not make a purchase since then. 1. Start the workflow with the **Audience** node. 2. In the configuration of the node, set the **Run trigger** option to **repeatable**. 3. Set the interval to 1 per day. 4. Choose the day and time when the process starts. Choose 8 A.M. to provide plenty of time for the time optimizer to choose the best time for a particular customer. 5. Select the time zone. 6. In **Define audience**, choose **New Audience** and click **Define conditions**. 1. As the first condition, from **Choose filter** dropdown menu, choose `page.visit` event. 2. Click the **+ where** button, choose **product:category**, and then select **Equal**. As the value, enter the name of the category. In our case it is `decorations`. 3. Set the time range to **Last 1 day before 7 days**. 4. As the second condition, from **Choose filter** dropdown menu, choose the `product.buy` event. 5. Click the **+ where** button, choose **category**, and then select **Equal**. As the value, enter the category `decorations`. 6. Set the time range to **Last 8 days** to exclude the customers who have not made a purchase since the last visit in a specific category. 7. Change the **Profiles matching funnel** option to **Profiles not matching funnel** by clicking the **matching** word. 8. Click **Apply**.
Automation Hub Audience node configuration filtering customers with recent category visits and no recent purchases
Configuration of the Audience node
### Define the Optimize Time node --- In this step you will set up the time optimizer, which will select the best time to send email for every customer. 1. Add the **Optimize Time** node. 2. From the **AI optimization mode** dropdown, choose **Mail**. 3. In **Time period to analyze**, choose the best moment to activate the node that follows the Optimize Time node. In our case it will be **Custom time period**. 4. In the **Time period** field, enter `14`, to be sure that the message will be sent between 8 and 22, and the best time for every customer will be narrowed to this period. 5. Click **Apply**.
Configuration of the Optimize Time node
Configuration of the Optimize Time node
You can choose the time period for sending your campaign based on your business needs. You can choose a wider range with the end date, and additional exclusions, for example - for weekends or night hours.
### Define the Send Email node --- In this step, select the email template with information about the promotion for products from the `decorations` category and set up the final sending settings. 1. Add the **Send Email** node. 1. In the **Sender details** section, choose the email account from which the email is sent. 2. In the **Content** section, select the template that you prepared as a part of the prerequisites with information about current promotion for specific product category. Add the subject of the email. 3. In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 4. In the **Additional parameters** section, optionally describe campaigns with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 5. Click **Apply**.
Screenshot selecting the appropriate email account
Send Configuration of the Send Email node
### Prepare the final settings --- 1. Add the **End** node. 2. Optionally, add titles to each node so the workflow will be more understandable to your colleagues. 3. Name the workflow. 4. To save it as a draft, click **Save** it or activate by clicking **Save & Run**.
Automation Hub workflow for optimizing email sending time
Configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the [workflow configuration](https://app.synerise.com/automations/automation-diagram/4b934898-00ef-49fb-927d-6bb3aff7e39a) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`snr.ate.prediction`](/docs/assets/events/event-reference/predictions#snrateprediction) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Coupons](/docs/assets/code-pools) - [Email campaigns](/docs/campaign/e-mail) - [Time optimizer](/docs/settings/configuration/time-optimizer) # Display seasonal promotions in a mobile application Seasonal promotions are a great way to boost sales and engagement for your business during special occasions, such as Christmas. By creating specific promotions and marketing campaigns tailored to these holidays, you can catch the attention of your customers and encourage them to make a purchase. The [Synerise Documents](/docs/assets/documents) feature facilitates distributing seasonal promotions in your mobile application thanks to the ability of grouping them into specific categories. For example, you can create multiple documents that contain Christmas promotions and assign them to a single `Seasonal` group, then create a [screen view campaign](/docs/campaign/screen-views/creating-screen-views) which will display all documents assigned to the `Seasonal` group. You can schedule this screen view campaign to be displayed in the specific time of year. In this use case, we'll show you how to create two documents with Christmas promotions and adding them to the `Seasonal` group. This group will be used while creating a screen view campaign, presented for your all users of the mobile application. ## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - [Create Christmas promotions](/docs/ai-hub/promotions) - [Meet the screen views requirements](/docs/campaign/screen-views/introduction-to-screen-views#requirements) - [Meet the documents requirements](/docs/assets/documents/introduction-to-documents#requirements) ## Process --- In this use case, you will go through the following steps: 1. [Create two documents](/use-cases/documents-promotion-groups#create-a-document) with basic Christmas promotion targeted to all application users, create a `Seasonal` group and add these two documents to this group. 2. [Create a screen view](/use-cases/documents-promotion-groups#create-a-screen-view) that will display the documents from the `Seasonal` group to all mobile application users. ## Create a document --- As the first part of the process, you will create two documents with the promotions you created in Synerise. You will also create a `Seasonal` group and assign these two documents to this group. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Documents > Add document**. 2. Enter the name of your document. 2. In the **Audience** section, choose to whom the document will be displayed. Select **Everyone**. 3. In the **Configuration** section: 1. In the **Slug** field, enter the slug of the document, we recommend using the following name convention: `this-is-slug-name`. 2. In the **Priority** field, use a number to define the document priority. The order of documents is defined by the priority value (1 is the highest, 100 is the lowest). 3. From the **Group** dropdown list, click **Add group**. 4. On the pop-up, in the **Group name** field, enter `Seasonal`. **Result**: The group is added and selected. 5. From the **Type** dropdown list, select a document type. Document type defines how the document is validated by your mobile application. To create a new type, from the dropdown list, click **Add type**.
Full explanation of the type is available [here](/docs/assets/documents/introduction-to-documents#terminology).
6. In the **Body** field, add the content of the promotion in the JSON format. Below you will find an easy examples of the document body that contains the promotion created in Synerise. You can add more elements to your JSON code like for example buttons, colors, tags, and so on.
{
         "content-type": "promotion",
         "background-color": "#123321",
         "title": "Christmas Promotion",
         "promotion": "{% promotion fields=uuid,name,discountType,discountValue,code,params,tags,type,price,images,description,expireAt %} 3a3750b0-c00b-4c57-9c5f-d55652b417a0 {% endpromotion %}"
       }
The view of document congifuration
Document configuration
7. Optionally, to check the document display for a specific customer, use **Preview body**. 8. To save your changes, click **Apply**. 1. In the **Schedule** section, set up when the document will be active. 2. Select the **Scheduled** tab. 3. Select the date and time when the document will be active. 2. Click **Apply** to save your changes. 3. Click **Activate**.
The view of document congifuration
Document configuration
4. Create another document with the Christmas promotion in the same way as described previously. Change the visual project and JSON code for this document. Remember to add this promotion to the `Seasonal` group. Additionally, you can change the schedule for this second promotion, based on your business needs.
If you want to add the specific document to more than one group, duplicate it and then assign it to another group.
## Create a screen view --- Create a screen view campaign for the group of documents created in the previous part of the process. 1. Go to Experience Hub icon **Experience Hub > Screen views > New Screen View**. 2. Enter the name of the screen view. 2. In the **Audience** section, choose to whom the message will be displayed. In this case, select **Everyone**. 5. Confirm your choice by clicking the **Apply** button. 6. To create the content of your screen view, in the **Content** section click the **Change** button. 1. In the **Screen views feed**, select the general feed to display. 2. Set up the **Priority**. If multiple screen views match the conditions, the one with the higher priority is displayed (1 is the highest, 100 is the lowest).
You can learn more about the order of displaying multiple screen views [here](/docs/campaign/screen-views/creating-screen-views#conflicts).
3. In the **Documents to display** section, click **Groups**. 4. Select the `Seasonal` group.
The configuration of the screen view
The configuration of the screen view
4. Confirm the choice by clicking **Add**. 4. To save your changes, click **Apply**. 6. Go to the **Schedule** section and click the **Change** button. 7. Set up when campaign will be active using the **Run immediately** option or schedule the display of the screen view using the **Scheduled** option. 8. To apply your changes, click **Save**. 5. To run your screen view campaign, click **Activate**.
The configuration of the screen view
The configuration of the screen view
## What's next --- For a screen view to be visible in a mobile application, you must fetch it using the appropriate SDK method for: - [iOS](/developers/mobile-sdk/method-reference/ios/content#generate-screen-view), - [Android](/developers/mobile-sdk/method-reference/android/content#generate-screen-view), - [React Native](/developers/mobile-sdk/method-reference/react-native/content#generate-screen-view) - [Flutter](/developers/mobile-sdk/method-reference/flutter/content#generate-screen-view) ## Generated events This use case does not generate any events. ## Read more --- - [Documents](/docs/assets/documents) - [Screen views](/docs/campaign/screen-views) # Importing product data into the Synerise catalog Data quality and timeliness are key to executing effective business operations. It is important that the data you are handling is always up-to-date, otherwise your communications won't meet the current needs of your customers. A useful solution, in this case, can be the cyclical transfer of data stored on servers to Synerise catalogs. It gives you the possibility to use up-to-date product data in customer communications such as e-mail campaigns, dynamic content, text messages, web pushes, and other customized messaging. This use case describes the process of creating an automated, recurring workflow that transfers data from your server over HTTPS to a catalog in Synerise. ## Prerequisites --- - [Create a catalog](/docs/assets/catalogs/creating-catalogs). The catalog can be empty. - Product data in the form of an XML file under the HTTPS link. Check [XML feed requirements](/developers/product-feed). The maximum allowed size of the data file is 5 GB (5 000 000 000 bytes). ## Create the workflow --- Create the workflow that imports the product data from the HTTPS link into the Synerise catalog every hour. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 3. Enter the name of the workflow. 4. As the trigger node, add **Scheduled Run**. 5. In the configuration of the node: 1. In the **Run trigger** dropdown, leave the defauld option **All time**. 2. From the **Timezone** list, select the time zone. 3. Select **Everyday** tab to launch the workflow every day at the defined time. 4. Add the hours when the workflow should be activated. 5. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering product feed import to catalog
The configuration of the Scheduled Run node
6. Add the **HTTPS Get File** node. 7. In the configuration of the node: 1. Leave the method at default (**GET**). 2. In the URL, enter the address of the resource. 3. As a file format, from the dropdown list, select **XML feed**. 4. In the Authentication section, select the required authentication method. 6. Confirm by clicking **Apply**.
The configuration of the HTTPS get file node
The configuration of the HTTPS get file node
8. Add the **Import to Catalog** node. 9. In the configuration of the node: 1. Select the catalog to which the data will be imported. 2. As the primary key, enter the name of the XML element which contains the unique identifiers of the items. 3. Confirm by clicking **Apply**.
The configuration of the Import to Catalog node
The configuration of the Import to Catalog node
10. Add the **End** node.
Automation Hub workflow for importing a product feed to catalog
The workflow configuration
Information about products from the catalog can be referenced in customer communications such as e-mails, dynamic content, text messages, etc. using [inserts](/developers/inserts/insert-usage#catalogs).
Example of a catalog with imported data:
Example of a catalog with imported items
Example of a catalog with imported items
## Check the use case set up on the Synerise Demo workspace --- You can check the workflow configuration directly in Synerise demo workspace, at this [link](https://app.synerise.com/automations/automation-diagram/b9496621-b24f-4866-8fe1-8a5da67931df). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1). ## Read more - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Product feed](/developers/product-feed) # Import Customer Profiles to Synerise Using CSV Files To leverage the AI capabilities of Synerise, personalize communication, and explore numerous other possibilities, you need a seamless method of importing your customer profiles. Whether you're migrating from another system or starting from scratch, our Imports feature, available in Data Modeling Hub, offers a streamlined process for importing profiles into our platform. Unlock the complete potential of your customer data with Synerise and gain invaluable insights to drive your business forward. By utilizing the Imports feature, you can conveniently upload and integrate customer data in CSV files, ensuring a smooth transition and accurate representation of your customer base. In this use case, you will import customers' data to Synerise using a `.csv` file in a seamless and efficient manner. ## Prerequisites --- - Prepare a `.csv` file that contains one of the following profile identifiers: (the list contains recommended column names, if you use different names you will be able to map data during the process): - `email` (only if your workspace uses [unique emails](/docs/settings/configuration/non-unique-emails)), - `uuid`, - `clientID`, - or `customID`. This is the only required column, the rest is optional.
If you choose an email as an identifier, pay attention to the correct format of emails. Otherwise, your import will fail.
In this case, we will use data from a sample file, which can be downloaded during the [Select the file for import](#select-the-file-for-import) step, using the **Get Sample File** button.
- `.CSV` files must be UTF-8 encoded, spaces and special characters in the column headers are not allowed. Check [tips for preparing a CSV file](/docs/assets/imports/importing-clients#tips-for-preparing-a-csv-file). ## Select the file for import --- In this part of the process, you will upload a file from your device. 1. Go to **Data Modeling Hub > Imports> New import**. 2. As the data type for import, select **Profiles**. 3. As the import method, to import a single `.csv` file to Synerise, select **Import a local file**. 4. To upload the `.csv` file, click the **+ Upload file or drag one here field** . 5. Optionally, you can customize the file metacharacters by clicking the arrow down icon next to **Customize file markup**. 1. From the **Delimiter** dropdown, select the character that marks the end of a column. 2. From the **Quotation mark** dropdown list, select the characters that contain the text. 3. From the **Escape character** dropdown lists, select the character which changes the default interpretation of a character or a string followed by the escape character. 6. You can preview the data output by clicking **Preview data**. 7. Click the **Next** button to upload the file. 8. When the file is uploaded, click **Next** to proceed.
The view of the Import Profiles configuration
Import Profiles configuration
## Mapping the columns with parameters in Synerise --- In this part of the process, you will connect the columns from the file with their counterparts (the existing attributes) in Synerise. This way, you will point which parameters in Synerise will contain the profile information from the imported file. You can also exclude parameters from the import. On the user interface, you will be presented with two columns - the left column displays the names of the columns from the imported file, the other contains dropdown lists with the parameters available in Synerise. The dropdown lists indicate required parameters for a successful import. If you skip mapping the non-required parameters, the name of these parameters will be the same as the names from the imported file. If parameters don't exist in Synerise, they will be imported as new parameters. 1. Next to the file column name, from the dropdown list, select the corresponding parameter in Synerise. Perform this step for all columns in your file.
In our case, we do not need to map the parameters, because the uploaded file meets all the requirements from the prerequisites.
2. To exclude a parameter from import, next to the column name, click this icon: Exclude paramater icon
The view of the mapping process
Mapping
3. To proceed to the summary of the import, click **Next**. **Result:** The summary of the import is displayed.
The view of the import summary
Import summary
4. Verify that the mapping is correct. 5. If you want to change the import mode, click **Advanced settings** and select the mode. To learn about the modes, see ["Import modes"](/docs/assets/imports/importing-clients#import-modes). 6. To launch the import, click **Run import**. 7. You can monitor the status of your import and potential errors due to incorrect data in the **Imports List**. ## Generated events This use case generates 1 event per profile that completes the flow: [`client.add`](/docs/assets/events/event-reference/profiles#clientadd) (~1). ## Read more --- - [Imports](/docs/assets/imports/introduction-to-imports) # Suggest heavy buyers higher-priced items from their most frequently purchased brands The search engine is sometimes underestimated, even though it is a critical component of an e-commerce site's user experience and directly affects customer satisfaction and conversion rates. Efficient search engine optimization is essential for e-commerce businesses looking to improve their site's search functionality, increase customer engagement, and drive sales growth. The main benefit of personalizing search results is improved relevance, which leads to increased engagement. By defining the recipients for search query rules, you can offer targeted and personalized search results to specific customer groups. By analyzing customer behavior and purchase patterns, you can identify customers who share similar preferences and interests, enabling you to tailor search results to meet their unique needs and preferences. In this use case, we are targeting heavy buyers who frequently purchase products from specific brands. By creating a segmentation that contains these customers, we can use query rules to suggest higher-priced items from the brands they already know and trust. ## Prerequisites --- - Enable [the AI Search Engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search) for your workspace. - Create and configure [search index](/docs/ai-hub/ai-search/create-index) and in the [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes) add `Price` as a range attribute. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Implement AI search](https://hub.synerise.com/api-reference/ai-search) in any of your channels (mobile app, website, and so on). - Create an RFM analysis thanks to which you will be able to define the segmentation of heavy buyers. You'll find a detailed process for creating the RFM analysis in [this use case](/use-cases/rfm-analysis).
The heavy buyers segmentation shown in this use case is just an example. You can create it using your own rules according to your specific assumptions and business needs.
## Process --- In this use case, you will go through the following steps: 1. [Create segmentation of heavy buyers](/use-cases/segment-as-a-rule-condition#create-a-segmentation-of-heavy-buyers) based on RFM analysis. 2. [Create an aggregate](/use-cases/segment-as-a-rule-condition#create-an-aggregate-for-average-customer-purchase-expenses) to calculate the average value a customer spent in the last 30 days. 3. [Create an aggregate](/use-cases/segment-as-a-rule-condition#create-aggregates-to-identify-top-bought-brands) to identify top-bought brands. 4. [Create a query rule](/use-cases/segment-as-a-rule-condition#create-a-query-rule) based on the prepared segmentation and aggregates created in the previous steps. This rule will enforce showing heavy buyers higher-priced products from the top brands they most frequently purchase in search results. ## Create a segmentation of heavy buyers --- In this part of the process, create a segmentation of heavy buyers based on the RFM segmentation you created earlier. 1. Go to **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segment. 3. Choose **Add condition** and find the RFM segmentation you created earlier. 4. Select the **Equal** operator and in the right field enter the name of the sub-segment that defines the heavy buyers. In our case, we type - `Heavy Buyers` 5. Save the aggregate.
Decision Hub segmentation filtering customers whose RFM subsegment equals Heavy Buyers
Segmentation settings
## Create an aggregate for average customer purchase expenses --- In this section, create an aggregate that returns the average value of products purchased by an individual customer in the last 30 days. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Average**. 4. From the **Choose event** dropdown list, select the `product.buy` event. 5. As the event parameter, select **$finalUnitPrice**. 6. Define the period from which data will be analyzed. In our case it will be last 30 days. 7. Save the aggregate.
Decision Hub Average aggregate returning the average finalUnitPrice of product.buy events in the last 30 days
Aggregate settings
## Create aggregates to identify top-bought brands --- In this section, create an aggregate that returns the top-bought brands by an individual customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Top**. 4. From the **Choose event** dropdown list, select the **product.buy** event. 5. As the event parameter, select **brand**. 6. Define the period from which the aggregate will return products from the event. 7. Save the aggregate.
Decision Hub Top aggregate returning the most frequently purchased brands from product.buy events
Configuration of the aggregate
## Create a query rule --- In this part of the process, create a query rule for heavy buyers that will enforce showing to them higher-priced products from the top brands they most frequently purchase in search results. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Select an index from the list. 3. Go to the **Rules** section. 4. On the right side of the screen, click **Add rule**. 5. Name the rule. 6. To define the audience group for the rule, in the **Audience** section, click **Change**. 1. Choose the **Segments** tab and click **Add segments**. 2. Find the segment of heavy buyers you created [earlier in the process](/use-cases/segment-as-a-rule-condition#create-a-segmentation-of-heavy-buyers) and apply that segment. 7. To adjust the query conditions, in the **Conditions** section, click **Define**. 1. Choose the **All queries** tab. 2. Click **Apply**. 8. To define how the search engine reacts to the defined conditions, in the **Consequences** section, click **Define**. 1. Click **Add consequence** and choose **Filter query results** from the dropdown list. 2. From the **Attribute** dropdown list, choose `Price`. 3. Choose the **More than** operator. 4. In the left field, click the **#** icon and from the dropdown list, select **Aggregate**. 5. From the list, choose [aggregate](/use-cases/segment-as-a-rule-condition#create-an-aggregate-for-average-customer-purchase-expenses) created earlier in the process. 6. Click **Add filter** and from the **Attribute** dropdown list, choose **Brand**. 7. Choose the **In** operator. 8. In the left field, click the **T** icon and from the dropdown list, select **Aggregate**. 9. From the list, choose [aggregate](/use-cases/segment-as-a-rule-condition#create-aggregates-to-identify-top-bought-brands) created earlier in the process. 10. Enable the **Mark as elastic** option to make sure that the items you set will appear at the top of the search results. If you do not activate this option, search results will show only those products. 11. Click **Apply**. 9. In the **Schedule** section, you can define when the query rule applies. 10. Click **Save & Publish**.
Query rule settings
Query rule settings
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration directly in Synerise demo workspace: - [Segmentation](https://app.synerise.com/analytics/segmentations/a8b2ed5c-c342-436f-a98e-eca642767926) of heavy buyers, - [Aggregate](https://app.synerise.com/analytics/aggregates/869e7abf-f235-3614-af7c-69b22ad88175) with the average value a customer spent in the last 30 days, - [Aggregate](https://app.synerise.com/analytics/aggregates/04a8575c-9c62-37bb-a4ee-c99238e38ba5) to identify top-bought brands, - [Query rule settings](https://app.synerise.com/ai-v2/search/indices/afc98c53b968b4c47ff1e21e7219d4f41668083405/query-rules/15408). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [AI Search](/docs/ai-hub/ai-search) - [Segmentation](/docs/analytics/segmentations) # Average number of transactions per month In this scenario, you will create sample segmentation that allows you to divide your clients into segments based on their average number of transactions per month. You may use that information further for targeted communication with promotions for a specific group. ## Prerequisites --- - Add a [tracking code](/developers/web/installation-and-configuration) to your website. - Become familiar with [aggregates](/docs/crm/aggregates) and [expressions](/docs/crm/expressions). ## Process --- 1. Create [aggregates](/use-cases/segmentation-average-transactions#create-aggregates). 2. Create [expression](/use-cases/segmentation-average-transactions#create-expressions). 3. Create [segmentation](/use-cases/segmentation-average-transactions#create-segmentation). ## Create aggregates --- In the first part of the process, create two aggregates which will be used later for creating expressions: - An [aggregate that counts a total number of transactions](/use-cases/segmentation-average-transactions#total-number-of-transactions-for-a-customer) a customer made - An [aggregate that returns the timestamp of the first transaction](/use-cases/segmentation-average-transactions#timestamp-of-the-first-customers-transaction) a customer made ### Total number of transactions for a customer 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate, for example `Total number of transactions`. 3. Set **Analyze profiles by** to **Count**. 4. From the **Choose event** dropdown list, select **transaction.charge** 5. In the date picker, select **Lifetime**. 6. Save the aggregate.
Behavioral Data Hub aggregate formula counting total number of transaction.charge events
The formula of the aggregate
### Timestamp of the first customer's transaction 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate, for example `Timestamp of first transaction`. 3. Set **Analyze profiles by** to **First**. 4. From the **Choose event** dropdown list, select **transaction.charge**. 5. As the event parameter, select **TIMESTAMP**. 6. In the date picker, select **Lifetime**. 7. Save the aggregate.
Behavioral Data Hub aggregate formula returning timestamp of first transaction.charge event
The formula of the aggregate
## Create expressions --- In the next part of the process, create 4 expressions. The fourth one uses the results of the first three to calculate the average number of transactions, and is later used as an attribute for creating a segmentation. The list of expressions: - An [expression that returns the timestamp of the current date](/use-cases/segmentation-average-transactions#timestamp-of-the-current-day) - An [expression that returns the timestamp of the first customer's transaction](/use-cases/segmentation-average-transactions#timestamp-of-the-first-customers-transaction) expressed in milliseconds - An [expression that returns the number of months that passed since the first transaction](/use-cases/segmentation-average-transactions#number-of-months-since-the-first-transaction) - An [expression that returns the average number of transactions per month](/use-cases/segmentation-average-transactions#average-number-of-transactions-per-month) ### Timestamp of the current day 1. Go to **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression, for example `Timestamp - today`. 3. As the expression type, select **Attribute**. 4. Create the following formula of the expression: 5. Save the expression.
Behavioral Data Hub expression formula returning timestamp of today
The formula of the expression
### Timestamp of the customer's first transaction in milliseconds 1. Go to **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression, for example `Timestamp of the first transaction - milliseconds`. 3. As the expression type, select **Attribute**. 4. Create the following formula of the expression: 5. Save the expression
Behavioral Data Hub expression formula converting first transaction timestamp to milliseconds
The formula of the expression
### Number of months since the first transaction 1. Go to **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression, for example `Months since the first transaction`. 3. As the expression type, select **Attribute**. 4. Create the following formula of the expression. 5. Save the expression.
Behavioral Data Hub expression formula calculating months elapsed since first transaction
The formula of the expression
### Average number of transactions per month 1. Go to **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression, for example `Average number of transactions per month`. 3. As the expression type, select **Attribute**. 4. Create the following formula of the expression: 5. Save the expression.
Behavioral Data Hub expression formula calculating average number of transactions per month
The formula of the expression
## Create segmentation --- In the final part of the process, create a segmentation that organizes customers into three groups: - More than 2 transactions per month - It gathers the customers who make more than 2 transactions per month on average - 2 transactions per month - It gathers the customers who make 2 transactions per month on average - Less than 2 transactions per month - It gathers the customers who make less than 2 transactions per month on average 1. Go to **Decision Hub > Segmentations > New segmentation**. 2. Rename **Segment A** to `More than 2`. 3. Click **Add segment**. 4. Rename **Segment B** to `2`. 5. Click **Add segment**. 6. Rename **Segment C** to `Less than 2`. 7. Configure the conditions of each segment:
More than 2
  1. Click Have property...
  2. Select the Average number of transactions per month expression
  3. As the logical parameter, select MORE (Number icon)
  4. As the value, enter `2`.
  5. Click Performed event...
  6. Select the transaction.charge event.
2
  1. Click Have property...
  2. Select the Number of months since the first transaction expression
  3. As the logical parameter, select Equal (Number icon)
  4. As the value, enter `2`.
  5. Click Performed event...
  6. Select the transaction.charge event.
Less than 2
  1. Click Have property...
  2. Select the Number of months since the first transaction expression
  3. As the logical parameter, select LESS (Number icon)
  4. As the value, enter `2`.
  5. Click Performed event...
  6. Select the transaction.charge event.
Decision Hub segmentation conditions based on average monthly transactions expression
The conditions of the segmentation
5. Save the segmentation. Below the settings of the segmentation, you can preview how your customer base splits according to the defined conditions. 6. Click **Show preview**. You receive the number of customers in each segment and the percentage of each segment in relation to the whole population in the segmentation. Additionally: - You can change the chart type - pie chart and column chart - You can also export the information to CSV/XLSX (data) or JPEG/PNG/PDF (chart)
The preview of segmentation
The preview of the segmentation
## Check the use case set up on the Synerise Demo workspace --- You can also check the configuration directly in Synerise Demo workspace: - [segmentation](https://app.synerise.com/analytics-v2/segmentations/24c48af2-81a0-452c-a2a6-459dc376fb5a) - [aggregate that counts a total number of transactions](https://app.synerise.com/analytics/aggregates/81890447-8c0a-3565-8742-f7f8ff270e03) - [aggregate that returns the timestamp of the first transaction](https://app.synerise.com/analytics/aggregates/378f75ac-c7a3-3658-bf56-174facc48587) - [expression that returns the timestamp of the current date](https://app.synerise.com/analytics/expressions/4be2dabc-0051-4dd5-97ee-bb65a372fac5) - [expression that returns the timestamp of the first customer's transaction](https://app.synerise.com/analytics/expressions/7562b3bc-2dab-4714-9251-c65d6be01a6d) - [expression that returns the number of months that passed since the first transaction](https://app.synerise.com/analytics/expressions/430e6de0-04ab-4974-9cac-4d734ef9099d) - [expression that returns the average number of transactions per month](https://app.synerise.com/analytics/expressions/0fb2c6ff-ffe0-4907-aa35-ae2e31812e97) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Segmentation](/docs/analytics/segmentations) # Discount for entire basket Increasing average order value is one of the most important KPI's in commerce activities. Promotion for entire basket with minumum cart value can trigger a boost in spending across whole loyalty base. While creating such a promotion, additional assumptions need to be taken into consideration: - A discount should be granted only when a transaction value exceeds the minimum amount in order to incentivize a customer to increase their basket size. - The value of certain items (like alcohol or cigarretes) should not be included in basket value while calculating minimum threshold (for legal purposes). In this use case, we will create a basket promotion with 10% discount on all items (except for alcohol products) with 25$ minimum basket value trigger.
Basket promotion
Basket promotion
## Prerequisites --- - Point of sales must be integrated with Synerise promotion engine to calculate discounted values of basket items. - Product feed must be uploaded to catalog. ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Create a list of excluded items](/use-cases/promotion-for-entire-basket#create-a-list-of-excluded-items). 2. [Create a promotion](/use-cases/promotion-for-entire-basket#create-a-promotion). ## Create a list of excluded items --- In order to exclude forbidden items from calculating basket value, you need to create a filter in a product catalog, which will contain all items you would like to exclude from this promotion. 1. Go to **Assets > Catalogs** and find your product catalog. 2. Click the Filter icon icon. 3. Click **Define**. 4. Enter the name of the filter and define the conditions of the filters as presented in the image below:
Setting up product filters
Setting up product filters
The filter will be automatically updated once you add new products to the catalog.
## Create a promotion --- Once you've defined filter with alcohol products, create a promotion for entire basket. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For entire cart** option. 3. In the **Audience** section, select a group of customers for whom the promotion will be activated. Confirm your selection, by clicking **Apply**. 4. In the **Content** section, define the name, description, and an image of the promotion. Confirm the settings by clicking **Apply**. 5. In **Type & limits** section: 1. As a Discount type, choose **Percentage**. 2. In the Cart section, as the minimum value, enter `25`. 6. In the **Schedule** section, define the distribution period. 7. In **Exclude items** section choose previously created filter from the dropdown in **Filtered items** section. 8. To apply all changes and run the promotion, click **Publish**. Once the promotion is published, it will be visible immediately to all customers defined in thw **Audience** section in every distribution channel.
Excluding products from promotion
Excluding products from promotion
Each item in the basket will be discounted by amount you defined as **Value** in **Type & limits** section. This does not apply to items which have been selected in **Exlude items** section - their price will not be changed.
## Check the use case set up on the Synerise Demo workspace --- Check the promotion settings in Synerise Demo workspace at this [link](https://app.synerise.com/campaigns/promotions/a0c5024e-a657-47bb-99a3-657e8fb38576). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Promotions](/docs/ai-hub/promotions) # Transfer Propensity Prediction Results to DataLayer Using Predefined Templates Transferring data to DataLayer is a common practice for companies to collect and store customer data in a centralized location. DataLayer is a powerful tool that allows companies to integrate customer data with other business applications, analytics tools, and third-party platforms. By storing data in a centralized location, businesses can gain valuable insights into their customers' behaviors and preferences, which they can use to create targeted marketing campaigns. With the new predefined Dynamic Content templates, you can easily send aggregates and expression results to DataLayer. In this use case, the propensity to buy prediction results for a specific brand are sent to the DataLayer (along with the propensity to buy score for individual customers).
Sending data to DataLayer
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - Create an [item feed](/developers/product-feed). - [Enable the Propensity prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-propensity-and-best-fit-predictions). - [Implement Google Data Layer on your website](https://developers.google.com/tag-platform/tag-manager/web/datalayer). ## Process --- In this use case, you will go through the following steps: 1. [Create a prediction](/use-cases/send-aggregate-to-datalayer#create-a-prediction). 2. [Create an aggregate](/use-cases/send-aggregate-to-datalayer#create-an-aggregate) that returns the last propensity score received by each customer. 2. [Create dynamic content](/use-cases/send-aggregate-to-datalayer#create-dynamic-content) that send the results of aggregate to DataLayer. ## Create a prediction --- Create a prediction of the propensity to buy a specific brand. The results of this prediction will be sent to DataLayer. 1. Go to AI Hub icon **(AI Predictions) Models > New prediction** and select **Propensity** as the prediction type. 2. Select the audience for the prediction. In our case, we will use segmentation of customers who have visited the website in the last 90 days. You can find the configuration of this segmentation [in this part](/use-cases/send-aggregate-to-datalayer#check-the-use-case-set-up-on-the-synerise-demo-workspace) of the use case. For more information, see the [Predictions quick start article](/docs/ai-hub/predictions/propensity#select-customers-to-be-analyzed). ### Define the item In this part of the process, define the brand(s) for which you want to calculate the prediction by defining the item filter conditions. 1. In the **Item selection** section, click **Define**. 2. Click **Choose item feed**. 3. Select the catalog that contains the items you want to make the prediction for. **Result**: The **Item filter** section appears. 4. Click **Define item filter**. 5. From the **Select attribute** dropdown list, select the `brand` attribute. You can use the search field. 6. From the dropdown list that appears, select the **Equal** operator. 7. Select the desired brand(s). 8. Click **Save**. 9. Save the item feed configuration by clicking **Apply**.
Item filter configuration
Item filter configuration
### Additional settings and saving Configure the [additional settings](/docs/ai-hub/predictions/propensity#additional-settings) (or leave them at default) and click **Save & Calculate**.
After the calculation, a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction.
Configuration of the prediction
Configuration of the prediction
## Create an aggregate --- In this part of the process, create an aggregate that returns the last propensity score obtained by each customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown list, select the **snr.propensity.score** event. 5. As the event parameter, select **score_label**. 6. Click **+ where** button. 7. From the **Choose parameter** dropdown list, select the **modelId** parameter. 8. From the **Choose operator** dropdown list, select **Equal**. 9. Enter the ID of the propensity model created earlier in the process. In our case, it's `ihwfubimbnrg`. 10. Set the period from which the aggregate will analyze the results to the **Lifetime**. 11. Save the aggregate.
Decision Hub Last aggregate returning the score_label of the last snr.propensity.score event filtered by propensity model ID over a customer's lifetime
Configuration of the aggregate
## Create dynamic content --- 1. Go to **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose **Insert Object** type. ### Define Audience 4. As the Audience select **New Audience** and click **Define conditions**. 1. From the **Choose filter** dropdown list, select the **snr.propensity.score** event. 2. Click **+ where** button. 3. From the **Choose parameter** dropdown list, select the **modelId** parameter. 4. From the **Choose operator** dropdown list, select **Equal**. 5. Enter the ID of the propensity model created earlier in the process. In our case, it's `ihwfubimbnrg`. 6. Set the period from which the aggregate will analyze the results to the **Lifetime**. 7. Apply all conditions. 8. Click **Apply** to save the audience.
Audience configuration
Audience configuration
### Define content 5. In the **Content** section, select **Simple message**, and specify the CSS selector where you want to insert your search. In our case, we use the following selector: `.srns-modal-wrapper` 6. In the **Content** tab, click **Create Message**. 7. From the list of template folders, select a folder with the predefined script templates. **Result**: You are redirected to the list of predefined templates.
Script templates folder
Script templates folder
8. Select the **Send aggregate to dataLayer** template. **Result**: You are redirected to the template builder.
You can edit the template in two ways, by editing the code of the template ([add snippets](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-variable)) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit the form in the Config tab The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. 1. From the **Aggregate ID** dropdown list, select the [aggregate you created in the previous step](/use-cases/send-aggregate-to-datalayer#create-an-aggregate). You can find it by typing its name or ID in the search box. 2. In the **Event parameter name** field, define the name of event parameter that stores the aggregate value pushed in event to DataLayer. You can leave the default name of the event parameter defined in the template or change its name to a different one you want to see in the DataLayer. 3. In the **Event name** field, define the name of event pushed to DataLayer. 4. If the template is ready, in the upper right corner, click **Save this template > Save as**. 5. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 6. To continue the process of configuring the dynamic content campaign, click **Next**. 7. To save your content changes, click **Apply**. ### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. In our case, we will define the frequency of dynamic content to be displayed to **Once per day**. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/11312171-ac93-4c81-a176-a096f7ec2538) - [Propensity prediction](https://app.synerise.com/ai-v2/predictions/propensity/sqkrtvagceac) - [Aggregate](https://app.synerise.com/analytics/aggregates/05775fe2-307f-3180-94d1-b7b9339f7c3f) - [Dynamic content](https://app.synerise.com/campaigns/create/6491e0aa-e0c0-4c8e-a5d1-8dd9f5970cea) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic content template builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder) - [Jinjava inserts](/developers/inserts) - [Snippets](/docs/assets/snippets) # Automate Sending NPS Survey Data to Google Cloud Pub/Sub [Google Could Pub/Sub](https://cloud.google.com/pubsub/docs/overview) is a messaging service for exchanging event data among applications and services. It lets you create systems of event producers and consumers, called **publishers** and **subscribers**. Publishers communicate with subscribers asynchronously by broadcasting events to a **topic** regardless of how or when these events are to be processed. Pub/Sub then delivers events to all the subscribers of that topic, and each subscriber has its own logic of reacting to the event. Integrating Synerise with Google Cloud Pub/Sub provides a seamless solution for exporting data from Synerise to Pub/Sub through dedicated nodes, including the valuable NPS survey data. With Google Cloud Pub/Sub integration, you can send selected data to this messaging service. This service makes data available to all subscribers, which can include any Google service or other third-party tools. In this use case, we will create a workflow that sends information with NPS survey data to Google Cloud Pub/Sub using a dedicated node in our Automation. ## Prerequisites --- - Implement a custom event for NPS survey data, which will be available in the customer profile. In this example, the event is called `nps.sent`. Implement custom events in your [mobile application](/developers/mobile-sdk/event-tracking#basic-custom-event) or website [Web](/developers/web/event-tracking#declarative-tracking-custom-events). You can learn more about NPS survey in [this use case](/use-cases/dynamic-nps). - Check [the requirements](/docs/automation/integration/google-cloud-pubsub/publish-message#prerequisites) you must meet to integrate Synerise with Google Cloud Pub/Sub. ## Create a workflow --- Create a workflow which sends information with NPS survey data to Google Cloud Pub/Sub. Every time the `nps.sent` event is generated, the data from the event is sent automatically to Pub/Sub. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- At this stage, we will configure conditions that launch the workflow. As a trigger, we will use the `nps.sent` event.
Click here to see example event and its parameters for an example customer
{ "time": "2023-02-15T15:24:49Z", "action": "nps.sent", "label": "", "client": { "id": 5092159999, "email": "e0097757-d1e2-44ac-ba3c-d97979a354c1@anonymous.invalid", "uuid": "e0097757-d1e2-44ac-ba3c-d97979a354c1" }, "params": { "eventCreateTime": "2023-02-15T15:25:08.861Z", "name": "John", "surname": "Doe", "location": "Warsaw", "age": "23", "feedback": "I am very satisfied with the service. The support team was responsive and helpful.", "product_id": "PROD123", "order_id": "ORD456", "nps_score": 9, "NPSsource": "mobile_app" } }
1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. Enter the name of the node. 2. From the **Choose event** dropdown menu, choose the `nps.sent` event. 2. Confirm by clicking **Apply** ### Configure the Publish Message node --- At this stage, we will configure the Google Cloud Pub/Sub **Publish Message** node.
We recommend publishing data in Google Cloud Pub/Sub using the CloudEvents standard, however, if you want to publish a message out of this standard or if you want to publish more than one message at once, proceed with [“Publish raw messages” node](/docs/automation/integration/google-cloud-pubsub/publish-raw-messages).
1. As the next node, add **Google Cloud Pub/Sub > Publish Message**. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/google-cloud-pubsub/publish-message#create-a-connection). - If you selected an existing connection, proceed to defining the integration settings. 4. In the configuration of the node: 1. In the **Project ID** field, enter the unique identifier of your project in Google Cloud Console. You can learn how to find the project ID [here](https://support.google.com/googleapi/answer/7014113). 2. In the **Topic ID** field, enter the unique identifier of the topic (a named resource that represents a feed of messages). Learn more about [creating and managing topics](https://cloud.google.com/pubsub/docs/create-topic). 3. In the **Attributes (optional)** field, enter a JSON key-value object with message attributes. This can be used to filter messages in the subscription. Learn more about [building the "attributes" object](https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage). The Attributes object can contain up to 100 attributes. In this use case, we will add source of the NPS event as an attribute. This will allow subscribers in Pub/Sub to filter the proper messages to be consumed. The example of Attributes object contains [the Automation inserts](/developers/inserts/automation) that retrieve data from the event included in the **Profile Event** node.
Click here to see an example of Attributes object used in this use case
{ "NPSsource": "{{ event.params.NPSsource }}" }
4. In the **CloudEvent type** field, enter the type of data sent in the CloudEvent. Learn more about [CloudEvent types](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type). 5. In the **Data (optional)** field, enter the event data. It will be sent to Pub/Sub as the `data` object in a [CloudEvent JSON Object](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md). The CloudEvent object will be automatically encoded with base64 and sent as the `data` field in a [Pub/Sub Message](https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage). In this use case, we will send values of `nps.sent` event parameters such as, among others, **name**, **surname** and **feedback**. The example of Data field contains [the Automation inserts](/developers/inserts/automation) that retrieve data from the event included in the **Profile Event** node.
Click here to see an example of the Data field used in this use case
{ "eventCreateTime": "{{ event.params.eventCreateTime }}", "name": "{{ event.params.name }}", "surname": "{{ event.params.surname }}", "location": "{{ event.params.location }}", "age": "{{ event.params.age }}", "feedback": "{{ event.params.feedback }}", "product_id": "{{ event.params['product_id'] }}", "order_id": "{{ event.params['order_id'] }}", "nps_score": "{{ event.params['nps_score'] }}" }
6. Confirm the settings by clicking **Apply**. ### Add the finishing node --- 1. Add the **End** node.
Automation Hub workflow for sending NPS events to Pub/Sub
The workflow configuration
2. In the upper right corner, click **Save & Run**. **Result**: Every time the `nps.sent` event is performed on the profil of customer, data from this event is streamed to Pub/Sub. After each such action, a response event (`pubSub.publishMessage`) is generated on the customer's profile.
The response event example
Example of pubSub.publishMessage event, generated after sending data to Google Cloud Pub/Sub
## Check the use case set up on the Synerise Demo workspace --- You can check the [workflow configuration](https://app.synerise.com/automations/automation-diagram/1fbf41b2-7e9e-46e1-b450-8ceff9289695) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: `nps.sent` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`pubSub.publishMessage`](/docs/assets/events/event-reference/integration#pubsubpublishmessage) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Publish Message node](/docs/automation/integration/google-cloud-pubsub/publish-message) - [Jinjava inserts](/developers/inserts/automation) # Send any event to Facebook You can relay any events collected by Synerise to [Facebook Conversion API](https://developers.facebook.com/docs/marketing-api/conversions-api/) in order to enrich the customer's history and create more personalized ads in Facebook. Example events: - page visits - adding a product to cart - clicking a recommendation - prediction results - many more, including your own custom event types In this use case, we will send `page.visit` events to Facebook using the dedicated integration node in Automation Hub.
Completing this procedure requires some knowledge on sending API requests using tools such as curl or Postman.
## Prerequisites --- - [Create a Pixel in Facebook](https://developers.facebook.com/docs/facebook-pixel). - [Generate an access token in Facebook](https://developers.facebook.com/docs/marketing-api/conversions-api/get-started/#access-token). - In Synerise, you must have permissions that allow you to access **Automation Hub** and create an outgoing integration and a workflow. - In Synerise, implement tracking of [events](/docs/assets/events/event-definitions) that you want to send to Facebook. ## Create a workflow --- In this part of the process, you will create a workflow that is triggered by an event. Through the outgoing integration, the system sends this event to Facebook. ### Add the Profile Event trigger In this part of the process, you will configure the trigger of workflow. Whenever the event in trigger happens, the system launches the workflow and performs action configured in it - in our case it will be sending event to Facebook. 1. In the Synerise app, go to **Automation Hub > Workflows > New workflow**. 2. On the dashboard, click the plus button. 3. From the dropdown list, select **Profile Event**. 4. Double-click the **Profile Event** node. 5. On the pop-up, from the **Choose event** list, select the page visit event. If you're not sure of the event's label in your system, search for `page.visit` (or other event you want to send to Facebook). 6. Confirm by clicking **Apply**.
Configuration of the Profile Event trigger
Configuration of the Profile Event trigger. No conditions are used, all page.visit events activate the trigger.
### Configure Facebook Integration node In this part of the process, you will configure an action that workflow performs - outgoing integration that sends the event to Facebook. Values of the event parameters will be dynamic and will be passed from the event trigger using [inserts](/developers/inserts/automation). 1. On the **Profile Event** node, click the plus icon. 2. From the dropdown list, select **Facebook**. 3. From the dropdown list, select **Send Custom Event**. 4. Click the node. 5. Click **Select connection**. 6. From the dropdown list, select the connection. If you haven't established a connection yet, see [Create a connection](/use-cases/sending-events-facebook#create-a-connection).
Configuration of the Facebook Integration node
Final configuration of the Facebook Integration node
### Create a connection Use an access token which allows you to send a request. 1. At the bottom of the **Select connection** dropdown list, click **Add connection**. 2. In the **Access token** field, enter the app access token.
You can read more about access tokens in [Facebook documentation](https://developers.facebook.com/docs/marketing-api/conversions-api/get-started/#access-token).
3. Click **Next**. 4. In the **Connection name** field, enter the name for the access token you generated. 5. Click **Apply**. **Result**: A connection is created and selected. ### Define the integration settings 1. In the **Graph API version** field, enter the currently used API version in Facebook. You can find information about the currently used API version in the Facebook documentation. 2. In the **Meta Pixel ID** field, enter the identifier of the Pixel you use in Facebook. You can find information about how to find ID of the Pixel in the Facebook documentation. 3. In the **Event data** input field, enter the JSON body of event. Use [inserts](/developers/inserts/automation) to insert dynamic values and [Facebook developer documentation](https://developers.facebook.com/docs/marketing-api/conversions-api) to build the structure of event body.
It is mandatory to provide one of the customer identifiers listed under the Customer Information Parameters section of the [Conversions API Documentation - Meta for Developers](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters).
**Example** of `page.visit` event body:
{   "data": [
    {
        "event_name": "PageVisit",
        "event_time": {{ (event.params.time / 1000)|int }},
        "event_source_url": "{{ event.params.uri }}",
        {% if event.params['product:retailer_part_no'] %}
            "currency": "PLN",
            "content_type": "product",
            "content_ids":  ["{{ event.params['product:retailer_part_no'] }}"],
            "value": {{ event.params['product:price:amount']|int }},
        {% endif %}
        "user_data": {
            "client_ip_address": "{{ event.params.ip }}",
            "client_user_agent": "",
            "em": ["{% if 'anonymous' in client.email %}{% else %}{{ client.email|trim|lower|hash("SHA-256") }}{% endif %}"],
            "ph": ["{% if 'phone' in customer|string %}{{ client.phone|trim|lower|hash("SHA-256") }}{% endif %}"],
            "fbc": "",
            "fbp": ""
        },
        "custom_data": {}
    }]
   }
where: | Line number | Description | | --- | --- | | 4 | Inserts event time from the trigger node and re-calculates it into seconds (this is required by Facebook). | | 5 | Inserts URI from the trigger node as the `event_source_url` param. | | 6-11 | If the visited page has product metadata, inserts that metadata. | | 13 | Inserts customer's IP from the trigger node. | | 15 | Inserts email encoded using SHA-256 algorithm, if available. | | 16 | Inserts phone number encoded using SHA-256 algorithm, if available. |
In the example of body described above, you can see that customer's personal data is encoded. While sending events to Facebook, the customers' identifiers must be encoded using SHA-256 algorithm. Read more about encoding function in [inserts](/developers/inserts/filter#hash).
6. Confirm by clicking **Apply**. ### Add the End node 12. On the **Send Custom Event** node, click the plus button. 13. From the dropdown list, select **End**. 14. Save and activate the automation by clicking **Save&Run**. 15. Go to your Facebook Ad account, select **Facebook Manager > Events Manager** to see the events.
The final structure of the workflow
The final structure of the workflow
**Result**: After the customer performs event trigger, the `webhook.response` event is visible on the customer's profile with 200 status. That means that the event has successfully been sent to Facebook. ## Check the use case set up on the Synerise Demo workspace --- You can also check [the workflow configuration](https://app.synerise.com/automations/automation-diagram/a9180cf5-847f-4d90-8573-66371c8fe837) directly in Synerise Demo. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1). ## Read more --- - [Add Profiles to Custom Audience](/use-cases/send-custom-audience-webhook) - [Send offline transactions to Facebook](/use-cases/sending-offline-transactions-facebook) # Predicting the likelihood of offline visit We can predict the likelihood of offline visit for customers with their push notifications enabled. They may be a great target for promotions, so you may want to [send them push notifications with promotions at the best time](/use-cases/mobile-push-birthday-best-time). You can automate sending mobile push notifications to promote products and boost the value of in-store visits by sending promo coupons to customers who are predicted to visit our offline store. This use case describes a workflow that sends a mobile push notification with a promotional code to customers who are predicted to visit an offline store. In this case, we consider transactions made in an offline store as a visit. However, depending on your business, you can take any other event that will be equal to a customer's presence in your offline store, for example scanning a mobile application at the entrance. The workflow is triggered by the `snr.prediction.score` event with the high score and sends a mobile push at the time they are most likely to visit in the next seven days. ## Prerequisites --- - [Implement Synerise SDK in your mobile application](/developers/mobile-sdk). - Implement mobile push notifications in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - Implement offline transaction events using [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction).
In this case, we consider an offline transaction as a visit to the store, but if necessary, you can implement a different event that will mean visiting the offline store, such as a [custom event for scanning the mobile application](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent).
- [Enable time optimizer](/docs/settings/configuration/time-optimizer#enabling-time-optimizer). - [Create a Mobile mode](/docs/settings/configuration/time-optimizer#creating-modes) for Time Optimizer that will calculate the customer's activity time in the mobile application. - [Create a mobile push template](/docs/campaign/Mobile/creating-mobile-push) with a promo code.
For promo codes, you can use our [Voucher pools](/docs/assets/code-pools), which allows you to assign a unique coupon from a specified pool for each customer.
## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](#create-a-segmentation) of customers who have made transaction in an offline store. 2. [Create an expression](#create-an-expression). 3. [Create a segmentation of customers for whom the prediction is made](#create-a-segmentation-of-customers-for-whom-the-prediction-is-made). 3. [Create a prediction](#create-a-prediction). 4. [Create a workflow](/use-cases/predicting-likelihood-of-offline-visit#create-a-workflow). ## Create a segmentation --- In this step, we create a group of customers who have made transaction in an offline store. This segmentation will be used in an expression in the next step. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. From the **Add condition** dropdown list, select the `transaction.charge` event. 5. Click the **+ where** button, from the **Choose parameter** dropdown menu, choose `$offline`. 6. From the **Choose operator** dropdown, choose **Boolean**, and then select **Is true**. 7. Using the date picker in the lower-right corner, set the time range to **Relative time range > Lifetime**. Confirm by clicking **Apply**. 6. Save the segmentation.
Decision Hub segmentation configuration filtering customers with offline purchase history
Segmentation configuration
## Create an expression --- In this part of the process, create an expression that will serve as the target for the prediction model. The expression will return 1 if a customer belongs to the previously defined segmentation and 0 if they don’t. 7. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 8. Enter the name of the expression. 9. From the **Expressions for** dropdown list, select **Attribute**. Predictions work only with attribute expressions. 10. In the formula creator, click the **Select** node and from the drop-down list select **Function > If**. 11. As the first argument, select the [segmentation you created earlier](#create-a-segmentation): 12. As the second argument, select **Constant** with a value of `1`. 12. As the third argument, select **Constant** with a value of `0`. 13. Save the expression.
The view of the expression configuration
Expression configuration
## Create a segmentation of customers for whom the prediction is made --- In this step, we create a group of customers who have visited our online store in the last 7 or 14 days. This segmentation will be used as an audience for the prediction. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. From the **Add condition** dropdown list, select the `Visited page` event. 5. Using the date picker in the lower-right corner, set the time range to **Relative time range > More > Last 7 days**. Confirm by clicking **Apply**. 6. Click **Add segment**. 7. From the **Add condition** dropdown list, select the `Visited page` event. 5. Using the date picker in the lower-right corner, set the time range to **Relative time range > Custom > Last 14 days**. Confirm by clicking **Apply**. 6. Save the segmentation.
Decision Hub segmentation configuration filtering customers who visited the online store in the past two weeks
Segmentation configuration
## Create a prediction --- In this step, we will calculate the prediction, create a segmentation of customers who will be analyzed while making a prediction. The output of the prediction is a `snr.prediction.score` event that will appear on the customers’ profiles. The event contains a `score.label` parameter which determines the probability of a customer's visit to your store. The workflow configuration will be based on this parameter. We will select customers who have the highest probability to visit our store. 1. Go to AI Hub icon **AI Hub > (AI Predictions) Models > New prediction**. 2. Enter a name for the prediction. 3. In the **Prediction type** section, click **Define**. 4. Select **Classification** and click **Apply**. ### Select the audience In this section you decide which group of the customers will be taken into account while making a prediction. For every individual in the segmentation, Synerise produces a single prediction. Segmentations can be very complex and the possibilities of building the conditions are practically unlimited. In this example, a simple segmentation will include customers who have made a transaction in the last week or two weeks. 1. In the **Audience** section, click **Define**. 2. Click **Choose segmentation**. 3. Enter the name of the [segmentation you've created in the previous step](#create-a-segmentation-of-customers-for-whom-the-prediction-is-made). ./8. Click **Apply**. ### Select prediction target 1. In the **What would you like to predict?** section, click **Define**. 2. Click **Select expression** and select the [expression created earlier](#create-an-expression). 3. Click **Apply**. ### Select inputs In this section, you set up input [features](/docs/glossary#feature) based on which the prediction model will be trained. It is possible to select feature inputs manually, but we recommend using the automatic selection, as explained below. Our algorithms evaluate feature relevance in context of the prediction target and are, in most cases, more effective than manual selection. 1. In the **Model inputs** section, click **Define**. 2. Click **Add feature > Automatically**. **Result:** The list is populated with input features. 3. Click **Apply**. ### Configure additional settings The additional settings define how often re-calculations are made and the content of events produced by the prediction. 1. In the **Settings** section, click **Define**. 2. From the **How many days in advance do you want to make a prediction** list, select **30 days**. 3. For the purposes of this example, select **One-time calculation** checkbox. 4. In the **Prediction start** section, select **Immediately**. 4. In **How would you like to display results**, select **5-point scale**. The algorithm detects the importance of a prediction. 6. In the **Define the value of the score name parameter** section, enter a user-friendly name for the prediction score. The name is shown as the value of the `scoreName` parameter in the `snr.prediction.score` event. 7. Click **Apply**. 7. To finish and calculate the prediction, click **Save & Calculate**. **Result:** The prediction results are saved as `snr.prediction.score` events in customer profiles. ## Create a workflow --- As the final part of the process, create a workflow that manages the push notifications. The `snr.prediction.score` event with the high score triggers the start of the workflow. The push notification will be sent to customers with the high prediction score to visit offline store on the day they are most likely to visit. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node 1. As the first node of the workflow, add **Profile Event**. In the node settings: 1. Click **Choose filter** and from the dropdown list, select the `snr.prediction.score` event. 2. For the event parameter, click the **+ where** button and select `modelId`. 2. As the logical operator, select **Equal**. 3. Enter the ID of the [custom prediction](#create-a-prediction) created in the previous step. 4. Click the **+ and where** button and select `score_label`. 5. As the logical operator, select **Equal**. 6. Type `High`.
The screenshot presents Profile Event node configuration
Profile Event node configuration
2. Confirm by clicking **Apply**. ### Configure the Optimize Time node The time of sending the push message for each customer is adjusted to their `snr.prediction.score` value. 1. Add an **Optimize Time** node. 2. In the configuration of the node: 1. Select the Mobile mode you created as a part of the prerequisites. 2. Select **Next 7 days**. 4. Confirm by clicking **Apply**. ### Configure the Send Mobile Push node 1. Add a **Send Mobile Push** node. 2. In the configuration of the node: 1. In the **Template type**, select the mobile push type according to your business needs. 2. Select proper push template that you created earlier. 3. Confirm by clicking **Apply**. 3. Add the **End** node. 4. In the upper right corner, click **Save & Run**.
The view of Workflow
The final workflow configuration
## Check the use case set up on the Synerise demo workspace --- You can check all configurations directly in Synerise Demo workspace: - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/68d98a1e-54dc-4b42-b5fb-34d223b4e398) of customers who have made transaction in an offline store. - [Expression](https://app.synerise.com/analytics/expressions/ee6d687c-a4d8-4a23-abc3-04474ec6d522) - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/f90c0bd1-634c-4fff-9d9b-2612f97edc18) of customers for whom the prediction is made. - [Prediction](https://app.synerise.com/ai-v2/predictions/generic-scoring/aeqciwzidvgt) - [Workflow](https://app.synerise.com/automations/automation-diagram/29c8cac2-34ca-4e96-b0d7-439a3ade8be9) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`snr.prediction.score`](/docs/assets/events/event-reference/predictions#snrpredictionscore) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`snr.ate.prediction`](/docs/assets/events/event-reference/predictions#snrateprediction) (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Expressions](/docs/crm/expressions) - [Mobile push](/docs/campaign/Mobile/creating-mobile-push) - [Predictions](/docs/ai-hub/predictions) - [Time optimizer](/docs/settings/configuration/time-optimizer) # Find profiles who will buy a specific item In today's fast-paced business landscape, accurate predictions hold the key to informed decision-making and sustainable growth. As companies strive to stay ahead, they understand the pivotal role predictions play in optimizing their strategies. Across industries, there exists a multitude of scenarios where predictions offer a competitive advantage. The nature of these scenarios is diverse and varies according to each company's unique objectives. Synerise simplifies prediction adoption with predefined templates, allowing businesses to swiftly integrate cutting-edge predictions into their strategies without the need for extensive data expertise. These templates span various goals, from reducing churn to predicting buying behavior and lifetime value. In this use case, we focus on predicting buying behavior. Specifically, we'll follow a scenario aimed at finding customers who are willing to buy a specific product. You will discover how to effortlessly harness our templates and align them with your business goals. ## Prerequisites --- - [Enable the "Propensity" prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-propensity-and-best-fit-predictions). - The `itemID` attribute (the unique identifier attribute of an item) must be added to [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes) in the item feed that you want to use for the prediction. - Create the segmentation for which you want to create a prediction. You can also create an entirely new segmentation while creating the prediction. ## Create a prediction using a predefined template --- In this use case, we will use a predefined scenario for the business goal of predicting buying behavior, specifically finding profiles that are willing to buy a certain item. 1. Go to Prediction icon **> New prediction** and select **Use Predefined scenarios**.
Screenshot of two paths for creating predictions
Two paths for creating predictions
### Define the business objective and the scenario you want to follow --- In this part of the process, you need to select the business objective and its corresponding variant. 1. Define the prediction name. 2. On the left side of the screen, from the list of business objectives, select **Predict buying behavior**. 3. Select the **Find profiles who will buy a specific item, brand or category** scenario. 4. Click **Continue**.
Definition of the business objective and specific scenario
Definition of the business objective and specific scenario
### Select an item feed to use as the source of items/item attributes --- 1. Click **+ Choose item feed**. 2. From the drop-down list, select the item feed. 3. Select an item for which you want to create a prediction. In this use case, select the default **Title / ID** option and click the **+ Select item** field. 4. From the list of all items, select the items for which the prediction will be created. 5. Click **Continue**.
Selection of item feed and specific items for prediction
Selection of item feed and specific items for prediction
### Select segmentation --- In this part of the process, you need to select a group of profiles to examine their propensity to buy an item selected in the previous step. 1. Click **+ Select Segmentation**. 2. From the drop-down list, select the segmentation you created earlier as a part of prerequisites. 3. Click **Continue**.
Selection of the segmentation for which the propensity to buy the product will be calculated
Selection of the segmentation for which the propensity to buy the product will be calculated
### Define final settings --- Configure the [additional settings](/docs/ai-hub/predictions/propensity#additional-settings) (or leave them at default) and click **Continue**.
Final setup screen
Final setup screen
### Summary check --- This is the final part of the process, where you can check all the settings configured during the prediction setup. If you want to make any changes, you can go back to the required step using the **Back** button and make the necessary modifications. If no changes are required, click the **Save and Calculate** button.
Prediction summary
Prediction summary
## What's next --- After the calculation is completed, a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction. Based on the `snr.propensity.score` event, you can create segmentations of customers with different propensity and use those segmentations as campaign targets: - [email](/docs/campaign/e-mail) - [SMS](/docs/campaign/SMS) - [web push](/docs/campaign/Webpush) - [mobile push](/docs/campaign/Mobile) - [dynamic content](/docs/campaign/dynamiccontent) - [screen views](/docs/campaign/screen-views) Email, SMS, web push and mobile push can be sent manually or you can launch them by using [Automation Hub](/docs/automation). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [Propensity prediction](https://app.synerise.com/ai-v2/predictions/propensity/ovwcgaomjlwu) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1). ## Read more --- - [Predictions](/docs/ai-hub/predictions) # Price drop alert 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 --- - Implement a [custom event](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent) of adding products to favorites. In this use case, this event is named `product.addToFavorites`. - [Create item catalog](/docs/ai-hub/recommendations-v2/item-feed-requirements) containing information on the actual price of products. - [Create an email template](/docs/campaign/e-mail/creating-email-templates) to be used in the price drop campaign. ## Process --- 1. [Create a product.priceDrop event](/use-cases/price-drop-alert#create-a-productpricedrop-event) 2. [Create an aggregate that collects sku of recently purchased products](/use-cases/price-drop-alert#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](/use-cases/price-drop-alert#create-an-aggregate-that-returns-sku-of-discounted-products-added-to-favorites) 4. [Create an aggregate that collects the latest prices of products added by users to their favorites](/use-cases/price-drop-alert#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](/use-cases/price-drop-alert#create-an-aggregate-that-collects-the-last-skus-of-products-received-by-users-with-a-discounted-price) 6. [Create a workflow](/use-cases/price-drop-alert#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 Modeling Hub icon **Data Modeling Hub > 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 **Data Modeling Hub** and **Decision Hub**. 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 Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 4. Enable **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.
Decision Hub Last Multi aggregate returning the last 100 distinct product.buy SKUs in the last 30 days
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 Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 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 Array**. 10. From the **Choose value** dropdown list, select the aggregate you created in the [previous step](/use-cases/price-drop-alert#create-an-aggregate-that-collects-sku-of-recently-purchased-products). 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.
Decision Hub Last Multi aggregate returning the last 100 product.addToFavorites SKUs excluding already purchased items in the last 30 days
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.
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 Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 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 Array**. 13. From the **Choose value** dropdown list, select the aggregate you created [earlier](/use-cases/price-drop-alert#create-an-aggregate-that-collects-sku-of-recently-purchased-products). 14. Define the period from which the aggregate will collect products from the event to the last **30 days**. 15. Save the aggregate.
Decision Hub Last Multi aggregate returning the last 100 product.addToFavorites prices excluding purchased products in the last 30 days
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 Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 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.
Decision Hub Last Multi aggregate returning the last 100 product.priceDrop SKUs in the last 30 days to exclude already-notified products
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 Hub > 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**. In our case, we are using `product.priceDrop` event. 2. In the **Body** section, use the following jinjava and modify it to your needs:
Jinjava inserted in **Generate event** body must have all empty spaces deleted.
{
  "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 %}"
}
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](/developers/inserts/automation). 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**.
Automation Hub workflow for sending price drop alerts
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](https://app.synerise.com/analytics/aggregates/cf726d37-39af-3a09-bc8b-36953f1a4411) - [Aggregate that collects product sku's added by the users to their favorites](https://app.synerise.com/analytics/aggregates/9d8f2b6d-c9d8-39f5-90f2-c354fd387c28) - [Aggregate that collects the latest prices of products added by users to their favorites](https://app.synerise.com/analytics/aggregates/28e5708e-b957-3b7d-ae3c-09eae2a3e29b) - [Aggregate that counts sku's of products added to favorites by a user](https://app.synerise.com/analytics/aggregates/378c1190-f2fe-3947-b5f8-f131ee782397) - [Workflow](https://app.synerise.com/automations/automation-diagram/580e7865-5649-4edf-a9a5-9aca214bdb5b) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per profile that completes the flow: `product.addToFavorites` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `product.priceDrop` (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Email campaigns](/docs/campaign/e-mail) - [Product feed](/developers/product-feed) - [Reusing event context from preceding nodes](/developers/inserts/automation) - [Segmentation](/docs/analytics/segmentations) # Adding mix of social proof to product pages In today's digital landscape, where the abundance of options and information can be overwhelming, purchasing decisions or content choices often rely on trust and social recommendations. Social proof, plays a pivotal role in shaping online user behavior. It revolves around the notion that individuals are more inclined to trust the actions of others than their own instincts, particularly when those actions are visible and relatable. Social proof is a metric with a dynamic key, thanks to which the statistics on a product page will be displayed in real time and they will adjust to the product that is being currently viewed. This use case will focus on how implementing basic social proof mechanisms centered around various recent events can effectively drive user interactions. We will present you the mechanism of creating basic social proof mix showing three scenarios: - the number of visitors to the product page during last 24 hours, - the number of customers who bought the product during last 24 hours, - the number of customers who added the product to the wishlist during last 24 hours. You can implement all of them (or chosen one) directly to your website thanks to our ready-to-use template.
The view of social proof mix
## Prerequisites --- - Implement a [tracking code](/docs/settings/tool/tracking_codes). - Manage [transaction events](/developers/web/transactions-sdk). ## Process --- To prepare social proof, you have to create dynamic content with a metric, which will dynamically count particular event occurrence for each product. Perform the steps in the following order: 1. [Create a metric counting page views](/use-cases/social-proof-basics#create-metric-for-page-views). 1. [Create a metric counting product purchases](/use-cases/social-proof-basics#create-metric-for-products-bought). 1. [Create metric counting occurrences of adding the product to the wishlist](/use-cases/social-proof-basics#create-metric-for-adding-product-to-the-wishlist). 2. [Prepare a dynamic content](/use-cases/social-proof-basics#prepare-a-dynamic-content). ## Create metric for page views --- If you want to display a message that X customers viewed the product in the last X hours, you have to prepare a metric that counts the occurrences of the [`page.visit` event](/docs/assets/events/event-reference/web-and-app#pagevisit) for a specific product. For that purpose, we will create [a dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - `sku` which will analyze values sent through the `retailer_part_no` parameter of the `page.visit` event. 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **Type**, **Aggregator** and **Occurrence** options at default (**Event**, **Count**, and **All**, respectively). 3. From the **Choose event** dropdown list, select **page.visit**. 4. Click the **+ where** and select the **product:retailer_part_no** parameter or any other which indicates ID of the product. 5. From the **Choose operator** select **Equal**. 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time from which metric counts the page visit, for example last 24 hours.
Screenshot presenting Metric with page visit
Metric counting page visits in the last 24 hours
### Create metric for products bought If you want to display a message that X customers bought the product in the last 24 hours, you have to prepare a metric that counts occurrences of the [product.buy event] for a specific product. For that purpose, we will create [a dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - `sku` which will analyze values sent through the `$sku` parameter of the [`product.buy` event](/docs/assets/events/event-reference/items#productbuy). 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **Type**, **Aggregator** and **Occurrence** options at default (**Event**, **Count**, and **All**, respectively). 3. From the **Choose event** dropdown list, select **product.buy**. 4. Click the **+ where** button and select a parameter that indicates a product ID (in this case, it's **$sku**). 5. From the **Choose operator**, select **Equal**. 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time range for analyzing events (24 hours in our example).
Screenshot presenting Metric filter
Metric counting purchased products in last 24 hours
### Create metric for adding product to the wishlist If you want to display a message that X customers added the product to the wishlist in the last X hours, you have to prepare a metric that counts occurrences of the [`product.addToWishlist` event](/docs/assets/events/event-reference/items#productaddtofavorite) for a specific product. For that purpose, we will create [a dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - `sku` which will analyze values sent through the `$sku` parameter of the `product.addToWishlist` event. 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **Type**, **Aggregator** and **Occurrence** options at default (**Event**, **Count**, and **All**, respectively). 3. From the **Choose event** dropdown list, select **product.addToWishlist**. 4. Click the **+ where** button and select a parameter that indicates a product ID (in this case, it's **$sku**). 5. From the **Choose operator**, select **Equal**. 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time range for analyzing events (24 hours in our example)
Screenshot presenting Metric filter
Metric counting products added to the wishlist in last 24 hours
## Prepare a dynamic content --- To show a social proof on your website, you need to use a dynamic content. You can use the ready-to-use template displayed as an insert on the page of every product which is used in this use case. You can customize the design of the template, adjust the time frame (in the settings of a specific metric), rearrange and modify the content according to your business needs. What is more, you can use dynamic content as a carousel which displays those 3 metrics, but you can also include fewer metric variants.
- When a product meets the conditions of at least one metric, a carousel will be displayed (in the static version). - If a product meets conditions of more than one metric, the carousel will activate and loop to display information from each metric. In this version, up to 3 metrics can be showcased, meaning a maximum of 3 pieces of information will be displayed.
1. Go to **Experience Hub > Dynamic content > Create New**. 2. Choose the **Insert Object** type of campaign. 3. In the **Audience** section, select **Everyone**. 4. In the **Content** section, select **Simple message** and by inserting CSS selector define where the social proof will display on your website. 5. In the **Content** tab, click **Create Message** and go to **Web layer templates** folder. Choose **Social Proof Carousel** template. 6. Customize the template layout according to your needs. In the template configuration, there are three types of variables to edit based on the three metrics created in the previous parts of the process: - Header and metric content - define the title and main information displayed in the social proof such as time period from which metric shows results. In the metric ID field, add the identifier of the metric (which is available on the list of metrics). - Styling settings - you can use them to define the design of the social proof such as text color, background, font size, and others. - Additional carousel settings - these settings let you define carousel speed, switch times, and delay time (given in milliseconds). 7. When your template is ready, save your changes. 6. Schedule when the dynamic content has to be active 8. In the **Display settings**, define the circumstances the dynamic content will be shown: - **Always on landing**, on All pages if in CSS selector is unique selector for a product page. - Always on landing, **on a specific URL** which indicates a product page (for example, if a URL contains product), if CSS selector is not unique for a product page. Read more about [defining url targeting](/docs/campaign/dynamiccontent/creating-dynamic-content/creating-dynamic-content#define-url-targeting). 4. Save and activate the campaign. ## Check the use case set up on the Synerise Demo workspace --- Check all items (metrics and dynamic content) created in this use case in our Synerise Demo workspace: - [Metric that returns the number of visits in last 24 hours](https://app.synerise.com/analytics/metrics/9f3c5d20-dabf-40f4-980b-2c68b5249364), - [Metric that returns the number of times an item was sold in last 24 hours](https://app.synerise.com/analytics/metrics/bca7cdc9-8096-4cd6-a813-e5e978d613f9), - [Metric that returns the number of times a product was added to wishlist](https://app.synerise.com/analytics/metrics/dd0cb02a-6cec-46e4-81a1-62b414a17d74), - [Dynamic content template](https://app.synerise.com/campaigns/dynamic-content/preview/10e783a0-009a-4e06-90fa-557295c75572). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - [Metrics](/docs/analytics/metrics/introduction-to-metrics) # Notify Customers About Order Delays with Automated Emails You can use Synerise to inform customers that their order will be delayed, instead of calling them or waiting until they call and ask about the products they orderd. This use case provides the instructions on the basic implementation of this use case, that is sending an email with information about the delay in delivery of the order. ## Prerequisites --- - Integrate with Synerise JS SDK. - Configure [a sender account](/docs/campaign/e-mail/configuring-email-account). ## Process --- In this use case, you will go through the following steps: 1. [Implement a custom event](/use-cases/automatic-notification-about-delay#implement-a-custom-event). 2. [Prepare an email template](/use-cases/automatic-notification-about-delay#prepare-an-email-template). 3. [Create a workflow](/use-cases/automatic-notification-about-delay#create-a-workflow). ## Implement a custom event --- As the first part of the process, send through API a custom event (for a test user with a test order ID) to Synerise, that signifies the delay of the order delivery. Use [this method](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent). You will need this event in the [further part of the process](/use-cases/automatic-notification-about-delay#create-a-workflow) to select it as a trigger of the workflow. - If you have more than one reason for the order delay, insert them in the parameter. This way, you can prepare an email template for every reason and prepare a workflow that is reason-dependant. - In the event information, add the ID of the order. This way, you can later use it as an [insert](/developers/inserts) in the email template. Example of an event:
{   
"label": "Delay notification",
"action": "order.delayed",
"client": {
        "email": "john.doe@example.com"
    },
    "params": {
        "reason": "info28",
        "orderId": "1988100"
    }
}
## Prepare an email template --- In this part of the process, prepare an email template that includes the information about the order ID. If you have more than one reason for the order delay, prepare template for each reason of delay. Later on, you can prepare workflow for every reason. 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left side of the screen, click **Templates**. 3. Select the wizard. 4. In the content of the message add this insert:
{{ event.params.orderId }}
It will be replaced with the actual ID of the order.
When you use the syntax above, the parameters are retrieved from the event that is in the current context. The context is the most recent Trigger or Event Filter node in the workflow. Learn more about [reusing event context from preceding nodes](/developers/inserts/automation#event-parameters)
5. Adjust the design of the template according to your needs. 6. Save the template. ## Create a workflow --- In this part of the process, prepare a workflow that is triggered by the event that signifies the delay of the delivery. As a result, an email is sent to the customer whose order will be delayed. If you have more than one reason for the order delay, insert them in the parameter. This way, you can prepare workflows for each reason of the delay. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node of the workflow, add **Profile Event**. In the node settings: 1. Select the event you implemented in the first part of the process. 2. As the parameter, select the parameter that signifies the reason of the delay. 3. As the logical operator, select **Equal**. 4. In the text field that appeared, enter the reason of the delay.
Settings of the Profile Event trigger
Settings of the Profile Event trigger
5. Confirm by clicking **Apply**. 4. As the next node, add **Send Email**. In the node settings: 1. In the **Sender details** section, select the sender account from which the email will be sent. Confirm the changes by clicking **Apply**. 2. In the **Content** section, enter the subject of the email (it will display in the recipient's inbox).
In the email subject, you can also put the order number by using an insert, for example `Order information no {{event.params.orderId}}`.
3. Select the template you created in [Prepare an email template](/use-cases/automatic-notification-about-delay#prepare-an-email-template) step. 4. Confirm the settings of the **Content** section by clicking **Apply**. 5. In the **UTM & URL parameters** section, click **Change**. 6. Enter the parameters. 7. Confirm the settings in the **UTM & URL parameters** section by clicking **Apply**. 6. Confirm the settings of the **Send Email** node by clicking **Apply** on the bottom of the pop-up. 5. As the last node, add **End**. 6. Click **Save & Run**.
Automation Hub workflow for sending automatic delay notifications to customers
Final configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the [workflow](https://app.synerise.com/automations/automation-diagram/8faf5493-7126-4763-b2c8-1b0ac644941d) created in this use case. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## What's next --- As an extra step, you can send a discount coupon after a delayed shipment. If the ordered goods cannot be delivered on time for logistical reasons, you can inform customers ahead of time and offer a discount coupon to be applied in future purchases, boosting the loyalty of your customers. ## Generated events This use case generates approximately 7 events per profile that completes the flow: `order.delayed` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Automation Jinjava inserts](/developers/inserts/automation) - [Creating custom events](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent) - [Email templates](/docs/campaign/e-mail/creating-email-templates) # Promote a brand in recommendations You can tweak the results of recommendations by increasing the probability of certain brands appearing in the recommendation frames. Thanks to this, you can offer a brand to promote their items more often than those from their competition. This can be done by using **recommendation boosting** to promote items from those brands. Boosting rules are built using the same editor as the filters, but unlike filtering, boosting does not entirely exclude items that do not meet the conditions - it only tells the AI model to assign more weight to the `brand` parameter when calculating the final recommendation score (relevance to a particular customer) of an item. This is different from the [AI-Powered Personalized Brand Recommendations on Category Pages](/use-cases/personalized-brand-reco) use case, in which the other brands are completely removed from the recommendation. In this use case example, items from two brands will be promoted in the recommendation results. ## Prerequisites --- - **Recommended**: Become familiar with [creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign). This article does not explain every step of creating a recommendation in detail. - The item catalog must include an attribute that denotes the brand; the brands you want to promote must exist in that attribute's values. ## Creating the recommendation --- ### Choose source, type, and add slots 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. In the **Type & Items feed** section: 1. Select an item catalog. 2. Select a recommendation type.
Boosting can be used with all recommendation types.
3. Click **Apply**. 3. In the **Items** section, configure at least one slot and click **Apply**. ### Build the boosting rule In this part of the process, you build a rule that promotes an item if its brand is **XYZ** or **ABC** (brand names in filters are not case-sensitive). 1. In the **Boosting** section, click **Define**. 2. Click **Add rule**. 3. Click **Define rule** and select **Visual Builder**. **Result** The Visual Builder window opens. 4. From the **Select attribute** drop-down list, select the brand attribute. You can use the search field. 5. From the **Operator** drop-down list, select **Equals**. 6. From the **Select value** drop-down list, select **xyz**. 7. Click **Add filter**. 8. Leave the operator between the filters at default (**OR**). 9. Add the filter for brand **abc** by repeating steps 4-6 and selecting **abc** as the value in step 6. 10. Click **Apply**. 11. In the **Promote/Demote** selector, select **Promote** (default value). 12. Use the slider to adjust how much you want the rule to affect the results.
Screenshot of the boosting strength slider
The boosting strength slider
13. Save the **Boosting** section settings by clicking **Apply**.
After applying the settings, you can use the **Preview** tab (available in the upper left part of the recommendation creator screen) to see how your rule changed the recommendation result. If necessary, you can return to the settings and adjust the boosting strength to meet your expectations.
Screenshot of the Visual Builder: a boosting filter that matches one of two brands
A boosting filter that matches one of two brands
### Additional settings and saving 1. Configure the **Additional settings** section and click **Apply**. 2. Save the recommendation. ## What's next --- You can use the ID of the recommendation and [inject it with a snippet](/docs/assets/snippets) in other types of communication, such as: - [dynamic content](/docs/campaign/dynamiccontent) - this way you can show the recommendations on your website. - [email](/docs/campaign/e-mail) - this way you can send out recommended items through emails. - mobile application - you can use [documents](/docs/assets/documents) to build your own mobile app and show the recommended items. - [mobile push](/docs/campaign/Mobile) - you can send recommendations through notifications in your mobile application. - [web push](/docs/campaign/Webpush) - this way you can send notifications to your customers through a web browser. - [SMS](/docs/campaign/SMS) - this way you can reach your customers with recommendations on their mobile. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [Recommendation campaign settings](https://app.synerise.com/ai-v2/recommendations/Bn6BCxXNL2aX) - [Email campaign](https://app.synerise.com/campaigns/create/5a0afcb8-bf8d-46a0-b7e5-a65fd4edd509) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Predictions](/docs/ai-hub/predictions) - [Recommendations](/docs/ai-hub/recommendations-v2) # Call center dashboard Creating a dashboard for call center is a great way for call center epmloyees to monitor day-to-day operations, customer buying history as well as their satisfaction based on various metrics and KPIs. In this use case you will design a dashboard for call center personnel. It will be a reporting tool that shows call center-related analytics so you can monitor, optimize and improve contact with your customers. The goal of the visual presentation is to make analysis simpler by cutting down the time it takes to ingest information from hours to seconds.
Call center dashboard
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) on your website. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Add [custom events](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent) and their [parameters](/docs/assets/events/adding-event-parameters) to save data to customers' profiles when they perform an activity. In this particular use case: - `product.return`, - `callcenter.call`. - Implement [OG tags](/developers/web/og-tags) on your website. ## Process --- In this use case, you will go through the following steps: 1. [Create expressions](#create-expressions) that return the date of transaction, returns and page visit. 2. [Create aggregates](#create-aggregates) for transactions, returns, visits to the website and call center history. 3. [Create metrics](#create-metrics) for bought products, returns, top visited brands, top visited products and queries. 2. [Create reports](#create-reports) for history of bought products, returns, top visited brands, top visited products and history of queries. 3. [Create trends](#create-trends) of history of calls. 4. [Create a dashboard](#create-a-dashboard) that gathers created analyses. 5. [Add the dashboard to customer profiles](#add-the-dashboard-to-customer-profiles).
These are just examples of analytics you can use, such a dashboard can be expanded with various other analytics suitable for your business needs.
## Create expressions --- In this part of the process, create two expressions for the following events: `transaction.charge` and `page.visit`. They will be later used in [aggregates](#create-aggregates) to return dates of specific events. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Set the **Expression for** option to **Event**. 4. From the **Choose event** dropdown list, select `transaction.charge` event. 5. In the **Formula definition** section, click **Select**. 6. From the list that opens, select **Function > Regexp**. 7. In the brackets, click the **Select** button and from the list, select **Event attribute**. 1. Click the **Unnamed** node that appeared. 9. At the bottom of the page, click **Choose parameter**. 10. In the list of attributes, find and select **TIMESTAMP**. 8. Click the next **Select** button in the brackets and from the list, select **Constant**. 1. Click the **0** node that appeared. 2. At the bottom of the page, type `....-..-..` for date format. 9. Save the expression. 10. Create a second expression and repeat all steps for `page.visit` event.
The view of the configuration of the expression returning transaction date
Configuration of the expression returning transaction date
## Create aggregates --- In this part of the process, you will create a number of aggregates on transactions, returns, page visits and call center calls, which will be used in the dashboard in the further part of the process. ### Transactions Create aggregate that:
Returns the date of the first and last transaction made by a customer
  1. Go to Behavioral Data Hub icon Behavioral Data Hub > Live Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Switch the Show in profile card option on.
  5. Click Analyze profiles by and select First to return the date of first transaction.
  6. Click the Choose event dropdown list.
  7. From the dropdown list, select the `transaction.charge` event.
  8. Click choose parameter and search for the expression created in the previous part of the process regarding the chosen event.
  9. Using the date picker in the lower-right corner, set the time range to Lifetime.
  10. Click Apply.
  11. Save the aggregate.
  12. Create a second aggregate and repeat all steps for Last option, to return the date of last transaction.
The view of the configuration of the aggregate returning first transaction date
Configuration of the aggregate returning first transaction date
Returns the last product a customer bought
  1. Go to Behavioral Data Hub icon Behavioral Data Hub > Live Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Switch the Show in profile card option on.
  5. Click Analyze profiles by and select Last to return the name of the last bought product.
  6. Click the Choose event dropdown list.
  7. From the dropdown list, select the `product.buy` event.
  8. Click choose parameter and choose the `$name` parameter.
  9. Using the date picker in the lower-right corner, set the time range to Lifetime.
  10. Click Apply.
  11. Save the aggregate.
The view of the configuration of the aggregate returning the name of the last bought product
Configuration of the aggregate returning last brought product name
Returns last transaction value
  1. Go to Behavioral Data Hub icon Behavioral Data Hub > Live Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Switch the Show in profile card option on.
  5. Click Analyze profiles by and select Last to return the value of the last transaction customer made.
  6. Click the Choose event dropdown list.
  7. From the dropdown list, select the `transaction.charge` event.
  8. Click choose parameter and choose the `$totalAmount` parameter.
  9. Using the date picker in the lower-right corner, set the time range to Lifetime.
  10. Click Apply.
  11. Save the aggregate.
The view of the configuration of the aggregate returning the value of the last transaction made by a customer
Configuration of the aggregate returning customer's last transaction's value
Calculates the number of transactions for a customer
  1. Go to Behavioral Data Hub icon Behavioral Data Hub > Live Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Switch the Show in profile card option on.
  5. Click Analyze profiles by and select Count to return the number of all the transactions customer made.
  6. Click the Choose event dropdown list.
  7. From the dropdown list, select the `transaction.charge` event.
  8. Using the date picker in the lower-right corner, set the time range to Lifetime.
  9. Click Apply.
  10. Save the aggregate.
The view of the configuration of the aggregate returning the number of transactions made by a customer
Configuration of the aggregate returning the number of transactions made by a customer
Calculates the value of all transactions for a customer
  1. Go to Behavioral Data Hub icon Behavioral Data Hub > Live Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Switch the Show in profile card option on.
  5. Click Analyze profiles by and select Sum to return the value of all the transactions customer made.
  6. Click the Choose event dropdown list.
  7. From the dropdown list, select the `transaction.charge` event.
  8. Click choose parameter and choose the `$totalAmount` parameter.
  9. Using the date picker in the lower-right corner, set the time range to Lifetime.
  10. Click Apply.
  11. Save the aggregate.
The view of the configuration of the aggregate returning the value of all transactions made by a customer
Configuration of the aggregate returning the value of all transactions made by a customer
### Returns Create an aggregate that:
Which result is the name of the last returned product
  1. Go to Behavioral Data Hub icon Behavioral Data Hub > Live Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Switch the Show in profile card option on.
  5. Set the Analyze profiles by option to Last to display the last product a customer returned.
  6. Click the Choose event dropdown list.
  7. From the dropdown list, select the `product.return` event.
  8. Click choose parameter and choose the `name` parameter.
  9. Using the date picker in the lower-right corner, set the time range to Custom and set to 90 days.
  10. Click Apply.
  11. Save the aggregate.
The view of the configuration of the aggregate returning the name of the last product customer returned
Configuration of the aggregate returning the name of the last product customer returned
Which result is the price of the last returned product
  1. Go to Behavioral Data Hub icon Behavioral Data Hub > Live Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter a meaningful name of the aggregate.
  4. Switch the Show in profile card option on.
  5. Click Analyze profiles by and select Last to display the price of the last product a customer returned.
  6. Click the Choose event dropdown list.
  7. From the dropdown list, select the `product.return` event.
  8. Click choose parameter and choose the `price` parameter.
  9. Using the date picker in the lower-right corner, set the time range to Custom and set to 90 days or according to your business needs.
  10. Click Apply.
  11. Save the aggregate.
The view of the configuration of the aggregate returning the price of the last product customer returned
Configuration of the aggregate returning the price of the last product customer returned
### Web activities In this part of the process, create an aggregate that returns the date of the first or last visit to the web page. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Switch the **Show in profile card** option on. 3. Click **Analyze profiles by** and select **First** or **Last** to return the date of the first or last date customer visited the web page. 4. Click the **Choose event** dropdown list. 5. From the dropdown list, select the `page.visit` event. 6. Click **choose parameter** and search for the [expression created in the previous part of the process](#create-expressions) regarding the chosen event. 7. Using the date picker in the lower-right corner, set the time range to **Lifetime**. 8. Click **Apply**. 9. Save the aggregate.
The view of the configuration of the aggregate returning the date of the first customer vist to the web page
Configuration of the aggregate returning the date of the first customer vist to the web page
### Contact Center In this part of the process, create aggregate that returns the time of call center calls. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Switch the **Show in profile card** option on. 3. Click **Analyze profiles by** and select **Sum** to return the time of call center calls. 4. Click the **Choose event** dropdown list. 5. From the dropdown list, select the `callcenter.call` event. 6. Click **choose parameter** and choose the `callDuration` parameter. 7. Using the date picker in the lower-right corner, set the time range to **Custom** and set to **30 days** or according to your business needs. 8. Click **Apply**. 9. Save the aggregate.
The view of the configuration of the aggregate returning the duration of calls with call center
Configuration of the aggregate returning duration of calls with call center
## Create metrics --- In this part of the process, you will create five metrics for the following events: `product.buy`, `product.return`, `page.visit` and `item.search`. They will be later used in [reports](#create-reports). ### Number of bought products This metric will return the number of all products bought by a customer. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Sum**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `product.buy`. 6. Click where icon button. **Result**: The **Choose parameter** button appears. 7. From the **Choose parameter** dropdown list, choose `$quantity`. 8. To select a specific time range, click the calendar icon. In our case it will be **Lifetime**. Confirm your choice with the **Apply** button. 9. Click **Save**.
The view of the configuration of the metric returning the number of all bought products
Configuration of the metric returning the number of all bought products
### Number of returned products This metric will return the number of all products returned by a customer. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `product.return`. 6. To select a specific time range, click the calendar icon. In our case it will be **Lifetime**. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the configuration of the metric returning the number of all returned products
Configuration of the metric returning the number of all returned products
### Number of page visits This metric will return the number of all page visits made by a customer. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `page.visit`. 6. To select a specific time range, click the calendar icon. In our case it will be **Lifetime**. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the configuration of the metric returning the number of all page visits
Configuration of the metric returning the number of all page visits
### Number of visited products This metric will return the number of all products visited by a customer. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `page.visit`. 6. Click where icon button. **Result**: The **Choose parameter** button appears. 7. From the **Choose parameter** dropdown list, choose `product:retailer_part_no`. 5. From the **Choose operator** dropdown list, select **String** and **Is not empty**. 6. Using the date picker in the lower-right corner, set the time range to **Lifetime**. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the configuration of the metric returning the number of all page visits
Configuration of the metric returning the number of all page visits
### Number of searched items This metric will return the number of all products searched by a customer. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `item.search`. 6. Using the date picker in the lower-right corner, set the time range to **Custom** and set to **30 days** or according to your business needs. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the configuration of the metric returning the number of all item.search events
Configuration of the metric returning the number of all item.search events
## Create reports --- In this part of the process, you will create reports on transactions, returns and web activities which will be used in the dashboard in the further part of the process. ### History of bought products This report will return the name of all products bought by a customer and the time of their purchase. 1. Go to Decision Hub icon **Decision Hub > Reports > New report**. 2. Enter a meaningful name of the report. 3. Click the **Choose metric** and from the dropdown list, select [a metric for number of bought products, created in the previous part of the process](#number-of-bought-products). 4. From the **Range** dropdown list, select the number of top (the most frequently bought) products to be shown in the preview of the report. In this case it will be **TOP 5** products. 5. In the **Dimension** section, from the dropdown list, select **Event > Parameters**. To be able to show products name in the report, choose `$name`. 6. Click **Add dimension**. 1. Click **Choose dimension** and from the dropdown list, select **Event > Specials**. To be able to show when the product wast bought, choose `TIMESTAMP`. 8. Click **Enable filter**. 1. Click **Choose filter** and from the dropdown list, select **CLIENT_ID**. 2. Click **Choose operator** and from the dropdown list, select **Equal (String)**. 3. Change the type of value by clicking the icon until you get Dynamic key icon. 3. In the first field, write `clientId` and in the second field enter `.` 4. Click **Apply**.
The view of the configuration of the filter in report
Configuration of the filter in report
8. Using the date picker in the lower-right corner, set the time range to **Custom** and set to **90 days** or according to your business needs. Confirm your choice with the **Apply** button. 9. Save the report.
The view of the configuration of the report returning the name and the price of top 5 products bought by a customer
Configuration of the report returning the name and the price of top 5 products bought by a customer
### History of returned products This report will return the name of all products returned by a customer, their price and the time of return. 1. Go to Decision Hub icon **Decision Hub > Reports > New report**. 2. Enter a meaningful name of the report. 3. Click the **Choose metric** and from the dropdown list, select [a metric for number of returned products, created in the previous part of the process](#number-of-returned-products). 4. From the **Range** dropdown list, select the number of top (the most frequently returned) products to be shown in the preview of the report. In this case, it will be **TOP 3** products. 5. In the **Dimension** section, from the dropdown list, select **Event > Parameters**. To be able to show products name in the report, choose `name`. 6. Click **Add dimension**. 1. Click **Choose dimension** and from the dropdown list, select **Event > Parameters**. To be able to show what the product price is, choose `price`. 6. Click **Add dimension**. 1. Click **Choose dimension** and from the dropdown list, select **Event > Specials**. To be able to show when the product was returned, choose `TIMESTAMP`. 8. Click **Enable filter**. 1. Click **Choose filter** and from the dropdown list, select **CLIENT_ID**. 2. Click **Choose operator** and from the dropdown list, select **Equal (String)**. 3. Change the type of value by clicking the icon until you get Dynamic key icon. 3. In the first field, write `clientId` and in the second field enter `.` 4. Click **Apply**. 8. Using the date picker in the lower-right corner, set the time range to **Custom** and set to **90 days** or according to your business needs. Confirm your choice with the **Apply** button. 9. Save the report.
The view of the configuration of the report returning the name, price and time of return for top 3 products returned by a customer
Configuration of the report returning the name, price and time of return for top 3 products returned by a customer
### Top visited brands This report will return the name of the most frequently visited brands by a customer and the number of visits. 1. Go to Decision Hub icon **Decision Hub > Reports > New report**. 2. Enter a meaningful name of the report. 3. Click the **Choose metric** and from the dropdown list, select [a metric for number of all page visits, created in the previous step](#number-of-page-visits) 4. From the **Range** dropdown list, select the number of top (the most frequently viewed) products to be shown in the preview of the report. In this case it will be **TOP 5** products. 5. In the **Dimension** section, from the dropdown list select **Event > Parameters**. To be able to show product's brand in the report, choose `brand`. 8. Click **Enable filter**. 1. Click **Choose filter** and from the dropdown list, select **CLIENT_ID**. 2. Click **Choose operator** and from the dropdown list, select **Equal (String)**. 3. Change the type of value by clicking the icon until you get Dynamic key icon. 3. In the first field, write `clientId` and in the second field, enter `.` 4. Click **Apply**. 8. Using the date picker in the lower-right corner, set the time range to **Custom** and set to **30 days** or according to your business needs. Confirm your choice with the **Apply** button. 9. Save the report.
The view of the configuration of the report returning the top 5 product brands visited by a customer
Configuration of the report returning the top 5 product brands visited by a customer
### Top visited products This report will return the name of most visited products by a customer, their price, and the number of visits. 1. Go to Decision Hub icon **Decision Hub > Reports > New report**. 2. Enter a meaningful name of the report. 3. Click the **Choose metric** and from the dropdown list, select [a metric for number of all visited products, created in the previous step](#number-of-visited-products) 4. From the **Range** dropdown list, select the number of top (the most frequently visited) products to be shown in the preview of the report. In this case, it will be **TOP 5** products. 5. In the **Dimension** section, from the dropdown list, select **Event > Parameters**. To be able to show products name in the report, choose `title`. 6. 6. Click **Add dimension**. 1. Click **Choose dimension** and from the dropdown list, select **Event > Parameters**. To be able to show the product's price, choose `price`. 8. Click **Enable filter**. 1. Click **Choose filter** and from the dropdown list, select **CLIENT_ID**. 2. Click **Choose operator** and from the dropdown list, select **Equal (String)**. 3. Change the type of value by clicking the icon until you get Dynamic key icon. 3. In the first field, write `clientId` and in the second field, enter `.` 4. Click **Apply**. 8. Using the date picker in the lower-right corner, set the time range to **Custom** and set to **30 days** or according to your business needs. Confirm your choice with the **Apply** button. 9. Save the report.
The view of the configuration of the report returning the top 5 products visited by a customer
Configuration of the report returning the top 5 products visited by a customer
### Searched queries This report will return the name of the most frequently searched queries by a customer and the number of searches. 1. Go to Decision Hub icon **Decision Hub > Reports > New report**. 2. Enter a meaningful name of the report. 3. Click the **Choose metric** and from the dropdown list, select [a metric for number of all searched items, created in the previous step](#number-of-searched-items) 4. From the **Range** dropdown list, select the number of top (the most frequently searched) phrases to be shown in the preview of the report. In this case, it will be **TOP 10**. 5. In the **Dimension** section, from the dropdown list, select **Event > Parameters**. To be able to show the searched query in the report, choose `query`. 8. Click **Enable filter**. 1. Click **Choose filter** and from the dropdown list, select **CLIENT_ID**. 2. Click **Choose operator** and from the dropdown list, select **Equal (String)**. 3. Change the type of value by clicking the icon until you get Dynamic key icon. 3. In the first field, write `clientId` and in the second field, enter `.` 4. Click **Apply**. 8. Using the date picker in the lower-right corner, set the time range to **Custom** and set to **30 days** or according to your business needs. Confirm your choice with the **Apply** button. 9. Save the report.
The view of the configuration of the report returning the top 10 most searched queries
Configuration of the report returning the top 10 most searched queries
## Create trends --- In this part of the process, you will create trends on history of page visits and call center calls. ### Visits on the website This trend will show number of customer visits to the webiste over a specific time frame. 1. Go to Decision Hub icon **Decision Hub > Trends > New trends**. 2. Enter a meaningful name of the trend. 3. Click the **Choose event** button and from the dropdown list, select `page.visit`. 8. Click **Enable filter**. 1. Click **Choose filter** and from the dropdown list, select **CLIENT_ID**. 2. Click **Choose operator** and from the dropdown list, select **Equal (String)**. 3. Change the type of value by clicking the icon until you get Dynamic key icon. 3. In the first field, write `clientId` and in the second field, enter `.` 4. Click **Apply**. 9. Set the **Interval** in the lower-right conrer to **day**. 8. Using the date picker in the lower-right corner, set the time range to **Last 7 days** or according to your business needs. Confirm your choice with the **Apply** button. 9. Save the trend.
The view of the configuration of the trend of page visits in the last 7 days
Configuration of the trend of page visits in the last 7 days
### History of calls This trend will show the number of customer call center calls over a specific time frame. 1. Go to Decision Hub icon **Decision Hub > Trends > New trends**. 2. Enter a meaningful name of the trend. 3. Click the **Choose event** and from the dropdown list, select `callcenter.call`. 8. Click **Enable filter**. 1. Click **Choose filter** and from the dropdown list, select **CLIENT_ID**. 2. Click **Choose operator** and from the dropdown list, select **Equal (String)**. 3. Change the type of value by clicking the icon until you get Dynamic key icon. 3. In the first field write `clientId` and in the second field enter `.` 4. Click **Apply**. 9. Set the **Interval** in the lower-right conrer to **day**. 8. Using the date picker in the lower-right corner, set the time range to **Last 7 days** or according to your business needs. Confirm your choice with the **Apply** button. 9. Save the trend.
The view of the configuration of the trend of call center calls in the last 7 days
Configuration of the trend of call center calls in the last 7 days
## Create a dashboard --- In the final part of the process you will create a dashboard with [aggregates](#create-aggregates), [reports](#create-reports) and [trends](#create-trends) created in previous steps. 1. Go to Decision Hub icon **Decision Hub > Dashboards > Add dashboard**. 2. Enter the name of the dashboard. 3. To add a widget to the dashboard, click an icon on the The panel of analysis icons panel. The icons are (left to right): HTML code, text field, image, [segmentation](/docs/analytics/segmentations/creating-segmentations), [trend](/docs/analytics/trends/creating-trends), [funnel](/docs/analytics/funnels/creating-funnels), [metric](/docs/analytics/metrics/creating-simple-metrics), [histogram](/docs/analytics/histograms/creating-histograms), [aggregate](/docs/crm/aggregates/creating-profile-aggregates), [expression](/docs/crm/expressions), and a [report](/docs/analytics/reports/creating-reports).
You can create the dashboard by grouping the created analytics in sections: Transactions, Returns, Web Activities, Call Center. You can create custom template according to your business needs with the help of this [article](/docs/analytics/analytics-dashboard/creating-dashboards) or follow the sample instructions below.
4. Click the Text icon on the panel. **Result**: A **Text widget** will appear on the blank dashboard. 2. You can edit widget contents with the editor on the right. In the **Title** field type `Transactions`, you can add a **Description** below.
You can adjust the size of widgest by dragging their lower right corner.
The view of the configuration of the text widget on the dashboard
Configuration of the text widget
3. Add an aggregate by clicking the Aggregate icon on the panel. 4. Edit widgets contents with the editor on the right. In the **Aggregate** section choose the [aggregate that returns the date of the first transaction made by customer you have created in the previous part of the process](#transactions). You can change the title and description. Do the same for the following [aggregates created in the previous part of the process](#transactions): the date of the last transaction, last bought product, last transaction value, number of transactions, value of all transactions.
The view of the configuration of the text aggregate on the dashboard
Configuration of the aggregate widget
5. Add a report by clicking the Report icon on the panel. 6. Edit widgets contents with the editor on the right. In the **Report** section choose the [report on history of bought products you have created in the previous part of the process](#history-of-bought-products). You can change the title and description. 7. Click the **Style** section in the widget editor and change **Visualization type** to **Table**.
The view of the configuration of the report widget on the dashboard
Configuration of the report widget
8. Repeat steps **4 to 10** to create another sections: Returns, Web activities and Call Center.
You can look up the sample dashboard created in the Demo workspace [here](https://app.synerise.com/analytics/dashboards/33651c9f-666e-4a48-aa6d-7dc1cfd0d9f8/edit?clientId=0)
11. When you complete creating the dashboard, click **Save dashboard**.
By default, a new dashboard is private. If you want to share it with others, check the instruction [here](/docs/analytics/analytics-dashboard/sharing-dashboards).
## Add the dashboard to customer profiles --- Optionally, you can add the dashboard to customer profiles.
You can add a dashboard with dynamic data to a customer’s profile, only if at least one analysis inside the dashboard includes a dynamic key. To be able to display statistics about an individual customer, a dashboard must contain at least one analysis that uses the dynamic key - `clientId`. Aggregates and expressions don’t need `clientId` because they already contain it.
1. Go to Behavioral Data Hub icon **Profiles** and select a customer on the list. 2. On the top of the activity list, click **Statistics**. **Result**: A set of statistics appears. 4. On the top of statistics, click the Three-dot icon icon. **Result**: A dropdown list appears. 5. Select **Manage dashboards**. **Result**: A pop up appears. 6. On the top of the pop-up, click **Add dashboard**. **Result**: A dropdown list appears. 7. From the dropdown list, select a dashboard. 8. To confirm your choice, click **Add**. **Result**: The dashboard appears on the bottom of the list. 9. To manage the order of the dashboards added to the customer's profile, drag and drop them in the preferred order. 10. To save the changes, click **Apply**. ## Check the use case set up on the Synerise Demo workspace --- You can check all configurations directly in Synerise Demo workspace: - Expressions - [Transaction date](https://app.synerise.com/analytics/expressions/0d844720-6bb7-4776-a661-52cc81577b06) - [Page visit date](https://app.synerise.com/analytics/expressions/d31828b7-ef9c-4c7d-8316-3769eb8612c2) - Aggregates - [First transaction date](https://app.synerise.com/analytics/aggregates/7380e558-3d44-30b7-ac26-b1e233e9b16e) - [Last transaction date](https://app.synerise.com/analytics/aggregates/d6baacd7-684e-31f6-b3c4-76376090c061) - [Last bought product name](https://app.synerise.com/analytics/aggregates/ccbd08cc-1cd0-3b44-bc39-eb2dcd0998e5) - [Last transaction value](https://app.synerise.com/analytics/aggregates/8a459dea-e2e7-3c99-8e9b-1b7e12f850e0) - [Number of transactions](https://app.synerise.com/analytics/aggregates/24011aa2-632d-319f-9047-8f13712105c8) - [Sum of all transactions](https://app.synerise.com/analytics/aggregates/55cf86a5-acd9-3540-8293-13737a495300) - [Last returned product name](https://app.synerise.com/analytics/aggregates/d36783fa-382d-3141-8537-9c70ff53ba97) - [Last returned product price](https://app.synerise.com/analytics/aggregates/2aee5c1f-2cbc-3961-9d07-cc15ef8550e1) - [First page visit date](https://app.synerise.com/analytics/aggregates/b75f9b8f-01b8-3733-80cf-b31a35c46da7) - [Last page visit date](https://app.synerise.com/analytics/aggregates/3ff1c746-488c-3f4f-b0ef-2ca09f0b593a) - [Call center calls duration](https://app.synerise.com/analytics/aggregates/36bf88a6-e646-36cd-957e-a87c5f32a11e) - Metrics - [Bought products](https://app.synerise.com/analytics/metrics/077074e8-db7c-4e46-bd2e-24e292bee839) - [Returned products](https://app.synerise.com/analytics/metrics/5772cbe8-5cef-4659-b049-383747f4a355) - [Product page visits](https://app.synerise.com/analytics/metrics/ec561bb7-8227-4f56-9d9c-6979437fed51) - [Page visits](https://app.synerise.com/analytics/metrics/4afbcbc7-ab8f-4bc9-8b73-2547b2dfeee2) - [Number of searched items](https://app.synerise.com/analytics/metrics/e40f03f4-58d3-4156-9a41-776b3b2c2b24) - Reports - [History of bought products](https://app.synerise.com/analytics/reports/08639f32-0d6c-4b4b-a78e-4eec7a8d00cb) - [History of returned products](https://app.synerise.com/analytics/reports/9e92b281-ef93-4cfb-9fd0-916334ef8df9) - [Top visited brands](https://app.synerise.com/analytics/reports/2de0ad6c-3fb4-434f-8de9-1bf6b6528504) - [Top searched queries](https://app.synerise.com/analytics/reports/1c09d8b2-fdfe-465a-b030-78f3593860e9) - Trends - [Page visits](https://app.synerise.com/analytics/trends/1bfa16b9-9518-4c1a-af12-9c4671048800) - [Call center calls](https://app.synerise.com/analytics/trends/d813b0ae-aa02-4cb1-929b-de75fdbb46ac) - [Dashboard](https://app.synerise.com/analytics/dashboards/33651c9f-666e-4a48-aa6d-7dc1cfd0d9f8?clientId=0) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dashboards](/docs/analytics/analytics-dashboard) - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) - [Behavioral Data Hub](/docs/crm) - [Reports](/docs/analytics/reports) - [Trends](/docs/analytics/trends) # Discount for a product complementary to the product viewed Personalized discount coupons can be an effective incentive to buy a product. They are a great tool that businesses frequently use successfully, helping them find new customers and **encouraging more sales.** Properly directed, coupons can meet the client's needs and at the same time direct them towards the purchase of a specific type of product or brand. ## Example of use - Home appliances industry **Challenge** A customer from the electronics and home appliances industry decided to encourage customers to buy equipment from a certain brand. To start the promotion, the client prepared a discount coupon for a product complementary to another item from the same brand. The offer was personalized and addressed to users interested in buying this type of equipment. A customer who viewed various home projectors received after 5 minutes an email with a discount coupon for an electric screen with the purchase a projector of a given brand. The rebate code was valid during shopping in the online store and to use it the customer just had to enter the code in the appropriate place when making purchase. ![Screenshot presenting discount for complementary product](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/discount-for-complementary-product.png) ## Prerequisites --- - Synerise web SDK implemented. - [OG tags](/developers/web/og-tags) implemented. - Import of [code pool](/docs/assets/code-pools) from which the discount codes will be taken. - Email account [configuration](/docs/campaign/e-mail/configuring-email-account). ## Process --- 1. Create an [email template](/use-cases/discount-for-complementary-product#create-an-email-template-with-code-pools) with code pools. 2. Create a [workflow](/use-cases/discount-for-complementary-product#create-a-workflow). ## Create an email template with code pools --- 1. Go to **Experience Hub > Email**. 2. Prepare an email template that will be sent to the client and place the code in Jinjava in it, which will be responsible for collecting the coupon from the pool. 3. Select the appropriate code pool from the snippets in email creator. 4. **Save** your template. ## Create a workflow --- Prepare the automation that will start on the event of visiting the page with the given type of product and will send the email with discount code after specific delay. 1. Go to **Automation Hub > Workflows**. 2. Choose **Profile Event** as a trigger. 3. Choose event `page.visit` and define the pages with the given type of products. 4. After visiting the product page there should be an appropriate delay. 4. Add action node - sending an email with a discount code, created in previous step. 5. Add end node and **save** your workflow.
`Screenshot presenting Automation`
Automation
## Check the workflow set up on the Synerise demo workspace --- Check the [workflow](https://app.synerise.com/automations/automation-diagram/27716cf5-2b10-4182-893e-9b1d8666cba8) settings directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Automation](/docs/assets/code-pools) - [Creating email templates](/docs/campaign/e-mail/creating-email-templates) - [Snippets](/docs/assets/snippets) - [OG tags](/developers/web/og-tags) # Email with discounted product recommendations The best way to improve your sales results are personalized recommendations. They are much more effective than simply offering bestsellers or popular products. Each of us has different tastes. Taking into account the user's previous visits to the website and previously viewed products is much easier if we use **AI algorithms.** There are many examples where these recommendations can be applied, including emails informing customers about a discount in the online store. Showing personalized products can increase engagement, click rates and conversions. ## Example of use - Retail industry **Challenge** A customer from the footwear industry decided to supplement their standard newsletter informing customers about a sale with personalized recommendations, e.g. products selected by AI for each user individually based on their previous activities.
Screenshot presenting email with discounted product recommendations
Email with discounted product recommendations
They completed the recommendations with the key filter for this communication - the **customer could only receive discounted products** in the message, so that it would be connected with the main message about the discount, which could shorten the customer's path to buying products covered by the promotion. ## Results Results from this use case: - OR 14,53% - CTR 2,18% - Conversion rate (transaction from AI Recommendation to clicks) 0,8% ## Prerequisites --- - [Tracking code](/docs/settings/tool/tracking_codes) implemented on your website. - [Product feed](/developers/product-feed) which: - will have price and sale price attributes, - or will have special attribute which labels the products on sale. - [Email account](/docs/campaign/e-mail/configuring-email-account) configured. - [Subscriber’s database](/docs/automation/actions/synerise-integrations/import-customers) implemented. ## Process --- To prepare an email with discounted product recommendations, perform the following steps: 1. [Prepare an AI Recommendation](/use-cases/email-discount-personalized#prepare-an-ai-recommendation). 2. [Prepare an HTML email template](/use-cases/email-discount-personalized#prepare-an-html-email-template) and set up the email communication. ## Prepare an AI Recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the **name** of the recommendation (it is only visible on the list of recommendation).
If you have a dedicated attribute in the feed that tags only available products, **go to additional attributes**, select it from the list and indicate its value.
`Screenshot presenting attributes`
Attributes
3. In the **Type & Items feed** section, click **Define**. 4. From the Catalog dropdown list, select a **trained product feed**. 5. Select the recommendation type. If the recommendations are greyed out, it means the AI engine is not trained yet. 6. Confirm the settings by clicking Apply. ## Prepare an HTML email template --- Prepare and HTML email template in which, using Jinjava, you can add the previously prepared AI Recommendation. 1. Go to **Experience Hub > Email**. 2. Click Email template icon. 3. Create email templates in CSS and HTML by selecting the **Code editor**. 4. Click the **Insert** you want to add to the email. As a result, a field with the Jinjava code appears. 5. To copy the code to the clipboard, click the icon on the right side of the field.
Check the jinja code
{% recommendations3 campaignId=yYr1om9rS8H1 %} {% for p in recommended_products3 %} <td style="width: 146px;text-align: center;padding: 0 2px;" data-snr-ai-product-id="{{ p.productRetailerPartNo }}"> <a style="width: 150px;color: #3b4652;text-decoration: none;font-family: Arial;" class="snrs-AI--item-link" href="{{ p.link }}" title="{{ p.title }}"> <img src="{{ p.image_link }}" class="products-slider__item-image snrAI-product-image snrAI-product-image-{{p.productRetailerPartNo}}" width="90" alt="{{ p.title }}" id="snrAI-image-{{ p.productRetailerPartNo }}" /> <h3 class="snrs-AI-product--product-name"> <span class="snrs-AI-product--name-first">{{ p.title }}</span> </h3> </a> </td> {% endfor %} {% endrecommendations3 %}
6. Prepare an HTML email template 7. Add the title of the email. 8. In the **Schedule tab**, decide when your email is sent. 9. In the UTM & URL parameters section, add the parameters to track the email performance. 10. Send tests of your message to verify if the content of the email is displayed correctly.
Screenshot with final setings
Set up settings page
Test message can only be sent when it has a title. More information about creating emails you will find in this [article.](/docs/campaign/e-mail/creating-email-campaigns)
## Check the use case set up on the Synerise Demo workspace --- Check the [AI campaign](https://app.synerise.com/ai-v2/recommendations/yYr1om9rS8H1) in Synerise Demo workspace. Email campaign settings you can find [here](https://app.synerise.com/campaigns/create/561efe4f-edbf-46ff-ab6b-188bf8270e29). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating emails](/docs/campaign/e-mail/creating-email-campaigns) - [Jinjava inserts](/developers/inserts/insert-usage) - [Personalized recommendations](/docs/ai-hub/recommendations-v2/recommendation-types#personalized) - [Segmentation](/docs/analytics/segmentations/creating-segmentations) # AI Search based on FAQ AI Search implemented on your website can be useful not only in searching for products and offers but also in your FAQ site. This way of using a search engine can help your customers find the answers they need in a more effective way and it also can improve your customer service. By having search on your FAQ website, you can provide your customers with the answers they need in a more timely manner. This can help reduce the number of customer service inquiries you receive, as well as the amount of time your customer service team spends on each inquiry. This use case describes an implementation of a search engine whose source of data is a catalog with a CSV file that contains questions, answers, and categories. This way, when a user types a question, the search results display the categories which contain the answer to the question as well as questions. The search engine is enriched with an auto-complete option which is based on the dynamic content campaign.
This use case contains ready to use code for the dynamic campaign that allows you to launch your own search engine with autocomplete option
FAQ Search Synerise
## Prerequisites --- - Implement [Synerise JS SDK](/developers/web) on your website - especially on the page on which you add the FAQ. - Implement FAQ subpage on your website. - Create a CSV file with questions with the following columns: - `itemId` - column that contains unique identifiers - `Category` - column that contains the name of the category of the question - `linkToCategory` - column that contains the link to the question category - `question` - column that contains a frequently asked question - `linkToQuestion` - column that contains the link to the question - `answer` - column that contains the answer to the question
Names of the columns are exemplary. You can use your own column names. However, itemId, category of the question and its link, and answers with the links are required.
## Process --- In this use case, you will go through the following steps: 1. [Create a catalog](/use-cases/faq-search#create-a-catalog) and import there your CSV file with questions and answers. 2. [Configure AI engine](/use-cases/faq-search#configure-ai-engine) based on the catalog created in the previous step. 3. [Create an index](/use-cases/faq-search#create-an-index). 3. [Create dynamic content campaign](/use-cases/faq-search#create-dynamic-content-campaign) with the implementation of FAQ search. ## Create a catalog --- In this part of the process, you create a catalog and import there your [CSV file](/use-cases/faq-search#prerequisites) prepared as a part of prerequisites. 1. Go to **Data Modeling Hub > Catalogs > New Catalog**. 2. Enter the name of the catalog and confirm it by clicking **Apply**.
Don't use diacritical letters and spaces.
3. Click the catalog on the list and click **import CSV**. If you prepared a CSV file in Excel, open it in a text editor to check whether commas are used as separators. If not, replace them with commas. 4. Click **Upload file** button and select the file to be uploaded, then confirm with the **OK** button. 5. In the **Order key** field, type the name of the column whose values are treated as the key. In this case it will be `itemId`. 6. Complete the process by clicking **Import**. ## Configure AI Engine --- In this part of the process, create and configure feed for AI engine based on the catalog created [earlier](/use-cases/faq-search#create-a-catalog). 1. Go to **Settings > AI engine configuration**. 2. Click **Add feed**. **Result**: A pop-up appears. 3. Select the product feed you want to use. In this case select **Catalog**. 4. On the pop-up, as the type of catalog, select **Data catalog**. 5. From the dropdown list, select a catalog created in the [previous step](/use-cases/ai-search-store-location#create-a-catalog). 6. Confirm by clicking **Apply**. 7. On the list of feeds, click the feed created earlier. 8. In the **Applied search engines** tab, click **Show**. 9. Switch the **Search engines** toggle on. 10. Confirm by clicking **Apply**. 11. Click **Save**.
Launching Search Engine
Launching Search Engine
## Create an index --- In this step, you configure an index for AI search and its settings. Later, this index will be used during the implementation of the search - in the application or on the website. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Click **Add index**. **Result:** The index creation screen opens. 4. From the **Choose feed** dropdown list, select a catalog that contains an item feed based on which you would like to create an index. 5. From the **Choose search language** dropdown, select the language of your search engine. 7. Click **Next step**. 6. Choose **Search Method**. 9. **Add searchable attributes**. Searchable attributes are used by the search engine to calculate the item’s relevance to the query phrase provided by the customer. Attributes can be assigned to three importance levels: high, medium and low. When a word from the phrase matches an attribute, the score amount is assigned depending on importance assigned to the attribute. 6. Optionally, to display unavailable items in the search results, enable the **Include out of stock items** option. 7. Click **Next step**.
The view of creating new index
New index configuration
8. Optionally, you can select item attributes which will be used as response, filterable, facetable, and sortable attributes. 9. In the Item ranking section, define the criteria for sorting items in search results. 14. Click **Finish**. Your index is configured, now you can use the **Preview** tab to test if the results meet your expectations.
The preview of the index
The preview of the index
## Create dynamic content campaign --- In this step, create a dynamic content campaign which will let you to display FAQ search with additional autocomplete option. 1. Go to **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 1. Choose **Insert Object** type. 2. As the audience, select **everyone**. 3. In the **Content** section, select **Simple message**, and specify the CSS selector where you want to insert your search. 4. In the **Content** tab, click **Create Message**. 5. In the code editor, insert the ready-to-use basic code prepared below. 6. Style the code according to your design preferences using HTML, CSS and JS sections.
The CSS and HTML code snippets shown below can be directly copied into your dynamic content campaign. In the JS code snippet, you need to replace: index, token, value from your index and values from response of your index. All places which require change are marked directly in the code.
HTML
<form class="search-form"> <input type="text" placeholder="Search..." class="input" id="searchfaq" autocomplete="off"> <div class="search-button" id="search-button"> <span class="search-svg" id="search-svg"> </span> </div> </form> <div id="results" class="results" style="display:none"> <ul id="result_filters" class="result filters"> <li> <a tabindex="1"> <p style="margin:0px;font-weight:bold">Category:</p> <div class="filterPills"></div> </a> </li> </ul> <ul id="result_articles" class="result articles"></ul> </div>
CSS
.result { max-height: 485px !important; height: auto !important; } .result { position: unset; left: 0; top: unset; } .result a { text-align: left } .results { position: absolute; left: 0; top: 100%; width: 100%; } #result_filters a { justify-items: center;display: flex;align-items: center; } .filterPills { justify-items: center;display: flex;align-items: center; overflow-x: hidden; height: 100%; padding: 4px 0px; } .filterPill input[type="checkbox"]:checked+label { background: #0b68ff; color: white; border: 1px solid #0b68ff; } .filterPill{white-space: nowrap;} .filterPill label { margin: 0px 3px; background: white; border-radius: 50px; border: 1px solid #dbe0e3; color: #6a7580; font-weight: 500; flex: 0 0 70px; height: 25px; transition: all .3s ease; text-align: center; width: 100%; padding: 0px 8px 2px 8px; cursor: pointer; font-size: 12px; } .search-form{ width: 500px; margin: auto; }
JS
var searchApp = (function () { var _filters = { category: [] }; var _clear = null; var _query = null; function init() { document.querySelector('#searchfaq').addEventListener('input', returnedFunction); document.querySelector('.search-form').addEventListener('submit', function (e) { e.preventDefault() }); document.querySelector('#searchfaq').addEventListener('blur', function () { setTimeout(function () { if (document.querySelector('#searchfaq') != document.activeElement) { document.querySelector('#results').style.display = 'none'; } }, 150) }); document.querySelector('#searchfaq').addEventListener('focus', function () { if (document.querySelector('.filterPill')) { document.querySelector('#results').style.display = 'block'; } else { } }); }; var returnedFunction = debounce(function () { _clear = true; _query = document.querySelector('#searchfaq').value; getQuery(_query); }, 300); function getQuery(query) { var xhttp = new XMLHttpRequest(); if (_clear) { _filters.category = []; } // change index and token for those in your profile var url = 'https://api.synerise.com/search/v2/indices/24248c7557155c3e783d00a522649d4c1667544086/autocomplete'; var params = '?query=' + query + '&includeFacets=unfiltered&facets=*&clientUUID=' + SyneriseTC.uuid + '&limit=4&token=FEE539C0-D206-A685-88F8-0E433FCDFD1D' + '&filters=' + getFilters().filters; xhttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { var _response = JSON.parse(this.response); if (_response.data.length > 0) { document.querySelector('#searchfaq').style.border = '0px'; document.querySelector('#results').style.display = 'block'; if (_clear) { setFilters(_response); } setAuto(_response, query, _response.correlationId); document.querySelector('#results').style.display = 'block'; } else { document.querySelector('#searchfaq').style.border = '2px solid rgb(255 0 0 / 56%)'; } } }; xhttp.open('GET', (url + params), true); if (_query.trim() != "") { xhttp.send(); } else { document.querySelector('#search').style.border = '2px solid rgb(255 0 0 / 56%)'; } }; function getFilters() { var categoryFilter = _filters.category.join('OR'); var availabilityFilter = '(availability==true)'; var mergedFilters = availabilityFilter + (categoryFilter ? 'AND(' + categoryFilter + ')' : ''); return { filters: mergedFilters } }; function getQueryWithTimeout(option) { _clear = false; setTimeout(function () { getQuery(_query); }, 300) }; function arrayRemove(arr, value) { return arr.filter(function (elemen) { return elemen != value; }); }; function setsetCategories2Logic() { var _checkboxes = document.querySelectorAll('[type="checkbox"][name="category_lvl_1"]'); [].forEach.call(_checkboxes, function (checkbox) { checkbox.addEventListener('change', function (item) { document.querySelector('#searchfaq').focus(); var filter = 'category_lvl_1' + '=="' + item.target.value + '"'; if (item.target.checked) { _filters.category.push(filter); } else { _filters.category = arrayRemove(_filters.category, filter); } getQueryWithTimeout(); }) }); }; function setFilters(response) { // change response.extras.allFacets.Category for value from your index var _category = Object.keys(response.extras.allFacets.Category); document.querySelector('.result.filters .filterPills').innerHTML = ''; [].forEach.call(_category, function (category, index) { document.querySelector('.result.filters .filterPills').innerHTML = document.querySelector('.result.filters .filterPills').innerHTML + '<div class="filterPill"><input id="category_' + category + '" type="checkbox" name="category_lvl_1" hidden="" value="' + category + '"><label for="category_' + category + '">' + category + '</label></div>' }); setsetCategories2Logic(); }; function setAuto(response, query, correlationId) { var _products = response.data document.querySelector('.result.articles').innerHTML = ''; // change product.linkToQuestion, product.title and product.Category for values from response of your index [].forEach.call(_products, function (product, index) { document.querySelector('.result.articles').innerHTML = document.querySelector('.result.articles').innerHTML + '<li>' + '<a href="' + product.linkToQuestion + '?demoAi=' + _query + '" tabindex="1">' + '<p style="margin:0px;font-weight:bold">' + product.title + '</p>' + '<p style="margin:0px;font-size:10px;margin-top:5px">' + product.Category + '</p>' + '</a>' + '</li>' }); }; function debounce(func, wait, immediate) { var timeout; return function executedFunction() { var context = this; var args = arguments; var later = function () { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; return { init: init }; })(); searchApp.init();
10. Click **Next**. 11. Confirm by clicking **Apply**. 12. In the **Schedule** section, select **Immediately** and in **Advanced options** choose **Display every hour every day**. 6. In **Display settings**, define the circumstances for displaying the content. - In the **Triggers** section, choose **On landing** - In **Page targeting**, choose **Others** and in the **Display on pages** section, click **Add rule**. Add the URL of your site with FAQ. - In **Frequency** section, choose **Always** - In the **Stop Display** section, choose **Never** - In the **Devices** section, choose **Desktop** and **Mobile** 6. Confirm by clicking **Apply**. 7. In the **UTM & URL parameters** section, click **Skip step**. 8. Activate the dynamic content. ## Check the use case set up on the Synerise Demo workspace --- You can check the [example catalog](https://app.synerise.com/assets/catalogs/14858) and [search index settings](https://app.synerise.com/ai-v2/search/indices/24248c7557155c3e783d00a522649d4c1667544086/settings) directly in Synerise Demo workspace. We have prepared also ready-to-use codes of [dynamic content campaign with search based on FAQ](https://app.synerise.com/campaigns/dynamic-content/create/4ad6fecf-061f-44bb-9d73-652744d8fb75) which let you implement described basic AI Search on your website. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`suggestion.search`](/docs/assets/events/event-reference/search#suggestionsearch) (~1), [`suggestion.search.click`](/docs/assets/events/event-reference/search#suggestionsearchclick) (~1). ## Read more --- - [AI Search](/docs/ai-hub/ai-search) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Dynamic content](/docs/campaign/dynamiccontent) # Target the best customers for your campaign If you want your campaigns to bring the best results, you should target customers who are genuinely interested in a given offer. This approach allows you to reach customer who will be more likely to convert and also helps you optimize the cost of carrying out these campaigns. This use case describes the process of creating a favorite-brand email campaign targeting customers with the highest propensity to buy products from specific brands. One of the challenges addressed in this use case is the use of **percentile** to obtain TOP 30% of customers mostly interested in the specific brand.
Percentile is a score below which a specified percentage of customers from an analyzed group falls. For instance, the 50th percentile means that 50% of the customers have lower score than this one. Percentiles are especially useful whenever you direct communication only to a certain number of customers. Let’s assume that you want to make a propensity for a segment that is made up of 100 000 customers, and you want to send a message only to 10 000 of them. In this case, you can pick TOP 10% of customers with the highest score: in terms of percentiles this value is expressed as “over the 90th percentile”.
## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Import your item feed to AI engine](/docs/ai-hub/recommendations-v2/item-feed-requirements). The item feed must include information about item brand and that attribute must be added to [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes). - Prepare the propensity prediction following this [use case](/use-cases/propensity-brand). As an audience, [select the segmentation](/docs/analytics/segmentations/creating-segmentations) with your entire newsletter base.
The purpose of the propensity prediction is to find the customers who are most likely to make a purchase of the specific brand among all the customers in your newsletter database.
The result of the calculation is a `snr.propensity.score` event on the profiles of customers (from your newsletter database) for whom there is enough data to calculate scoring. The `percentile` parameter of the event will be used in the further parts of the process to create a group of customers with the highest score.
- [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Create an email template](/docs/campaign/e-mail/creating-email-templates) with products of the brands for which the propensity prediction was created.
In the email template, we recommend to use personalized AI campaign to retreive products from the specific brand chosen by AI engine for the customer. Read more about [creating AI campaign](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign), [applying filters](/docs/ai-hub/recommendations-v2/recommendation-filters) and [inserting it to email templates](/developers/inserts/recommendations-v2)
## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/favorite-brand#create-an-aggreagate) to enable using the result of the latest propensity prediction as a customer parameter in a segmentation. 2. [Create a segmentation](/use-cases/favorite-brand#create-a-segmentation) based on that aggregate to set an audience for use in communication. ## Create an aggreagate --- Based on the `snr.propensity.score` event, create an aggregate that returns the most recent value of the [percentile](/glossary/#percentiles) parameter for a customer.
In this step, you will need the ID of the prediction you created before. In the list of predictions, click the Three dot icon icon on the prediction and the ID will be available at the bottom of the context menu.
1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 2. Click **Analyze profiles by** and select **Last**. 3. Select the **snr.propensity.score** event. 4. As the event parameter, select **percentile**. 5. Click **+ where**. 6. From the **Choose parameter** dropdown list, select **modelId**. 7. As the logical operator, select **Equal**. 8. In the text field, enter the value of the modelId parameter. 9. As the date range, select **Last 30 days**. 10. Save the aggregate.
The final configuration of the aggregate
The final configuration of the aggregate
## Create a segmentation --- Create a segmentation of customers based on the results of [the aggregate you created](/use-cases/favorite-brand#create-an-aggreagate) in the previous part of the process. This segmentation contains 30% of customers with the highest scoring (customers who are most interested in the selected brands).
The value of percentiles can be tailored to your business needs.
1. Go to **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. Click **Choose filter**. 4. From the dropdown list, select the [aggregate you created before](/use-cases/favorite-brand#create-an-aggreagate). 5. As the logical operator, select **More or equal**. 6. In the text field, enter `70`. 7. Save the segmentation.
The final configuration of the segmentation
The final configuration of the segmentation
## What's next --- Go to **Experience Hub > Email** and create the Email communication with the template created before. As the audience of the communication, use [the segmentation you created](/use-cases/favorite-brand#create-a-segmentation). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of every element of this process directly in Synerise Demo workspace: - [Propensity prediction](https://app.synerise.com/ai-v2/predictions/propensity/pngsuydybpkq) - [Aggregate](https://app.synerise.com/analytics/aggregates/eee8bfa1-0f75-32a8-8ee5-8e3a36812112) - [Segmentation](https://app.synerise.com/analytics/segmentations/adbfd118-8f98-4b6f-904b-e90f2f592231) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Alternative way of preparing segmentation based on propensity](/use-cases/segmentation-propensity-based) - [Email communication](/docs/campaign/e-mail/introduction-to-email-campaigns) - [Prediction overview](/docs/ai-hub/predictions/predictions-introduction) - [Propensity predictions](/docs/ai-hub/predictions/propensity) - [Segmentation](/docs/analytics/segmentations) # In-app Stories with dynamic resize and brand showcase Modern mobile UX encourages interactivity and continuity — allowing users to move smoothly between subtle notifications and immersive experiences without switching screens. The resize feature in in-app messages makes it possible to run a single campaign with multiple visual states (for example, a small top or bottom bar expanding into a full-screen story). In this use case, you’ll build a two-stage in-app campaign for a specific brand. At first, users see a compact banner (“top” bar) with a teaser message such as “Discover Brand X”. After tapping the banner, the in-app message resizes to a full-screen story view, presenting brand details and AI-based recommendations of its bestsellers. This approach combines subtle awareness with deeper engagement — all in a single, unified campaign. It will be displayed after logging in to the application for users who have not viewed any product from this new brand yet. Additionally, the campaign will be active only for one month.
UC - In app resize - stories
## Prerequisites --- - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) for recommendations; enable the personalized recommendation type. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). ## Process --- In this use case, you will go through the following steps: 1. [Prepare the segmentation](#prepare-the-segmentation) of users who have never seen any product from this new brand. 2. [Create an in-app campaign](#create-an-in-app-campaign) as a top bar which, after tapping, resizes to the stories format automatically. ## Prepare the segmentation --- In this part of the process, you will create a group of customers who have never seen any product from a new brand. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. Click **Add condition**. 4. From the dropdown list, select the `page.visit` event. 7. As the parameter, choose **URL**. 6. From the **Choose operator** dropdown, choose **Contain**, and then select the name of the brand, in our case `Arcyber`. 10. Change **Performed** to **Not performed**. 7. Using the date picker in the lower-right corner, set the time range to **Lifetime**. Confirm by clicking **Apply**. 8. Click **Add condition**. 10. From the list, choose the `screen.view` event, 7. As the parameter, choose **URL**. 6. From the **Choose operator** dropdown, choose **Contain**, and then select the name of the brand, in our case `Arcyber`. 10. Change **Performed** to **Not performed**. 7. Using the date picker in the lower-right corner, set the time range to **Lifetime**. Confirm by clicking **Apply**. 12. Connect these conditions by the **AND** operator. 6. Save the segmentation.
Decision Hub segmentation configuration filtering customers who viewed a brand page without making a purchase
Segmentation configuration
You can use different settings of the segment based on the way you have implemented brands to your website - if their name is added to the URL address or if you have different category for products from specific brand, or in any other way.
## Create an in-app campaign --- In this part of the process, you will create an in-app campaign. You will use a predefined template for the message with interactive in-app stories, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. In this case, you will use the segmentation created in the [previous step](#prepare-the-segmentation). 1. In the **Audience** section, click **Define**. 2. Click **Segmentations**. 3. Click **Select segmentation** and choose the segmentation created in the [previous step](#prepare-the-segmentation). 3. Save the settings in the **Audience** section by clicking **Apply**. ### Define content --- In this part of the process, you will use a ready-made template to create the content of the in-app message that will be displayed in the mobile application. 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Resize Stories** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways: - by editing the code of the template, [adding inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [adding variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) - by filling out the form on the **Config** tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs.
In-app resize stories Config tab with bar settings and slide configuration
In-app configuration
1. In the **Bar settings** section, set up the copy and style of the first banner. Choose the bar position (top or bottom bar). 1. To lock a specific slide that you want to preview and edit, to prevent it from switching automatically, enable the **Config Mode**. 2. In the **General Settings** section: - In **Number of stories**, enter the number of slides in the stories (no more than 5). - In **Stories order**, define the order of stories (for example, 2,3,5,1). - In **Title** and **Subtitle**, define the title and subtitles of the stories respectively. If you don't want to display them, enter a dash (`-`). - If you want to display the avatar, enable the **Display avatar image** option and in **Avatar image**, enter a link to the source of avatar image. 3. In the **Button** section: - Customize the action button by defining the text on the button (**Text on the button**), the URL to which a user will be redirected (**Destination link**), colors of the button (**Button text color** and **Button color**). 4. Configure the settings for each story: - Each story can be customized separately. You can customize the copy in a story, select the colors of text and background, provide the links to image or video included in the story, and define the display time. 5. After you complete editing the form, disable the **Config mode** option. 5. After you make changes to the template, you can check the preview. 1. Click the **Preview contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the campaign preview directly in the mobile app.
6. If the template is ready, in the upper right corner click **Save this template > Save as**. 7. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 8. To continue the process of configuring the in-app campaign, click **Use in communication**. 9. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. In this case it will be visible after opening the application, but - as it was specified in the campaign settings - only for users who have not seen any product from the new brand yet. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `screen.view` event. 3. Click the **+ where** button and select `source`. 4. As the logical operator, select **Equal**. 5. As the value add `MOBILE`. 5. Click **Apply**.
In-app message trigger configured with screen.view event filtered by MOBILE source
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. In this case - 1 month. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. 16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ### Test the in-app campaign --- Read the ["Testing" section](/docs/campaign/in-app-messages/create-inapp-message#testing) to discover how to test your in-app campaign. ## Check the use case set up on the Synerise Demo workspace --- You can check the [segmentation](https://app.synerise.com/analytics-v2/segmentations/0c938198-6d2f-41b2-8211-9126b1a97725) and [in-app message campaign](https://app.synerise.com/communications/in-app/6dc6673a-4e87-4fa7-af03-44de61ee2b44) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`screen.view`](/docs/assets/events/event-reference/web-and-app#screenview) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) # Calculating items purchased within a campaign Thanks to the parameters in the URL, we can track the behavior of customers after interacting with a given campaign. In this use case, we will show an example of analyses related to AI recommendations, but in general, the same principles can be applied to create an analysis for any campaign where these parameters in the URL are placed. It helps us check the effectiveness of recommendations and monitor the purchases (exact number of products bought after clicking and their total value). This use case describes the process of creating aggregates, metrics and other analyses that count purchases based on the URL parameter with the ID of the AI recommendation. ## Prerequisites --- - A [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) implemented in the source of your website. - Send information about transactions through [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction) or [SDK](/developers/web/transactions-sdk). - Implement [OG Tags](/developers/web/og-tags) on your website. - Implement [AI recommendation](/docs/ai-hub/recommendations-v2) on your website or, in case you want to analyze different type of campaign, add unique parameters to the URL after clicking it, which will allow you to analyze the campaign results. ## Process --- This use case contains the following steps which must be performed in the given order: 1. [Getting the list of clicked products](/use-cases/items-bought-after-clicking#getting-the-list-of-clicked-products). 2. [Getting the timestamp of the first visit to the product page](/use-cases/items-bought-after-clicking#getting-the-timestamp-of-the-first-visit). 3. [Getting the list of the order IDs after clicking the recommendation](/use-cases/items-bought-after-clicking#getting-the-list-of-the-order-ids-after-clicking-the-recommendation). 4. [Multiply the product price by the product quantity](/use-cases/items-bought-after-clicking#multiply-the-product-price-by-the-product-quantity). 5. [Create metrics that calculate](/use-cases/items-bought-after-clicking#create-metrics): - The number of products bought after clickng the recommendation - The value of products bought after clicking the recommendation - The number of transactions with the products bought after clicking the recommendation - The value of transactions with the products bought after clicking the recommendation ## Getting the list of clicked products --- Create an aggregate that returns the SKUs of the clicked items (from a particular recommendation campaign). You will use these SKUs later to check if they occured in the transactions that occurred after clicking at a certain time. In this use case, we analyze clicking a product from a given AI recommendation based on the `page.visit` event and `uri` parameter (URL of the website). This parameter contains `?snrai_campaign=XXX` part, where `XXX` is the ID of AI recommendation that was clicked. The `?snrai_campaign` parameter it is added to the URL automatically when implementing AI recommendation. The analysis is also based on the ID of the clicked product which is stored in the `retailer_part_no` parameter. However, sometimes clicking a product does not transfer directly to the product page, so it is not possible to add parameters to the URL, especially in the case of "Add to cart" buttons placed directly in the product frame. In such case instead of relying on the `page.visit` event, you should implement a [custom event](/developers/web/event-tracking#declarative-tracking-custom-events). Such an event must contain the AI recommendation ID and the product ID that was clicked in its parameters. Then you will be able to rely your analyses on this custom event. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **Last Multi**. 3. Select **Consider only distinct occurrences of the event parameter**. 3. In the **Size** field, enter the number of returned SKUs. 4. Select the **page.visit** event. 5. Select the **product:retailer_part_no** parameter. 6. Select the **url** parameter. 7. Select the **Contain** logical operator. 8. In the text field, enter the ID of the recommendation campaign.
You can find it in the URL of the product from the recommendation:
Product page URL showing the snrai_campaign parameter used to identify the AI recommendation campaign ID
ID of recommendation campaign in URL
9. Save the aggregate.
Last visited recommendation aggregate
Last visited recommendation aggregate
## Getting the timestamp of the first visit --- You must get the time of the first click at the product from recommendation campaign. To do so, we use the `TIMESTAMP` parameter and the ID of the recommendation campaign which is visible in the clicked link. Timestamp allows you to define the period from which transactions should be taken into account, and also those transactions which occurred after clicking the campaign. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **First**. 4. Select the **page.visit** event. 5. Select the **TIMESTAMP** parameter. 6. Select the **url address** parameter. 7. Select the **Contain** logical operator. 8. In the text field, enter the ID of the recommendation campaign. 9. Save the aggregate.
Decision Hub First aggregate returning the TIMESTAMP of the first page.visit event matching the AI recommendation campaign URL
Time of the first visit to the product of the recommendation campaign
## Getting the list of the order IDs after clicking the recommendation --- Create an aggregate that returns the order IDs of the products included in the [first aggregate you prepared](/use-cases/items-bought-after-clicking#getting-the-list-of-clicked-products). It allows you to identify the transactions that included the products clicked from the specific campaign and those transactions which took place just after the click. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **Last Multi**. 3. Select **Consider only distinct occurrences of the event parameter**. 4. Select the **product.buy** event. 5. Select the **$orderID** parameter. 6. Select the **$sku** parameter. 7. Select the **IN ARRAY** logical operator. 8. Select the aggregate you created in the [Getting the list of visited products](/use-cases/items-bought-after-clicking#getting-the-list-of-clicked-products) step. 9. Save the aggregate.
Decision Hub Last Multi aggregate returning the distinct product.buy order IDs for items previously clicked in the AI recommendation campaign
The list of products clicked in the recommendation
## Multiply the product price by the product quantity --- Create [an event expression](/docs/crm/expressions/creating-event-expression) that multiplies the final price of the product and its quantity. At the same time you enrich the parameters of the `product.buy` event. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expressions**. 2. From the **Expression for** list, select **Events**. 3. Select the **product.buy** event. 4. On the dashboard, click the **Select** button and select **Event attribute**. 5. On the list, find **$finalUnitprice** or other parameter that signifies the actual transaction value. 6. Click the plus button and select **Event attribute**. 7. On the list, find **$quantity** or other parameter that signifies the quantity of the product. 8. Change the mathematical sign between the attributes from the plus sign to times sign (`x`). 9. Save the expression.
Configuration of the expression
Configuration of the expression
## Create metrics --- Prepare metrics based on the three aggregates you created in previous steps. Including the aggregates in metrics lets you calculate: - the number of products purchased after clicking in the campaign, - the total value of products purchased after clicking in the campaign, - the number of transactions that include the products bought after clicking the campaign, - the total value of transactions that include the products bought after clicking the campaign.
Click to see the metric for the number of products bought after clicking the campaign

In this metric, you check the number of products by using in the metric formula the aggregate that returns the SKU of the products viewed within a campaign.

Additionally, narrow down the results by using the timestamp parameter. Set the time stamp to include the purchases after the first click at the product in the campaign. For that purpose, use the aggregate that calculates the timestamp of the first product visit.

  1. Go to Decision Hub icon Decision Hub > Metrics > New metric.
  2. Enter the name of the metric.
  3. Leave the Aggregator at default (Count).
  4. Select the product.buy event.
  5. Add the following parameters:
    1. Add the $sku parameter.
      1. Select the In operator.
      2. Keep clicking the icon next to the logical operator until you get Choose value icon.
      3. Select the aggregate that returns the list of visited products.
    2. Add the TIMESTAMP parameter.
      1. Select the Date operator.
      2. Select the More than option.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon
      4. Select the aggregate that returns the timestamp of the first product visit.
  6. Select the date range of the metric (for example, last 30 days).
  7. Save the metric by clicking Save.
Configuration of the metric
Configuration of the metric
Click to see the metric for the sum of products bought after clicking a campaign

This metric returns the total sum of products bought after clicking a campaign. The metric uses the expression that multiplies the product price by the product quantity.

You can duplicate the metric that calculates the number of products bought after clicking a product, change the aggregator from Count to Sum and use the expression that multiplies the price by the quantity.

  1. Go to Decision Hub icon Decision Hub > Metrics > New metric.
  2. Enter the name of the metric.
  3. As the aggregator type, select Sum.
  4. Select the product.buy event.
  5. Add the following parameters:
    1. The expression that multiplies the product price by product quantity.
      1. Select the $sku parameter.
      2. Select the In operator.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon.
      4. Select the aggregate that returns the list of visited products.
    2. Add the TIMESTAMP parameter.
      1. Select the Date operator.
      2. Select the More than option.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon
      4. Select the aggregate that returns the timestamp of the first product visit.
  6. Select the date range of the metric (for example, last 30 days).
  7. Save the metric by clicking Save.
Configuration of the metric
Configuration of the metric
Click to see the metric for the number of transactions with the products bought after clicking a campaign

This metric is based on the `transaction.charge` event (this event collects an array of products included in the transaction). The metric reuses the aggregate that returns the list of products bought after clicking the campaign to check if the order ID of the product is included in the transaction. The scope of the metric is narrowed down by the aggregate that returns the timestamp of the first visit at the product page.

  1. Go to Decision Hub icon Decision Hub > Metrics > New metric.
  2. Enter the name of the metric.
  3. Leave the Aggregator to default (Count).
  4. Select the transaction.charge event.
  5. Add the following parameters:
    1. Add the $orderID parameter.
      1. Select the In operator.
      2. Keep clicking the icon next to the logical operator until you get Choose value icon
      3. Select the aggregate that returns the list of the order IDs after clicking the recommendation.
    2. Add the TIMESTAMP parameter.
      1. Select the Date operator.
      2. Select the More than option.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon
      4. Select the aggregate that returns the timestamp of the first product visit.
  6. Select the date range of the metric (for example, last 30 days).
  7. Save the metric by clicking Save.
Configuration of the metric
Configuration of the metric
Click to see the metric for the sum of transactions with the products bought after clicking a campaign

This metric is based on the `transaction.charge` event (this event collects an array of products included in the transaction). The metric reuses the aggregate that returns the list of products bought after clicking the campaign to check if the order ID of the product is included in the transaction. The scope of the metric is narrowed down by the aggregate that returns the timestamp of the first visit at the product page.

If you have already created a metric for the number of transactions with the products bought after clicking a campaign, you can duplicate it and change the aggregator type and use the `totalAmount` parameter.

  1. Go to Decision Hub icon Decision Hub > Metrics > New metric.
  2. Enter the name of the metric.
  3. As the Aggregator type, select Sum.
  4. Select the transaction.charge event.
  5. Add the following parameters:
    1. Add the $totalAmount parameter.
      1. Select the In operator.
      2. Keep clicking the icon next to the logical operator until you get Choose value icon
      3. Select the aggregate that returns the list of the order IDs after clicking the recommendation.
    2. Add the TIMESTAMP parameter.
      1. Select the Date operator.
      2. Select the More than option.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon
      4. Select the aggregate that returns the timestamp of the first product visit.
  6. Select the date range of the metric (for example, last 30 days).
  7. Save the metric by clicking Save.
Configuration of the metric
Configuration of the metric
## What's next --- You can display created metrics on the [dashboard](/docs/analytics/analytics-dashboard), which help you present them in useful and readable form. ## Check the use case set up on the Synerise Demo workspace --- You can check the created metrics directly in Synerise Demo workspace: - [Number of products bought after clicking the campaign](https://app.synerise.com/analytics/metrics/2603b814-57e6-4bfd-ad4f-f73677003117) - [The sum of products bought after clicking a campaign](https://app.synerise.com/analytics/metrics/cada2f5c-5295-4b88-9a29-be74f0cf2044) - [The number of transactions with the products bought after clicking a campaign](https://app.synerise.com/analytics/metrics/7c105ed8-1c55-438c-bebb-40cdaf06d792) - [The sum of transactions with the products bought after clicking a campaign](https://app.synerise.com/analytics/metrics/e0058e97-b130-4632-b4aa-5500c369cda9) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) # Location based promotion for the entire basket Marketers create promotions based on various criteria, such as promotions targeting a specific group of products, brands or even store locations. The choice of the promotion type depends largely on its objectives and desired results. This use case describes how to create a promotion for customers who make purchases in stores in a specific location - in Krakow. Such customers will receive a 15 PLN discount for purchases over 100 PLN. The promotion will work only for loyalty program members (customers logged into the mobile app). ## Prerequisites --- - Implement promotions in your [mobile application](/developers/mobile-sdk/loyalty), [API](https://hub.synerise.com/api-reference/authorization#tag/Authorization/operation/profileLogin). - [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog). - Add list of stores to a catalog. Such a catalog must contain a unique store ID and any other store attributes by which you will filter stores, such as city, zip code, and so on. More information about catalogs can be found [here](/docs/assets/catalogs). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- 1. [Prepare a segmentation](/use-cases/location-based-promotion#prepare-a-segmentation) of customers who are members of the loyalty program. 2. [Create a promotion](/use-cases/location-based-promotion#create-a-promotion) based on location. ## Prepare a segmentation --- In this part of the process, create a segmentation of customers who are members of the company's loyalty program. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. From the **Choose filter** dropdown list, select the **loyaltyCard** attribute. 4. As the logical operator select Boolean **Is true**. 5. Confirm by clicking **Save**.
The conditions used in the segmentation will vary depending on your loyalty program integration (for example, the name of the attribute may be different). You must define the segmentation accordingly.
An example of a segmentation of customers who participate in a loyalty program
An example of a segmentation of customers who participate in a loyalty program
## Create a promotion --- 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Enter a name for the promotion. 2. Select the **For entire cart** option. 3. In the **Audience** section, select the segmentation created in [this step](/use-cases/location-based-promotion#prepare-a-segmentation). 4. In the **Content** section: 1. Define the name, description, and image of the promotion. 2. In the **Price** field, enter `0`. 3. Confirm the settings by clicking **Apply**.
AI Hub promotion Content section with name, description, image, and zero price for a location-based promotion
Example of promotion content
5. In the **Type and limits** section: 1. As the **Type**, choose **Members only**. 2. Select the **Single** tab. 3. In the **Limit per profile** section, enter `1`. 4. In the **Minimum value** and **Maximum value** fields, define the price caps that activate discount for the entire cart. 5. From the **Discount type** dropdown list, choose **Amount**. 6. From the **Discount mode** dropdown list, choose **Static**. 7. In the **Value** field, enter `15`.
Example of Type and limits settings
Example of Type and limits settings
6. In the **Schedule** section, define the promotion distribution period according to your business needs. 7. In the **Stores** section, specify stores where the promotion is available (in this case, stores located in Krakow were selected).
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
8. In the **Items** section, specify the catalog item to be discounted: 1. In the **Source catalog** field, select an item catalog to select the promotional items from. 2. Select **Entire catalog** using the **Select items** option, as in this use case promotion works on all items. 11. To apply configuration and run the promotion, click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- You can also check the configuration of the [segmentation](https://app.synerise.com/analytics/segmentations/1f34841c-8dd8-49f6-acd9-aab7ce928e23) and [promotion settings](https://app.synerise.com/campaigns/promotions/18b845c0-b220-44ca-8d12-3321753f8fd0) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Promotions](/docs/ai-hub/promotions) - [Segmentations](/docs/analytics/segmentations) # Visualizing Value Distribution with Quantiles in Dashboards You can create a dashboard with quantile-type metrics to see how values is distributed and compare results between different cohorts and time periods. In this example, you will create a dashboard that displays quantile values (0.25; 0.50; 0.75) and average values of transaction amounts made by male and female customers. The use case can be modified easily by adding more metrics with other quantile values, or other conditions, such as using age groups or geographical location instead of sex, or using different events and attributes for the analysis. The process consists of two stages: - Creating eight metrics to include in the dashboard - Creating the dashboard ## Prerequisites --- - In this example, the customers' profiles must include information about their sex. ## Process --- In this use case, you will go through the following steps: 1. [Create eight metrics](/use-cases/understand-distribution#create-metrics) for `transaction.charge` event. 2. [Create dashboards](/use-cases/understand-distribution#create-dashboard) presented all metrics. ## Create metrics --- In this stage, you will create eight metrics for `transaction.charge` events. The procedure describes creating a single metric, you will need to repeat the steps for each metric separately, changing the conditions each time. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Give the metric a meaningful name. For the purpose of this example, the first metric is for quantile 0,25 of transactions made by females. 3. Leave **Type** at **Event**. 4. Change the **Aggregator** to **Quantile**. 5. In the input field which appears next to the aggregator, type `0,25` 5. Leave **Occurrence type** at **All**. 6. Click **Choose event** and select **transaction.charge**.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it's **transaction.charge**).
6. Next to the event selector, click **Choose param** and select **$totalAmount**. 7. Click **Enable filter**. 8. Click **Choose filter** and use the **Search** field to find and select the **Sex** attribute. 9. In the text field, type `1`.
Contact filter to include only female customers
Contact filter to include only female customers
The values for this parameter mean: - `0`: not specified - `1`: female - `2`: male - `3`: other
1. Click **Apply**. 2. Save the metric.
A completed quantile metric
A completed quantile metric
3. Create the remaining metrics: - For females: quantiles 0.5 and 0.75, and average value (**Average** is one of the aggregators) - For males: quantiles 0.25, 0.5, 0.75, and average value - Optionally, add metrics for the `undefined` and `other` values of the `sex` attribute.
You can do this faster by clicking **Three dots icon > Duplicate** next to a metric in the list of metrics and then modifying the conditions in the created duplicate.
## Create dashboard --- In this stage, you create a dashboard to display the results of all metrics in one place for easier analysis. 1. Go to Decision Hub icon **Decision Hub > Dashboards > Add dashboard**. 1. Add the metrics to the dashboard: 1. Click Metric icon. 2. Click the widget that appears. 3. From the **Metric** drop-down list, select one of the [metrics that you created previously](#create-metrics). 4. On the **Tab**, add two more decimal places to display (by default, none are displayed). 5. Repeat steps **2a-2d** until all the metrics are added. 2. Click **Save dashboard**. **Result:** You can now open the dashboard and use the **Date range** picker to check data for different periods.
A dashboard with eight metrics and an enabled date selector
A dashboard with eight metrics and an enabled date picker
To learn more about viewing, sharing, and formatting dashboards, see [this section of the User Guide](/docs/analytics/analytics-dashboard).
## Check the use case set up on the Synerise Demo workspace --- You can all items created in this use case in our Synerise Demo workspace: - [0,25 quantile of transactions made by females](https://app.synerise.com/analytics/metrics/75713c7f-1480-4377-b11a-0ab656660e08) - [0,5 quantile of transactions made by females](https://app.synerise.com/analytics/metrics/22423a36-6c96-49d0-b3c3-e19cd9ecf6c0) - [0,75 quantile of transactions made by females](https://app.synerise.com/analytics/metrics/7f0815d2-b6b4-445b-ad7d-386625a48ddd) - [Average of transactions made by females](https://app.synerise.com/analytics/metrics/3f334b83-bffe-4d67-a053-83c607afdc1d) - [0,25 quantile of transactions made by males](https://app.synerise.com/analytics/metrics/3192ab2d-35c4-4ad1-9de4-cdf9b75d9e02) - [0,5 quantile of transactions made by males](https://app.synerise.com/analytics/metrics/257c9129-9849-45b0-b7dc-f8ebaa28f788) - [0,75 quantile of transactions made by males](https://app.synerise.com/analytics/metrics/adc59fd7-c9c8-4b19-9921-97ec67e417c9) - [Average of transactions made by males](https://app.synerise.com/analytics/metrics/465fda5a-61c5-430a-b82c-d0993e774fa8) - [Dashboard with presented metrics](https://app.synerise.com/analytics/dashboards/836813e4-d660-49fa-969d-d7d866d8d90b) - [Dynamic content campaign](https://app.synerise.com/campaigns/create/37c5fadb-8628-47a4-ad8c-61a5e2b4a46b) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Dashboards](/docs/analytics/analytics-dashboard) - [Metrics](/docs/analytics/metrics) # Personalized promotion tailored to last visited main category In online retail, timing and relevance are key when presenting promotions. Shoppers often browse multiple sections of a website but don’t always convert immediately. By leveraging the last visited main category, businesses can deliver contextually relevant promotions that feel timely and personalized. This use case illustrates how to dynamically display a promotion related to the last main category visited by the user — for example, if the customer recently viewed items from "Electronics", a banner or content block can highlight current deals or featured products from that specific category. This approach increases the chance of re-engagement and encourages return visits or immediate conversions by matching promotional content to current user interest.
In this use case, we return personalized promotions based on the last visited main category by the user. However, the same configuration logic can be easily adapted to display category-specific promotions directly on each category page. To do this, you simply skip the use of segments and aggregates related to browsing history and instead implement static personalization rules per category. For example, on the “Electronics” category page, you display promotions tailored specifically to electronics products. This approach allows for consistent and relevant promotional messaging across the entire website structure.
## Prerequisites --- - [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog). - [Integrate Synerise promotions](/docs/ai-hub/promotions/introduction-to-promotions). - Implement transaction events using [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). ## Process --- 2. [Create an aggregate](/use-cases/personalized-category-promotions#create-an-aggregate) which returns the last visited category. 1. [Create a segmentation](/use-cases/personalized-category-promotions#create-a-segmentation) for each category. 1. [Create a promotion](/use-cases/personalized-category-promotions#create-a-promotion) for each category. 4. [Create a dynamic content](/use-cases/personalized-category-promotions#create-a-dynamic-content) with the personalized promotions. ## Create an aggregate --- In this part of the process, create an aggregate that will return the category that the user last visited. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 5. From the **Choose event** dropdown list, select the `page.visit` event. 6. As the event parameter, select **category**. 7. Add the value **product:retailer_part_no**. 8. As the value add **Is true**. 7. Set the period from which the aggregate will analyze the results to **Lifetime**. 12. Save the aggregate.
Decision Hub Last aggregate returning the category of the last visited product page over a customer's lifetime
Configuration of the aggregate
## Create a segmentation --- Create a segmentation for each category on your page. It will group the users based on the specific category being the last one they visited. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. From the **Choose filter** dropdown list, select the [aggregate you created](#create-an-aggregate). 4. As the logical operator, select **Equal**. 5. Next to the logical operator, in the text field enter the name of the specific category.
Configuration of the segmentation
Configuration of the segmentation
Duplicate the segmenaton, and repeat this step as many times as you have categories on your website, changing only the name of the category. ## Create a promotion --- In this step, create set of promotions for each category on the website. It will be good, if all of them will be connected to categories choosen in the segmentation. In this way we will have minimum 1 promo for each form choosen categories. What is more aeach of them will be **marked with a special tag** to distinguish them from other promotions. You can create a promotion with the following scopes: - [For selected items](/docs/ai-hub/promotions/creating-promotions) - you can select items to which you want to apply a discount - [For entire basket](/docs/ai-hub/promotions/creating-promotions-for-entire-basket) - you can reduce the value of the whole shopping cart if its value matches the fixed price limit 1. In the **Audience** section, choose the [segmentation](#create-a-segmentation). This way you make sure that, for example, the promotion for Electronics is only visible on the main page to users for whom Electronics was the last visited category.
Configuration of the promotion
Configuration of the the audience of the promotion
2. Include all necessary promotional elements such as the product image, promotion name, description, and any other details required for displaying the promotion on the landing page. This ensures a clear presentation of the promotion to the customer, enhancing their engagement and understanding of the offer. 3. In **Content** section add informaton about promotion and its details. Also add there a tag of your choice. The selection of the promotions of the dynamic content will be narrowed down to those labeled with this tag. In our case they can be tagged as **CategoryPromo**.
Configuration of the content
Configuration of the the content of the promotion
3. In the **Items** section, select the specific products or categories to which the promotion should apply. 3. In the **Types & Limits** section, define the logic of the promotion — for example, whether it’s a fixed discount, a percentage-based reduction, or a special offer limited to a certain number of uses. This configuration determines how the promotion behaves and under what conditions it is applied.
Make sure that all necessary promotional elements are included in the content, such as the product image, name, description, and any other details required for displaying the promotion on the landing page. Including all key elements ensures that the promotion is presented clearly and effectively to the customer, enhancing their engagement and understanding of the offer.
Alternatively, if you already created promotions in an external service, you can [import them to Synerise](/docs/automation/actions/synerise-integrations#import-promotions). ## Create a dynamic content --- You can display the promotions on your home page (or category page) by using [dynamic content](/docs/campaign/dynamiccontent). 1. Go to **Experience Hub > Dynamic content > Create new** 2. Enter the name of the dynamic content. 3. Choose the **Insert Object** type. 2. As the audience, select **New Audience**. 1. Click **Define conditions**. 2. Click **Add condition** and choose the [aggregate, created in the previous step](#create-an-aggregate). 4. As the operator choose **Is not null**. In this way, the campaign will be visible only for users who have any value in the aggregate, so they have visited any category previously. 2. Confirm by clicking **Apply**.
Configuration of the dc
Configuration of the the dc
2. In the body of the dynamic content, use the promotion snippet.
Read more about how to use snippets [here](/docs/assets/snippets).
Configuration of the sippet
Configuration of the the snippet
4. Click the snippet widget, providing quick access to a variety of useful code sections. 5. Select a category of snippets: **Profiles promotions** and add them to the template. 3. In the template editor add CSS and/or HTML to the dynamic content.
Be cautious when using the default Profile’s Promotions insert, as it may display more promotions than intended for the current campaign. To maintain control over the display, use tags specifically designated for the promotions in this use case
4. In this step, we will customize the snippet by including a line that limits the selection of promotions to those from the current campaign. In case you need to add more personalized options - read more about inserts [here](/developers/inserts/insert-usage). 5. Add **tagNames=["XXX"]** to the code in the place presented below in the example code. Remember to add the name of the tag created earlier in the place of **XXX**.
{%- set getFields=["code"] -%}
   {%- promotions fields=getFields tagNames=["categoryPromo"] -%}
   {%- for item in promotions_result -%}
   {{ item }}{%- endfor -%}
   {%- endpromotions -%}
4. [Define the rest of the settings](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Check the use case set up on the Synerise Demo workspace --- You can check the [aggregate](https://app.synerise.com/analytics-v2/aggregates/78b590fc-88bd-3831-8419-5c080efceeec), [segmentation](https://app.synerise.com/analytics-v2/segmentations/3ae2e8a9-8f63-4c51-978b-32e245cfb331) and [promotion configuration](https://app.synerise.com/campaigns/promotions/ca9b580d-e0a6-47ad-9c65-520dd68398ae) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Recommendations](/docs/ai-hub/recommendations-v2) # Integration with Storyly The user engagement platform [Storyly](https://www.storyly.io/) allows to embed full-screen, interactive stories, in both mobile applications and websites. With those stories you can post interactive ads and engaging videos with call to action. You can include GIFs, use ready made templates or create your own without the use of code. To improve your communication and drive conversion you can use customer data collected in Synerise to personalize the stories. In this use case, we will enrich stories with information about customer's favourite day for shopping, to show them personalized stories in the mobile app. This information will be extracted using an expression and passed to the mobile application in a document.
Storyly integration, story example
## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Implement Storyly SDK in your mobile app](https://integration.storyly.io/getting-started/what-is-storyly.html). ## Process --- In this use case, you will go through the following steps: 1. [Create an event expression](#create-an-event-expression). 2. [Create an aggregate](#create-an-aggregate). 3. [Create an expression](#create-an-expression). 2. [Create a document](#create-a-document) with expression inserts. ## Create an event expression --- In this part of the process, create an expression that extracts the number of the week day out of a timestamp of the `transaction.charge` event. The result of this expression will be a number from 1 to 7 (1 is Monday, 7 is Sunday). 1. In Synerise, go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions> New expression**. 2. Enter the name of the expression. 3. From the **Expressions for** dropdown list, select **Event**. 4. From the dropdown list, select `transaction.charge` event. 5. In the **Formula definition** section of the page, click **Select**. Result: A dropdown list appears. 6. From the list that opens, select **Function > Day of week**. 7. In the brackets, click the left **Select** button and from the list, select **Event attribute**. 8. Click **Unnamed** in the brackets, to display the settings of the event attribute. 9. From the **Choose parameter** dropdown list, select `TIMESTAMP`. 10. Save the expression.
The view of expression congifuration
Expression configuration
## Create an aggregate --- In this step, create an aggregate that returns the day of the week in which a customer makes transactions most frequently - it is the day of the week on which the customer is most likely to make a purchase. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Top**. 4. From the **Choose event** dropdown list, select the `transaction.charge `event. 5. From the **Choose parameter** dropdown list, select the [expression created in the previous step](#create-an-event-expression). 6. In the calendar in the right bottom of the page: 1. In the **Relative date range** section, click **Custom**, type 365 and from the the dropdown list, select **Days**. 2. Click **Apply**. 7. Save the aggregate.
The view of aggregate congifuration
Aggregate configuration
## Create an expression --- In this part of the process, you will create an expression that will return the value of the [aggregate made in the previous step](#create-an-aggregate). This expression will later be placed in the document retrieved by the application. 1. In Synerise, go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions> New expression**. 2. Enter the name of the expression. 3. Leave the **Expression for** option at default (**Attribute**). 4. In the **Formula definition** section of the page, click **Select**. Result: A dropdown list appears. 5. From the list that opens, select **Profile**. 6. Click **Unnamed** to display the settings of the profile attribute. 7. From the **Choose parameter** dropdown list, select the [aggregate created in the previous step](#create-an-aggregate). 8. Save the expression.
The view of expression congifuration
Expression configuration
## Create a document --- As the final part of the process, create a document with parameters that will be passed to Storyly. The document contains a Jinjava insert with expression value for individual customer. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Documents > Add document**. 2. Enter the name for your document. Automatically, the field with a slug is filled as well. A slug is an ID of the document. 3. To select the type of schema, in the **Type** section, unfold the dropdown list. A schema defines the method of validating the data included in the document. To create a schema type, please refer to the [API reference pages](https://hub.synerise.com/api-reference/asset-management#tag/Documents/operation/addSchemaType). 4. Optionally, in the **Description** field, you can add a description of the document. 5. In the **Content (JSON)** section, paste the JSON code:
{ 
   "storyly_fav_day": "{% expression %} insert the ID of the expression {% endexpression %}"
   }
6. Click **Apply** to save the document.
The view of document congifuration
Document configuration
7. Click the Three-dot icon icon and from the dropdown list select **Versions**. 8. In order to publish a document, next to the version, click the **Publish** button. ## What's next --- Once the document is created, the mobile app retrieves it using get document method: - [iOS](/developers/mobile-sdk/method-reference/ios/content#generate-document) - [Android](/developers/mobile-sdk/method-reference/android/content#generate-document) - [React Native](/developers/mobile-sdk/method-reference/react-native/content#generate-document). Then, the document content will be passed as the value of the variables defined in Storyly when executing the Storyly SDK methods for displaying stories: - [method for iOS](https://integration.storyly.io/ios/personalized-userproperties.html) - [method for Android](https://integration.storyly.io/android/personalization-userproperties.html). This way the customer will see personalized stories in the mobile app. We also encourage you to enrich your integration with events sent to Synerise, for example, when user views or responds to a story. This way you can build different analyses or use this information in other customer communications. Find out which [events](https://integration.storyly.io/android/sending-events.html) you can send from Storyly to Synerise, and [how to send them](/developers/mobile-sdk/event-tracking#declarative-tracking). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of this integration directly in Synerise Demo workspace: - [Expression that returns the day of week a transaction was made](https://app.synerise.com/analytics/expressions/282ac206-ebbb-4fc0-9cbb-48be59b4d2ed). - [Aggregate](https://app.synerise.com/analytics/aggregates/070e06fc-3416-3ff5-a3a1-86489f1ce956). - [Expression that returns the number of the week day of the `transaction.charge` event for specific customer](https://app.synerise.com/analytics/expressions/f01a7761-2d63-4229-b315-e0cd7c0d273e). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Documents](/docs/assets/documents/introduction-to-documents) - [Expressions](/docs/crm/expressions) - [Jijava inserts](/developers/inserts) - List of pre-defined events in Storyly’s SDK: - [iOS](https://integration.storyly.io/ios/storyly-events.html) - [Android](https://integration.storyly.io/android/storyly-events.html) # Predict propensity to buy an item You can use the Predictions feature to calculate the probability of customers buying a particular item. The results can be used for better targeting of your marketing efforts.
Propensity to buy a particular item: Blue Sport Shoes
Propensity to buy a particular item: blue sport shoes, identified by a unique ID
## Prerequisites --- - [Enable the Propensity prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-propensity-and-best-fit-predictions). - The `itemID` attribute (the unique identifier attribute of an item) must be added to [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes). ## Creating the prediction --- 1. Go to AI Hub icon **(AI Predictions) Models > New prediction** and select **Propensity** as the prediction type. 2. Select an audience for the prediction. For more information, see the [Predictions quick start article](/docs/ai-hub/predictions/propensity#select-customers-to-be-analyzed). ### Define the item In this section, you define the item for which you want to calculate the prediction. This is done by creating a filter that matches the item by its unique identifier in the catalog. 1. In the **Item feed** section, click **Define**. 2. Click **Choose item feed**. 3. Select the catalog that contains the items you want to make the prediction for. **Result**: the **Item filter** section appears. 4. Click **Define item filter**. 5. From the **Select attribute** drop-down list, select the `itemId` attribute. You can use the search field. 6. From the drop-down list that appears, select the **Equal** operator. 7. From the list of available values that appears, select an identifier. You can use the search field.
Screenshot: filter matches exactly one item
The filter matches exactly one item
8. Click **Save**. 9. Save the item feed configuration by clicking **Apply**. ### Additional settings and saving Configure the [additional settings](/docs/ai-hub/predictions/propensity#additional-settings) (or leave them at default) and click **Save & Calculate**. ## What's next --- After the calculation is completed, a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction. Based on the `snr.propensity.score` event, you can create segmentations of customers with different propensity and use those segmentations as campaign targets: - [email](/docs/campaign/e-mail) - [SMS](/docs/campaign/SMS) - [web push](/docs/campaign/Webpush) - [mobile push](/docs/campaign/Mobile) - [dynamic content](/docs/campaign/dynamiccontent) - [screen views](/docs/campaign/screen-views) Email, SMS, web push and mobile push can be sent manually or you can launch them by using [Automation Hub](/docs/automation). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [Propensity prediction](https://app.synerise.com/ai-v2/predictions/propensity/ovwcgaomjlwu), [segmentation](https://app.synerise.com/analytics-v2/segmentations/2de2b62c-c659-47fc-8a41-cfba97e94439) and [catalog](https://app.synerise.com/assets/catalogs/13168) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1). ## Read more --- - [Predictions](/docs/ai-hub/predictions) # Excluding category of recently purchased products in recommendations Personalized product recommendations are incredibly effective because they use your customers' search, browsing, and purchase history to recommend products that are tailored to their specific requirements and preferences. To create even better communication, you can exclude from recommendations the categories of items recently bought by a customer. In this use case, you will learn how to create a personalized recommendation campaign which uses an aggregate to exclude the categories of recently purchased products. ## Prerequisites --- - Configure an [item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable the personalized recommendation model. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). ## Process --- 1. [Create an aggregate](/use-cases/reco-excluding-recently-purchased-category#create-an-aggregate) of recently purchased products' categories to exclude them from personalized recommendation campaign. 2. [Create a recommendation](/use-cases/reco-excluding-recently-purchased-category#create-a-recommendation). ## Create an aggregate --- In this part of the process, create an aggregate that will return categories of products already bought by the customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi**. 4. Select **Consider only distinct occurrences of the event parameter**. 5. In the **Size** field, enter the number of returned categories. 5. Select the **product.buy** event. 6. Select the **category** parameter. 7. Define the period from which the aggregate will return products from the event. This period will affect which purchases are included when checking for categories to exclude from the recommendation. 8. Save the aggregate.
Decision Hub Last Multi aggregate returning the distinct categories of recently purchased products
Configuration of the aggregate
## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 3. In the top left corner, enter the name of your recommendation. 4. In the **Type & Items feed** section, click **Define**. 5. From the **Items feed** dropdown menu, choose the provided feed. 6. Choose the **Personalized** recommendation type. 7. Click **Apply**.
AI Hub recommendation model Type and Items feed section with Personalized recommendation type selected
Configuraion of the catalog and recommendation type section
8. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the user in each slot. In our example, one slot returns 4 products. In the **Items** section, click the **Define** button. Click the plus button to add more slots. This will allow you to define new slots for your recommendation setup. In the slot settings, specify the minimum and maximum number of items to be recommended to the user within this slot. 3. Click **Static filter**.
Learn about the difference between [elastic, static](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter) filters.
4. From the dropdown list, choose **Visual Builder**. 2. Click **Select attribute**. 3. From the dropdown list, choose the **category** attribute. 4. Click **Operator**. 5. From the dropdown list, choose **Does not equal**. 6. Click the value type icon (Value icon) and choose the aggregate icon from the list. 7. From the dropdown list, choose [the aggregate you have created](/use-cases/reco-excluding-recently-purchased-category#create-an-aggregate). 8. In the **Level range** input area that appear, you can choose how you want to select your category level. Choose: **Whole category.**
If your products categories have a `X > Y > Z` structure, level 0 will be `X > Y > Z`. Level 1 will be `X > Y` and so on. Here, you define how granular the category recommendations will be. For example, if you are selling shoes, you will have an `Outdoor > Sport > Running` category and an `Outdoor > Sport > Football` category. If level 0 is selected, the two categories are excluded. If level 1 is provided, the `Outdoor > Sport` category and any of its subcategories will be excluded.
14. Click **Apply**.
Example of static filter conditions
Example of static filter conditions
9. In the **Items** section, click **Apply**. 10. Optionally, you can define the settings in the **Boosting** and **Additional settings** sections.
Learn more about [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors) and [additional settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#additional-settings).
11. Save the recommendation. ## What's next --- You can display the recommendation to customers in a number of ways. For example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content), or in mobile application with content widget, both on [Android](/developers/mobile-sdk/displaying-recommendations/content-widget/android) and [iOS](/developers/mobile-sdk/displaying-recommendations/content-widget/ios). ## Check the use case set up on the Synerise Demo workspace --- You can also check [the aggregate](https://app.synerise.com/analytics/aggregates/474a464f-175e-34e4-9890-ce922955390e) and [recommendation configuration](https://app.synerise.com/ai-v2/recommendations/wWmX7O8uxptZ) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating aggregates](/docs/crm/aggregates/creating-profile-aggregates) - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Filters in recommendations](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Requirements for item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) # Similar vs cross-sell recommendations with Variant optimizer Similar and cross-sell item recommendations are both powerful tools for online retailers, helping guide customers toward products that align with their interests or complement their intended purchases. But which approach performs better in a specific context? With Variant optimizer, you can run real-time tests to compare dynamic content variations and automatically prioritize the version that drives the most engagement. This use case explores the scenario of creating a dynamic content (DC) campaign featuring two types of product recommendations to users who have added items to their favorites. One variant shows similar product recommendations and the other features cross-sell ones. By running both variants in a single Dynamic Content campaign with a goal set to maximize performance based on a metric, AI engine allocates the best preforming content variant to more customers. ## Prerequisites --- - [Implement SDK to a website](/developers/web/installation-and-configuration) - [Configure the feed for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable Similar and Cross-sell recommendations. - Implement a custom event for adding a product to favorites, which will be available in the customer profile. In this example, the event is called `product.addToFavorite`. Implement custom events in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-favorites) or [website](/developers/web/event-tracking#declarative-tracking-custom-events). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggregate) that returns products added to favorites. 1. [Prepare similar AI recommendations](#prepare-similar-ai-recommendations). 2. [Prepare cross-sell AI recommendations](#prepare-cross-sell-ai-recommendations). 2. [Create two variants of the dynamic content campaign](#create-two-variants-of-the-dynamic-content-campaign) with two item recommendation variants (similar and cross-sell) using the predefined dynamic content web layer template. ## Create an aggregate --- In this part of the process, create an aggregate that will return the products customers added to favorites. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. Select the **product.addToFavorite** event. 5. Select the **sku** parameter. 6. Define the period from which the aggregate will return products from the event. 7. Save the aggregate.
Decision Hub Last aggregate returning the SKU of the last product added to favorites
Configuration of the aggregate
## Prepare similar AI recommendations --- In this part of the process, you will configure a similar items recommendation with context of items that customers added to their favorites. This recommendation will be later used in the dynamic content. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Similar items** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters), [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters) and [Distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter) 4. Confirm by clicking **Apply**. 8. Optionally, you can define settings in the **Slots and items ordering** and **Boosting** sections. 9. In the **Additional settings** section click **Define**. 1. Enable the **Item context from analytics (aggregate, expression)** switch. 2. From the dropdown list, select the aggregate you created [in this part of the process](#create-an-aggregate). 3. Click **Apply**. 9. In the right upper corner, click **Save**. 10. Copy the recommendation ID from its URL and save it in the notepad. It will be needed in the further part of the process. ## Prepare cross-sell AI recommendations --- In this part of the process, you will configure a cros-sell recommendation with context of items that customers added to their favorites. This recommendation will be later used in the dynamic content. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Cross-sell** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters), [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters) and [Distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter) 4. Confirm by clicking **Apply**. 8. Optionally, you can define settings in the **Slots and items ordering** and **Boosting** sections. 9. In the **Additional settings** section click **Define**. 1. Enable the **Item context from analytics (aggregate, expression)** switch. 2. From the dropdown list, select the aggregate you created [in this part of the process](#create-an-aggregate). 3. Click **Apply**. 9. In the right upper corner, click **Save**. 10. Copy the recommendation ID from its URL and save it in the notepad. It will be needed in the further part of the process. ## Create two variants of the dynamic content campaign --- Create two variants of a dynamic content campaign (each must be a web layer type). Every variant must reference a recommendation generated earlier in the process. The dynamic content campaigns will be displayed as a pop-up on your site for the customers who have added products to their favorites. 1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Web layer** type. 4. In the **Audience** section, click **Define**. 1. In the **New Audience** section, click **Define conditions**. 2. From **Choose filter** dropdown menu, choose **product.addToFavorite** event. 3. Define the period from which the segmentation will return customers. 4. Confirm the settings by clicking **Apply**. 5. Confirm the settings by clicking **Apply**. ### Define the first variant content 5. In the **Content** section, click **Define**. 6. In the **Content** tab, click **Create Message**. 7. From the list of template folders, select a folder with the predefined **Web layer templates**. **Result**: You are redirected to the list of predefined templates.
Web layer templates folder
Web layer templates folder
8. Select the **Recommendations** template. **Result**: You are redirected to the template builder.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-variable)) and/or by [filling out the form in the Config tab](/use-cases/dynamic-content-item-context-recommendation#edit-the-form-in-the-config-tab). In this use case, we will use the capabilities of the predefined Config tab.
#### Edit the form in the Config tab The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. 1. From the **Recommendation campaign** dropdown list, select the ID of the similar recommendation campaign you created [in the previous step](#prepare-similar-ai-recommendations). You can find it by typing its name or ID in the search box. 2. In the **Header text** field, define the header text to appear in the pop-up. 3. In the **Currency** field, specify the currency in which you want to display the prices of the recommended products. 4. In the **Bottom text** field, define the copy you want to appear in this section. 5. In the **Font** field, define the font of all text displayed in the dynamic content. 6. Define the colors in the **Bottom bar background** and **Bottom bar text color** fields. 7. Choose the most suitable carousel scrolling method for you by enabling one or all toggles at the same time: - **Carousel autoplay**: activation of this toggle allows automatic scrolling of items in the carousel; - **Carousel loop**: activation of this toggle allows users to navigate to the first item in the carousel by clicking the arrow after the last item displayed in the carousel; - Enabling these two options at the same time will combine these functionalities. In this case, the recommendation carousel will scroll automatically and return to the first item automatically after displaying the last one. - If you don't activate any of the toggles, users will have to scroll through the carousel on their own, and when they get to the last item, it won't automatically redirect them to the beginning of the carousel. 8. In the following fields, define the item amount that you would like to display in small, medium, large and extra large screens. 7. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer and define the product context. 3. Click **Apply**.
If you are using custom attributes in your product feed, you need to replace the names of the standard attributes used in the template code with the names of the attributes used in your feed. In our case, we changed the names of following attributes (according to the custom attribute names used in our product feed): - `link` -> `productUrl` - `imageLing` -> `image` - `title` -> `name` - `item.price.value`-> `item.price` - `item.salePrice.value` -> `item.salePrice`
4. If the template is ready, in the upper right corner click **Save this template > Save as**. 5. On the popup: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 6. To continue the process of configuring the dynamic content campaign, click **Next**. 7. To save your content changes, click **Apply**. ### Define the second variant content 5. In the **Content** section, duplicate the **Variant A** tile. 6. On the template preview, click **Edit content**. #### Edit the form in the Config tab 1. From the **Recommendation campaign** dropdown list, select the ID of the cross-sell recommendation campaign you created [in the previous step](#prepare-cross-sell-ai-recommendations). You can find it by typing its name or ID in the search box. 2. Make changes to the template according to your needs. 4. If the template is ready, in the upper right corner click **Save this template > Save as**. 5. On the popup: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 6. To continue the process of configuring the dynamic content campaign, click **Next**. 7. To save your content changes, click **Apply**. #### Configure the content variants AI engine allocation 1. Enable the **Make allocation automatically** toggle to let the AI engine allocate the content variants to customers. 2. In the **Optimization goal** section that appears, define the goal of dynamic content to **Maximize**. 3. To define the metrics of the goal, click **Define goal**. 1. To select an event, click **Choose event**. In our case we want the AI engine to consider the **Clicked dynamic content** event. 2. Confirm the settings by clicking **Apply**. 4. Click **Apply**.
You can find more information about AI-driven variant allocation and how to check its performance in [the "Enabling AI-driven variant allocation" section](/docs/campaign/dynamiccontent/creating-dynamic-content/creating-dynamic-content#enabling-ai-driven-variant-allocation).
The view of how the traffic is divided among campaign variants and how those variants perform
Example of how the traffic is divided among campaign variants and how those variants perform
### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## What's next --- After launching the campaign, you can check and export the results — see which variant won, view the conversion probability, and more. In addition, Variant optimizer generates a `variant.assign` event, which can be used to create your own analytics or dashboards.
The view of how the traffic is divided among campaign variants and how those variants perform
Example of how the traffic is divided among campaign variants and how those variants perform
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/8b2c2e9e-24e0-30ff-aca6-a9f024a99306) - [Similar Recommendation](https://app.synerise.com/ai-v2/recommendations/CWP9JaQ05YAB) - [Cross-sell Recommendation](https://app.synerise.com/ai-v2/recommendations/wE6iwEZvqwsg) - [Dynamic content](https://app.synerise.com/campaigns/dynamic-content/create/98b9ba9e-2b6c-4aeb-9dd5-dcb7f4a29a7a) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`product.addToFavorite`](/docs/assets/events/event-reference/items#productaddtofavorite) (~1), [`variant.assign`](/docs/assets/events/event-reference/search#variantassign) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic content template builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder) - [Recommendations](/docs/ai-hub/recommendations-v2) # Automated Replenishment Email with Upsell Recommendations You can encourage customers to reorder items that they have previously purchased, to meet demand. This kind of campaign increases the chances of making a purchase and thus increase your revenue. It might be useful especially in the FMCG industry, for products that sell quickly as coffee or milk. Additionally, we can use boosting to promote more products based on chosen indicators. Boosting rules are built using the same editor as the filters, but unlike filtering, boosting does not entirely exclude items that do not meet the conditions. In this use case, we will create the workflow which, after a month from the transaction, will send an email with recommended products from a specific category (coffee) to encourage the customer to reorder. The recommendation will be boosted by the personalization model to boost products whose price exceeds the average price of all the customer's transaction from a specific category. ## Prerequisites --- - Implement transaction events either through [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Create [an email account](/docs/campaign/e-mail/configuring-email-account) - Create [items feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) - **Recommended**: Become familiar with [creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/replenishment#create-an-aggregate) that calculates the average value of products from the `Coffee` category previously bought by the customer. 2. [Create the recommendation with boosting rules](/use-cases/replenishment#create-the-recommendation-with-boosting-rules). 2. [Create an email template](/use-cases/replenishment#create-an-email-template). 3. [Create a workflow](/use-cases/replenishment#create-a-workflow). ## Create an aggregate --- In this part of the process, create an aggregate that calculates the average value of products bought by the customer from `Coffee` category. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Average**. 4. From the **Choose event** dropdown list, select the `product.buy` event. 4. As the event parameter, select **$finalUnitPrice**. 5. Next to the **$finalUnitPrice**, click **+where**. 6. From the dropdown list, select **$category**. 7. As the operator, choose **Equal**. 9. In the text field, enter the value of the category you want to use in replenishment campaign - in this use case, it will be `Coffee`. 8. Define the period analyzed in the aggregate. 9. Save the aggregate.
Decision Hub Average aggregate returning the average finalUnitPrice of Coffee category product.buy events
Configuration of the aggregate
Configuration of this aggregate depends on the implementation of the transaction events and it might differ for each workspace.
## Create the recommendation with boosting rules --- In this step, we create a personalized recommendation that will be filtered to the coffee category. Additionally, we will apply boosting rules to this campaign to promote products whose price is higher than the average price of the previously purchased products from this category by a customer. ### Create the campaign --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. In the **Type & Items feed** section: 1. Select an item catalog. 2. As a recommendation type, select **Personalized recommendations**. 3. Click **Apply**. 3. In the **Items** section, configure at least one slot. 1. Choose the minimum and maximum number of products to be displayed in the recommendation frame. 2. In the **Static filter** section, click **Choose filter**. 3. Select **Visual Builder**. **Result**: The Visual Builder window appears. 4. From the **Select attribute** dropdown list, choose the **category** attribute. 5. As the logical operator, select **Equals**. 6. From the **Select value** dropdown list, select **Coffee**. 7. In the **Level range** field, enter `0`. 4. Click **Apply**.
Replenishment static filter section
Static filter section
### Build the boosting rule --- In this part of the process, you will build a rule that boosts the products whose price is higher than the average price a customer paid for the transaction during the specific period. 1. In the **Boosting** section, click **Define**. 2. Click **Add rule**. 3. Click **Define rule** and select **IQL Query**. **Result**: The IQL Query window opens. 4. Click the **Select** node. 5. From the dropdown list, select **Attribute**. 6. Click the **null** node. **Result**: The **Select value** button appears. 7. Click **Select value**. 8. From the dropdown list, select the **price** attribute. 9. Click the Plus icon 10. From the dropdown list, select **Context**. 11. Click the **null** node. **Result**: The **Select value** and **Property** buttons appear. 12. From the **Property** dropdown list, select **Aggregate context**. 13. From the **Select value** dropdown list, select an aggregate created in [the previous step](/use-cases/replenishment#create-an-aggregate). 14. Change the mathematical operator between the nodes to the greater-than sign (**>**). 8. Click **Apply**.
Boosting items
Boosting items with the price higher than the average value of order in this category
9. In the **Promote/Demote** selector, select **Promote** (default value). 10. Use the slider to adjust how much you want the rule to affect the results. 11. Save the **Boosting** section settings by clicking **Apply**. 12. Optionally, you can define the settings in the **Additional settings** section. 13. Save the recommendation. ## Create an email template --- In this part of the process, prepare an email template with the recommendation created in [the previous step](/use-cases/replenishment#create-the-recommendation-with-boosting-rules) that will encourage a customer to make another purchase from the specific category. 1. Go to Experience Hub icon **Experience Hub > Emails > Templates > Drag&drop builder** or **Code editor** to create an email template. 2. In the upper right corner, click **Inserts**. In the **AI Cart Recommendations 2** catalog, find [previously build recommendations](/use-cases/replenishment#create-the-recommendation-with-boosting-rules) on the list of inserts. 3. Copy and paste the Jinjava code of the recommendation and insert it to the template of your email. 4. Adjust the visual layer of the email to your needs. 4. Save your template. ## Create a workflow --- In this part of the process, create a workflow which is triggered by the `product.buy` event from `Coffee` category. The workflow will wait 30 days. If a customer did not make another purchase from this category after that period, we will send the email with the recommended products. 1. In Synerise, go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, add **Profile Event**. In the configuration of the node, select the event that triggers the workflow. In this use case, it's a `product.buy` event, 4. Click **+ where** and choose **$category**. 5. As the logical operator, select **Equal**. 6. In the text field, enter `Coffee`. 4. Confirm by clicking **Apply**. 5. As the second node, add **Delay**. In the configuration of the node, set the period to `30 days`. 6. As the next node, choose **Profile Filter** to check if customers have bought a product from the coffee category during last 30 days. To do this: 1. Choose the `product.buy` event. 2. As the parameter, choose **$category**. 5. As the logical operator, select **Equal**. 6. In the text field, enter `Coffee`. 3. Set the time range to last 30 days. 4. Click **Apply**. 7. To the **Matched** path, add the **End** node. 8. To the **Not matched** path, add the **Send Email** node. 9. In the **Send email** node configuration: 1. In the **Sender details**, define the account from which the email will be sent. 2. In the **Content** section: 1. Enter the subject of the email which will be visible in the customer's inbox. 2. Select the email template created in [the previous step](/use-cases/replenishment#create-an-email-template). 3. Optionally, you can add UTM and URL parameters. If not, click **Skip step**. 10. Confirm by clicking **Apply**. 7. Add the **End** node to finish the workflow. 8. Optionally, you can set up the capping for this workflow based on your business needs. 8. Click **Save & Run**.
Replenishment workflow
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the the configuration of each step from this use case in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/3b5d4f67-ed80-33d8-838f-00be16a0b5f7) - [Recommendation](https://app.synerise.com/ai-v2/recommendations/gHRu3EMcjO6w) - [Workflow](https://app.synerise.com/automations/automation-diagram/3b9158df-b63f-4845-a81e-a53adf9101c8) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 12 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Email campaigns](/docs/campaign/e-mail) - [Recommendations](/docs/ai-hub/recommendations-v2) # Automated Rotation of Dynamic Content Banners with Controlled Display Frequency Dynamic content campaigns are a powerful tool for delivering personalized and engaging experiences on websites. By enabling the rotation of promotional content, businesses can capture users’ attention with diverse messages. Automating this process allows for efficient management of campaigns, ensuring that each message reaches its audience without manual intervention or redundant displays. In this use case we will describe an example campaign consisting of four dynamic content campaigns that rotate dynamically within an upper-page banner. The campaigns will be created based on the predefined dynamic content templates. The rotation is powered by the on-demand trigger in Synerise, which allows campaigns to be triggered programmatically rather than displayed automatically. A fifth campaign, implemented with custom code, manages the rotation logic and ensures seamless control over the display of these banners. The objective is to: - eliminate the need for manual replacement of campaigns, - allow for easy future updates, - ensure a smooth and sequential display of promotional content. This approach ensures efficiency in managing dynamic content while providing flexibility for the client to make modifications independently. ## Prerequisites --- [Implement a tracking code](/docs/settings/tool/tracking_codes). ## Process --- In this use case, you will go through the following steps: 1. [Create dynamic content campaigns](/use-cases/rotating-dc#create-dynamic-content-campaigns) with on demand trigger. 2. [Prepare dynamic content campaign steering the rotation](/use-cases/rotating-dc#prepare-dynamic-content-campaign-steering-the-rotation). ## Create dynamic content campaigns --- In this part of the process, create a few different dynamic campaigns, which will be displayed on the upper-page bar. 1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Insert Object** type. 4. In the **Audience** section, click **Define**. You can choose **Everyone** or choose specific groups based on your business needs. 5. Confirm the settings by clicking **Apply**. ### Define content 5. In the **Content** section, click **Define**. 6. Click **Create Message**. 7. From the list of template folders, select **Insert Object templates** and choose the template based on your needs - in our example it will be **Message with buttons**. **Result**: You are redirected to the list of predefined templates.
Insert objects templates folder
Insert objects template with buttons
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-variable)) and/or by [filling out the form in the Config tab](/use-cases/dynamic-content-item-context-recommendation#edit-the-form-in-the-config-tab). In this use case, we will use the capabilities of the predefined Config tab. - Remember that you can also create your new template from scratch, or choose any other from exisitng templates.
6. To continue the process of configuring the dynamic content campaign, click **Next**. 7. To save your content changes, click **Apply**. ### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Choose the **On Demand** trigger. The campaign launched with this trigger will only be displayed when the dedicated SDK method is called on the website. With these settings, the campaigns remain active but are not rendered on the page.
On demand trigger
On demand trigger
3. You can define the advanced options such as frequency, URLs where the content will be displayed or when to stop it. In our case, we will define the frequency of dynamic content to be displayed to **Always**. The final frequency will be set up in the main campaign. You can also define the type of device you want to show your dynamic content. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**.
DC settings
DC settings
Create more dynamic content campaigns like the one above, ensuring that the placement settings and appropriate dimensions are maintained, as all campaigns will be displayed interchangeably in the same location. ## Prepare dynamic content campaign steering the rotation --- In this part of the process, you will create a main campaign that will automatically manage the previously created campaigns. The instructions contain JavaScript which identifies which dynamic content campaign to display and which ones to omit. The last displayed campaign is stored in localStorage to ensure the proper order of rotation. 1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Insert Object** type. 4. In the **Audience** section, click **Define**. You can choose **Everyone** or choose specific groups based on your business needs. 5. Confirm the settings by clicking **Apply**. ### Define content 5. In the **Content** section, click **Define**. 6. In the **Content** tab, click **Create Message**. 7. Click **New template** and choose **Code editor** 8. In **JS** tab add the following code:
(function () {
       function findLaunchSend() {
           const value = localStorage.getItem(`dcCampaignId`);
           const dcFirst = 'ffdb6568-e699-49fb-a3a7-5ce94ab1f04f';
           const dcSecond = 'c8c19320-82c7-4fc8-b1af-0feb561dcea5';
           const dcThird = '1cb31d0a-95ee-42fc-bc5e-95737e223992';
           const dcFourth = '41f3d86a-eb8c-4c97-b769-b72b05b0e1af';
           if (value === null || value === dcFourth) {
               SR.dynamicContent.get(dcFirst);
               localStorage.setItem('dcCampaignId', dcFirst);
           } else if (value === dcFirst) {
               SR.dynamicContent.get(dcSecond);
               localStorage.setItem('dcCampaignId', dcSecond);
           } else if (value === dcSecond) {
               SR.dynamicContent.get(dcThird);
               localStorage.setItem('dcCampaignId', dcThird);
           } else if (value === dcThird) {
               SR.dynamicContent.get(dcFourth);
               localStorage.setItem('dcCampaignId', dcFourth);
           } else {
               console.log("Invalid data in localStorage");
           }
       }
       findLaunchSend();
    })();
The script tracks the last displayed campaign using localStorage and ensures the next campaign is displayed in sequence. If no campaign has been displayed yet or the last one in the sequence was shown, it starts again from the first campaign. Here’s what you need to know and how to adapt it to your needs: - Change the campaign IDs: The script references four DC campaigns by their unique IDs (e.g., dcFirst, dcSecond, etc.). To find these IDs, navigate to the Synerise campaign editor, open each DC campaign, and copy the ID visible in the URL (a string of letters and numbers in the address bar). - Arrange the IDs in the desired rotation order.
5. After adding all changes, click **Use in communication**. 6. Click **Apply**. ### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Choose the **On Landing** trigger. 3. You can define the advanced options such as frequency, URLs where the content will be displayed or when to stop it. In our case, we will define the frequency of dynamic content to be displayed to **Maximum 3 in 1 Hours**. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [First DC campaign](https://app.synerise.com/campaigns/dynamic-content/create/ffdb6568-e699-49fb-a3a7-5ce94ab1f04f) - [Second DC campaign](https://app.synerise.com/campaigns/dynamic-content/create/c8c19320-82c7-4fc8-b1af-0feb561dcea5) - [Third DC campaign](https://app.synerise.com/campaigns/dynamic-content/create/1cb31d0a-95ee-42fc-bc5e-95737e223992) - [Fourth DC campaign](https://app.synerise.com/campaigns/dynamic-content/create/41f3d86a-eb8c-4c97-b769-b72b05b0e1af) - [Main DC which let you manage all campaigns](https://app.synerise.com/campaigns/dynamic-content/create/bba1cdae-04f4-40da-a289-acf6a6cdde61) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~2), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic content template builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder) # Sync Online and Offline Transaction Data with RTB House for Retargeting The RTB House engine, one of its kind powered by deep learning algorithms, identifies potential buyers and boosts performance via 1:1 ultra-personalized retargeting up to 50 percent more efficient than standard machine learning AI-based approaches. Thanks to the RTB House integration with Synerise, you can enhance your advertising performance by creating segments of people based on behavioral and contextual activities in your integrated online and offline ecosystem. You can choose among various segments in Synerise, for example - customers who are ready to buy or those with the highest propensity to purchase. The following example shows how to create a simple integration - sending all online and offline transactions to RTB House so that this data can be used in, for example, retargeting activities. ## Prerequisites --- Obtain the following data from RTB House (you need to contact their support): - `pkey`, which is a static key unique to your RTB house account, - hash of the source, needed to put into the `tag` parameter. ## Building the workflow --- 1. Go to **Automation Hub > Workflows > New workflow**. 1. Add a Profile Event trigger node, where the condition is only that the event is `transaction.charge` 2. Add an outgoing integration node: 1. As the integration type, choose **Custom webhook**. 2. As the method, select **POST**. 3. As the URL, paste the following string: `https://omni.creativecdn.com/partner/omni/postbacks?pkey=&uid={{customer['uuid']}}&time={{event.params.time}}&tag=pr__orderstatus2_{{event.params.$totalAmount}}_{{event.params.$orderId}}_{% set tab = [] %}{% for p in event.params.products %}{% do tab.append(p.sku) %}{% endfor %}{{tab|join(',')}}`
Click to see the explanation of the parameters
  • `pkey`: the unique static key of your RTB House account
  • `uid={{customer['uuid']}}`:the customer's identifier; UUID from Synerise database; inserted dynamically by Jinjava
  • `time={{event.params.time}}`: the timestamp of the event; Synerise uses Unix time; inserted dynamically by Jinjava
  • `tag`: contains the source hash and variables inserted dynamically by Jinjava: the cost of the transaction, the ID of the transaction in Synerise database, and all items in the transaction
1. In the URL, replace : 1. `` with the pkey you received from RTB House. 2. `` with the source hash you received from RTB House. 2. Leave the other integration parameters (headers, body, authorization) at default. **Result:**
Outgoing Integration definition
Outgoing Integration definition
1. Add an end node. 2. Click **Save and Run**.
Overview of the workflow
The structure of a complete workflow
## What's next --- To test the automation: 1. Send a `transaction.charge` event from a test customer profile. 2. Verify that an automation event is visible in the test profile's customer card. 3. Verify that the data from the test event was uploaded to RTB House. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integration](/docs/automation/integration) # Send a segmentation of customers with the highest propensity to buy to Amazon S3 Synerise allows you to collect data from any touchpoint with a customer. With advanced Synerise Decision Hub, you can create precise customer segments that you can use not only in Synerise, but also pass them to external tools. Using Synerise's seamless integration with Amazon S3, you can transfer any data collected in Synerise and use it in other Amazon services. In this use case, we will export a database of customers with the highest propensity to buy to Amazon S3. The process of creating a Propensity prediction and segmentation is already described in [this use case](/use-cases/propensity_based_promotion). The segmentation used in this use case is only an example. You can export any other segmentation or different data types as needed, such as transactions, event data, metrics results, aggregates, expressions, reports, and more. ## Prerequisites --- - You must have an account on AWS. - Create propensity prediction and segmentation with customers with the highest propensity to buy selected product category based on [this use case](/use-cases/propensity_based_promotion). ## Create a workflow --- Create a workflow which sends the customers' data to Amazon S3 every day. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 3. As the trigger node, add **Scheduled Run**. 4. In the configuration of the node: 1. Leave the **Run trigger** option at default (**all time**). 2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace. 3. Define the frequency of the workflow (for example, every day at 6.00 A.M.). The workflow will automatically launch at the scheduled time. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering file export to Amazon S3
The configuration of the Scheduled Run node
### Select customers to export 5. Add a **Get Profiles** node. 6. In the configuration of the node: 1. Select the segmentation you created earlier. 2. In the **Attributes** section, select the profile attributes which you want to export. In the example, `email`, `newsletter_agreement`, `firstName` and `lastName` are selected. 3. Confirm by clicking **Apply**. ### Configure Send file to Amazon S3 Bucket node 1. Click **Amazon S3 Bucket > Send File**. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/amazon-s3-bucket/send-file-amazon-s3-bucket#create-a-connection). - If you selected an existing connection, proceed with the integration settings. 4. In the **Region** field, enter the region of your bucket. 5. In the **Bucket** field, enter the name of an existing container in your storage. 6. In the **Path to directory** field, enter the path to the existing bucket in which the file will be saved. 7. In the **File name** field, enter the name of the file you want to send to the storage. If the file already exists, the contents of the file will be overwritten. 8. From the **File format** dropdown list, select the format in which the file will be saved in the storage. 9. Confirm by clicking **Apply**.
The configuration of the Send file to Amazon S3 Bucket node
The configuration of the Send File node
### Add the finishing node 12. Add the **End** node. 13. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending a file to Amazon S3
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [workflow](https://app.synerise.com/automations/automation-diagram/1a6f82da-b364-4d5a-aebb-e7c411783daf) created in this use case on our Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1). ## Read more --- - [Send File (Amazon S3 Bucket)](/docs/automation/integration/amazon-s3-bucket/send-file-amazon-s3-bucket) - [Workflows](/docs/automation) # Export Customer Profiles with Marketing Consent to Google Cloud Storage Synerise allows you to collect data from any touchpoint with a customer. With advanced Synerise Decision Hub, you can create precise customer segments that you can use not only in Synerise, but also pass them to external tools. Using Synerise's seamless integration with Google Cloud Storage (GCS), you can transfer any data collected in Synerise and use it in other Google tools. In this use case, we will send a customer database with a marketing communications agreement to Google Cloud Storage. Before creating the workflow, we will also create a transformation, which will modify the value of one of the exported attributes to another format. This is not a mandatory step, you can export the data in the format you store it in the platform, in accordance with your needs. ## Prerequisites --- - Implement solutions that collect marketing agreements from various touch points with your customers. - Prepare a sample of data that will be used in data transformation.
Click here to see an example file
email,newsletter_agreement john.doe@synerise.com,enabled kathy.smith@synerise.com,enabled lily.novak@synerise.com,enabled matt.turner@synerise.com,enabled
- Make sure you meet all [prerequisites](/docs/automation/integration/google-cloud-storage/send-file-to-gcp#prerequisites) to integrate Synerise with Google Cloud Storage. ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation of customers](/use-cases/send-profiles-to-gcs#prepare-a-segmentation) whose data you want to send to the GCS. 2. [Create a transformation](/use-cases/send-profiles-to-gcs#prepare-a-transformation) to prepare the data for sending to Google Cloud Storage. This is an optional step. If you don't need to change the exported data, you can skip it. 3. [Create a workflow](/use-cases/send-profiles-to-gcs#prepare-a-workflow) that will send selected customer profiles to GCS. ## Prepare a segmentation --- As the first part of the process, create a segmentation of customers who agreed to receive emails. The data of these customers will be sent to the external resource. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Define the name of the segmentation. 3. Click **Add condition**. 4. From the dropdown list, select `newsletter_agreement`. 5. As the logical operator, select **Equal**. 6. In the text field, enter `enabled`. 7. Click **Save**.
The configuration of the segmentation
The configuration of the segmentation
## Prepare a transformation --- This step is not mandatory, you can skip it in case you don't need to make any changes to the exported data. In this part of the process, you define the rules of modifying data before sending it to GCS. For the purposes of this case, the `newsletter_agreement` parameter value will be changed from `enabled` to `true`. The transformation which is the output of this part of the process is used later to [automate sending the data](/use-cases/send-profiles-to-gcs#prepare-a-workflow). 1. Go to Automation Hub icon **Automation Hub > Transformations > New transformation**. 2. Enter the name of the transformation. 3. Click **Upload a new file or drag one here**. ### Add file with sample data Upload a file to add a data sample. In further steps, you define how the data must be modified. Later, when this transformation is used in the workflow, the system uses the rules created with the sample data as a pattern for modifying actual data. 1. Upload the file with the sample data you prepared earlier. 2. Set **Delimiter** and provide **Quotation mark** and **Escape character**. 3. Click **Apply**.
Transformation file upload showing sample data for Google Cloud Storage profile export
The configuration of the file upload step
### Edit the newsletter_agreement value In this part of the process, you will use the **Edit Values** step. This step allows you to replace the `enabled` value of the `newsletter_agreement` attribute with `true`. 1. On the right panel, click **Add step**. 2. From the dropdown list, select **Edit Values**. 3. Click the **Edit Values** step. 4. In the configuration of the step: 1. Select the **newsletter_agreement** column. 2. Under **Edit values by**, from the dropdown list, select **Replacing**. 3. In the dropdown below, leave the **Static value** option at default. 4. In the text field, enter `true`. 5. Confirm by clicking **Apply**.
The configuration of the Edit Values step
The configuration of the Edit Values step
### Preview and save the transformation 1. Preview the results in the **Output** tab. 2. In the upper right corner, click **Save**.
Transformation changing newsletter agreement values for Google Cloud Storage profile export
The transformation configuration
## Prepare a workflow --- As the final part of the process, create a workflow which sends the customers' data every day to GCS. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 1. As the trigger node, add **Scheduled Run**. 2. In the configuration of the node: 1. Select the **Repeat runs** option. 2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace. 3. Define the frequency of the workflow (for example, every day at 6.00 A.M.). The workflow will automatically launch at the scheduled time. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering profile export to Google Cloud Storage
The configuration of the Scheduled Run node
### Select customers to export 1. Add a **Get Profiles** node. 2. In the configuration of the node: 1. Select **Segments** option and then the segmentation you [created in the first part of the process](/use-cases/send-profiles-to-gcs#prepare-a-segmentation). 2. In the **Attributes values** section, select **newsletter_agreement** and **email**. 3. Confirm by clicking **Apply**.
Automation Hub Get Profiles node selecting customers by segmentation with newsletter agreement and email attributes for Google Cloud Storage export
The configuration of the Get Profiles node
### Select the transformation 1. Add a **Data Transformation Studio** node. 2. In the configuration of the node, keep the default **From workflow context** option. 3. In the editor, click **Templates library**: 1. Select the [transformation you have created before](/use-cases/send-profiles-to-gcs#prepare-a-transformation). 2. Click **Use template**. 4. Confirm by clicking **Apply**.
You can also create a transformation directly in the **Data Transformation Studio** node instead of selecting a template. If you skipped the transformation, omit this node.
### Configure Send File node 1. Add **Google Cloud Storage - Send File** node. 2. Select **Sign in with Google** option and click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/google-cloud-storage/send-file-to-gcp#create-a-connection). - If you selected an existing connection, proceed with the integration settings. 4. In the **Project ID** field, enter the unique identifier of your project in Google Cloud. You can learn how to find the project ID [here](https://support.google.com/googleapi/answer/7014113). 5. In the **Bucket** field, enter the name of an existing bucket (container) to which you will send a file with data. 6. In the **Path to directory** field, enter the path to which the file will be saved in the bucket. 7. In the **File name** field, enter the name of the file you want to send to the storage. If the file already exists, the contents of the file will be overwritten. 8. From the **File format** dropdown list, select the format in which the file will be saved in the storage. 9. Confirm by clicking **Apply**.
The configuration of the Send file to Google Cloud Storage node
The configuration of the Send File node
### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending profiles to Google Cloud Storage
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each item created in this use case on our Synerise Demo workspace: - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/7655038e-99bc-4876-9d7a-90f801ae6a5c) - [Transformation](https://app.synerise.com/automations/data-transformation/032c34b2-1eae-4542-98db-5392244119aa) - [Workflow](https://app.synerise.com/automations/automation-diagram/56ba2ace-197f-4361-b9ef-db5aab607656) ## Generated events This use case generates approximately 6 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `googleCloudStorage.sendFile` (~1). ## Read more --- - [Data Transformation](/docs/automation/data-transformation-and-imports/introduction) - [Send File](/docs/automation/integration/google-cloud-storage/send-file-to-gcp) - [Segmentations](/docs/analytics/segmentations) - [Workflows](/docs/automation) # Email with Contextual Recommendations Based on Last Visited Products Drive conversions and foster long-lasting customer relationships with personalized recommendations by analyzing customers' browsing history. By curating a tailored selection of similar items and recommending relevant products, you can boost sales, elevate the shopping experience, and increase engagement with just an email. This use case describes the process of creating a set of personalized recommendations of products similar to the last seen by the customer and sending them in an email to customers who had a transaction in the last 30 days. This use case provides you with an instruction how to use a ready-made email template that can be used 1:1 in a business scenario.
Email with similar recommendations
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable similar items recommendations. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Configure a [sender account](/docs/campaign/e-mail/configuring-email-account). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggregate) returning the ID of the last visited product, it will be used in the template configuration. 2. [Prepare an AI recommendation](#prepare-an-ai-recommendation), it will be used in the template configuration. 4. [Prepare an email template](#prepare-an-email-template). 3. [Create a workflow](#create-a-workflow). ## Create an aggregate --- In this part of the process, create an aggregate that returns the ID of the last product a customer had visited. The recently viewed product itself will not display in the template, but will serve as a context for recommendations. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown list, select the **Visited page** event. 5. As the event parameter, select **product:retailer_part_no**. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select the **product:retailer_part_no** parameter. 8. From the **Choose operator** dropdown list, select **Is true (Boolean)**. 9. Using the date picker in the lower-right corner, set the time range to **Last 7 days**. Confirm your choice with the **Apply** button. 7. Click **Save**.
Decision Hub Last aggregate returning the product ID of the last visited product page in the past 7 days
Configuration of the aggregate returing the ID of the last seen product
## Prepare an AI recommendation --- In this part of the process, you will configure a similar items recommendation which will be later used in the email template. You can use a differenct recommendation type according to your business needs. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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 an item feed. 5. In the **Type** section, choose the **Similar items** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 4. Confirm by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors and settings in the **Additional settings** section. 9. In the right upper corner, click **Save**. ## Prepare an email template --- In this part of the process, you will create an email campaign. We will use a predefined template for the recommendations similar to last seen products, so there is no need to create a template from scratch. In the configuration, we will use the [aggregate](#create-an-aggregate) and [recommendation](#prepare-an-ai-recommendation) created in the previous steps. 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left pane, click **Templates** and from the list of template folders, select **email default templates**. 3. Select **Products similar to last seen** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
### Edit form in the Config tab --- The form in the **Config** tab is pre-filled with default values, which you can modify to suit your business needs. 1. In the **Logo** section, you have the option to customize the logo's height, link, title, and image source. 2. In the **Main image** section, you can specify the height, link, title, and the source of the main image. 3. In the **Last seen product** section, from the **Aggregate id with last seen product** dropdown list, select the [aggregate you created in the previous step](#create-an-aggregate). You can find it by typing its name or ID in the search box. 4. In the **Recommendation header** section, you can type the header you want to display and define the background and font colors. 5. In the **Recommendation products** section: 1. From the **Recommendation id** dropdown list, select the [recommendation you prepared in the previous step](#prepare-an-ai-recommendation). You can find it by typing its name or ID in the search box. 2. Customize the **Number of product in row**, **Product name font color**, **Font color**, **Button font color**, **Button background color**, **Button border radius** and **Button text** options. 6. Optionally, you can configure **Category section**, **Contact section**, **Social media** and **Footer** or hide them by switching off the respective toggle.
To preview the template without switched off sections, use the **Preview Contexts** option.
7. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
The view of the Edit form in the Config tab
Edit form in the Config tab
8. If the template is ready, click the arrow next to **Use in communication** in the upper right corner, and from the dropdown select **Save as**. 9. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Save**. ## Create a workflow --- In this part of the process, you will create the workflow which sends emails with recommendations of products similar to those last seen by a customer, triggered when they finish their session on the site. The email will be sent maximum once a month, to customers who didn’t make a purchase in the last 30 days. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node At this stage, we will configure the 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 the `session.end` event. 2. Confirm by clicking **Apply**. ### Define the delay Add the Delay node to define the lag between the `session.end` event and sending an email with voucher to specific segment of customers. In this example it is 1 hour. 1. Add the **Delay** node, in the configuration of the node: 1. In the **Delay** field, enter `1`. 2. From the **Unit** dropdown, choose **Hour**. 3. Confirm by clicking **Apply**. ### Define the Profile Filter node As the next step, add the **Profile Filter** node, which checks if the customer made a transaction in the last 30 days. If the customer has not made a transaction, we will send them an email with recommendations, and if they have, then the workflow ends. 1. Add the **Profile Filter** node. 2. From the **Choose filter** dropdown list, select the **transaction.charge** event. 4. Using the date picker in the lower-right corner, set the time range to **Custom> Last 30 days**. Confirm your choice with the **Apply** button. 5. Click **Apply**. ### Configure the Send Email node 1. To the **Not matched** path, add the **Send Email** node. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, type the **Subject** and from the **Template** dropdown, select [the template you prepared in the previous step](#prepare-an-email-template). 3. In the **UTM & URL parameters** section, you can define the UTM parameters added to the links included in the email. 4. In the **Additional parameters** section, you can optionally assaign [parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters), which will be added to every event generated by this communication. 2. Click **Apply**. ### Add the finishing nodes and set capping 1. Add the **End** nodes after **Send Email** node and to the **Matched** path after the **Profile Filter** node. 2. In the upper right corner, click **Set Capping** and define the limit of workflows a profile can start: 1. Set **Limit** to 1. 2. Set **Time** to 30 days. 4. Confirm by clicking **Apply**. 5. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending emails with similar product recommendations
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/1162c599-338f-32f7-ba20-b1bb64fcaed0) - [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/pcJ44bk6rXz2) - [Workflow](https://app.synerise.com/automations/automation-diagram/8b4368c2-9a57-4340-a20f-976664c7cd75) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per profile that completes the flow: [`session.end`](/docs/assets/events/event-reference/web-and-app#sessionend) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Email template builder](/docs/campaign/e-mail/creating-email-templates/email-code-editor) # Personalization of the main banner on the homepage Customers are looking for personalized experiences that make their shopping journey more enjoyable. To extend the solutions you have already implemented on your site, you can combine several features to deliver greater value to the customer. You might consider creating a personalized banner on the homepage with product recommendations from a specific category and subcategories presented in a customized form. For example, you can display the product from a specific category with a personalized background matching the featured category and subcategories presented in the form of linked tiles. This use case describes the process of creating a personalized banner on the main page using section and attribute recommendations.
Example of store location Search Engine
## Prerequisites --- - Implement [Synerise tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Create an [item catalog](/docs/ai-hub/recommendations-v2/item-feed-requirements). - You must [configure the AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations): - Enable the Section page model. - In the **Attributes for distinct filters** section, you must select the attributes which will be available for use in the **Item attribute** field when [creating a section page recommendation](/docs/ai-hub/recommendations-v2/creating-section-recommendations#configure-item-settings). In the **Item attribute** field you will choose the item feature (for example, brand) based on which the items will be selected for a slot in the recommendation. If this step is skipped, the field will remain empty, making it impossible to complete the recommendation. - Create [Metadata catalogs](/docs/ai-hub/item-feed/metadata-catalog) that include additional information about section attributes. For example, suppose your section attribute is a category. In that case, such a metacatalog must include additional category information, such as an image or link to the category and other custom information to help you represent the category.
Click to see a sample metacatalog
Example of a metacatalog
Example of a metacatalog
## Process --- In this use case, you will go through the following steps: 1. [Create section recommendation](/use-cases/banner-personalization-on-homepage#create-section-recommendation). 2. [Create attribute recommendation](/use-cases/banner-personalization-on-homepage#create-attribute-recommendation). ## Create section recommendation --- Create a section recommendation to display a slot with personalized item recommendations based on item categories. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation. 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. Below, select the **Section page** recommendation type. 6. From the **Metadata catalog** dropdown, select the catalog that includes additional information about items in your feed. 7. Confirm the settings by clicking **Apply**. 8. In the **Items** section, click **Define**. 9. Click **Add slot**. 10. In the **Number of sections** field, enter the number of rows you want to dedicate to display recommendations. In this case, enter `1` to create only one raw. 11. In the **Number of items in a section**, enter the maximum number of items to be displayed in one section. In this case, enter `1` to display only one item in the section. 12. From the **Item attribute** dropdown, choose the attribute of the item based on which the item will be selected to the section. 13. Optionally, define **Static filters** and **Elastic filters**. 14. Save the changes by clicking **Apply**. 15. Optionally, define the **Boosting** factors. 16. Configure the **Additional settings** section. 17. Save the recommendation. ## Create attribute recommendation --- Create an attribute recommendation to recommend an item attribute without showing the item in the recommendation frame. In this case, you will return the linked product subcategory titles based on the category returned in the [first recommendation](/use-cases/banner-personalization-on-homepage#create-section-recommendation). 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation. 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. Below, select the **Attribute** recommendation type. 6. From the **Metadata catalog** dropdown, select the catalog that include additional information about items in your feed. 7. In the **Items** section, click **Define**. 9. Click **Add slot**. 10. In the **Number of items**, enter the minimum and maximum number of items to be displayed in a recommendation frame. In this case, enter `1` in **Minimum number of items** and `3` in **Maximum number of items**. 11. From the **Item attribute** dropdown, choose the attribute that will represent an item in the recommendation frame. 12. Save the changes by clicking **Apply**. 13. Optionally, define the **Boosting** factors. 14. Configure the **Additional settings** section. 15. Save the recommendation. ## What's next --- You can display the recommndation to customer for example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Check the use case set up on the Synerise Demo workspace You can also check the [section recommendation](https://app.synerise.com/ai-v2/recommendations/YgSVYsukXhBb) and [attribute recommendation](https://app.synerise.com/ai-v2/recommendations/9Y2tPsBpccw8) directly in Synerise Demo workspace If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~2), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~2), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating catalogs](/docs/assets/catalogs/creating-catalogs) - [Dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content/?helpCenterAi=dynamic) - [Recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) # Category promotion By focusing on specific product categories, you can curate promotions that resonate with your customers' unique needs. Unlock the ability to connect with your customers during special occasions that matter most to them. Whether it's the back-to-school rush, festive holidays, or the start of barbecue season, category promotions allow you to deliver precisely timed offers that align with your audience's interests. Elevate your business promotional strategy with Synerise and harness the power of precision marketing to elevate customer engagement and enhance conversion rates. In this use case, you will create a back-to-school promotion for electronics category, valid only once per customer. ## Prerequisites --- - Implement Promotions with [SDK mobile in your mobile application](/developers/mobile-sdk/loyalty) or through [API](https://hub.synerise.com/api-reference/authorization#tag/Authorization/operation/profileLogin) in any channel. - [Implement transactional events](/developers/web/methods-reference#tracking-transactions). - [Import the product feed to a catalog](/use-cases/import-product-feed-to-catalog). - Create a specific category filter in the product catalog to be reused while preparing the promotion.
Click here to see how to build the filter
  1. Go to Data Modeling Hub > Catalogs.

  2. On the list find the catalog in which you want to create the filter.

  3. On the right side of the screen, click

    Clicking the filter icon

  4. Click Define.

  5. On the pop-up, define the conditions by clicking Choose filter. The list contains all parameters from the product feed.

    The view of filter configuration for category
    Filter configuration for category
  6. Name and save the filter by clicking Save filter.

## Create a promotion --- Create a promotion for one specific category [using the catalog filter created as part of the prerequisites](#prerequisites). The promotion gives a 15% discount for items from the specified category and is valid only once per customer. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add Promotion**. 2. Enter a name for the promotion. 3. Select the **For selected items** type of promotion. 4. In the **Audience** section, choose **Everyone**. 5. In the **Content** section: 1. Define the name, descriptions, thumbnail and image of the promotion. 3. Optionally, you can add tags to the promotion and JSON code with advanced parameters. 2. Confirm the settings by clicking **Apply**.
The view of Content configuration
Content configuration
6. In the **Type and limits** section: 1. In **Type section**, leave the selection at default (**General**). 2. In the **Priority** field, enter a number that defines the priority for the promotion.
Priority defines the order of display in the customer’s view. 1 is the highest priority. If two or more promotions applicable to a customer have the same priority, the order of display is determined by the date of creation. The one that was created earlier takes the priority over the other promotion.
3. Select the **Single** tab (default). 4. In the **Limit per profile** field, type 1. 5. From the **Discount type** dropdown list, select **Percentage**. 6. From the **Discount mode** dropdown list, select **Static**. 7. In the **Value** field, type 15. 8. Confirm the settings by clicking **Apply**.
AI Hub promotion Type and limits section with single 15% percentage discount limited to one per profile
Type and limits configuration
7. In the **Schedule** section, specify the time, when you want to display your promotion according to your business needs. 8. In the **Items** section: 1. From the **Source catalog** dropdown list, select a catalog of items. 2. In the **Include items** section, choose **Filtered items**. 3. From the **Select filter** dropdown list, select [the filter created as a part of the prerequisites](#prerequisites).
AI Hub promotion Items section showing filtered items from a selected catalog
Type and limits configuration
9. To apply configuration and run the promotion, click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [promotion configuration](https://app.synerise.com/campaigns/promotions/5486dfe0-92e2-4f2f-aa9b-901457489f47) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Promotions](/docs/ai-hub/promotions) # Send Automated Slack Messages Based on Metric Results You can integrate Synerise with Slack using a dedicated node to build a variety of business scenarios. One of them is building a workflow that sends messages to a Slack channel based on metrics, expressions, reports or any other analyses created in Synerise. This particular use case reuses a metric (which is a part of an analytical dashboard) that counts the number of customers who signed up for the video call the day before. The message to the channel contains information with the value of the metric.
Screenshot presenting personalized search on a website with no results
Slack integration
## Prerequisites --- - Create [an incoming webhook in Slack](https://api.slack.com/messaging/webhooks). - Implement [an event](/docs/assets/events/event-definitions) that you want to use in the metric whose result will be sent in a message to a Slack channel.
In this use case, we track data from the form that enables to sign up for the video call using [SDK form tracking method](/developers/web/tracking-form-data/tracking-form-data-sdk). This method generates a `form.submit` event which we will later used in the metric. Learn more about other ways to implement events using [web SDK](/developers/web/event-tracking#declarative-tracking-custom-events), [mobile SDK](/developers/mobile-sdk/event-tracking) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent).
## Process --- 1. [Create a metric in Synerise](/use-cases/slack-integration#create-a-metric-in-synerise). 3. [Create a workflow in Synerise](/use-cases/slack-integration#create-a-workflow-in-synerise). ## Create a metric in Synerise --- In this step, we will create a metric whose result will be later sent in the Slack message. The configuration is exemplary, it may vary depending on your implementation of events. 1. In Synerise, go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Leave the metric kind at default (**Simple**). 3. Leave the metric type at default (**Event**) 2. From the **Choose event** dropdown list, select the **form.submit** event. 3. As the event parameter, select the **formType**. 4. As a logical operator, select **Equal (String)**. 5. In the text field, enter `videocall`.
Configuration of the metric that calculates the number of sign-ups for a video call the day before
Configuration of the metric that calculates the number of sign-ups for a video call the day before
In this use case, the metric is included in the [analytical dashboard](/docs/analytics/analytics-dashboard) which is later linked in the alert message in Slack.
## Create a workflow in Synerise --- In this part of the process, you will create a workflow that sends a message to a Slack channel with the number of customers who signed up for a video call. The message will contain the metric result and the link to the analytical dashboard that contains the metric. 1. In Synerise, go to **Automation Hub > Workflows > New workflow**. 2. Start with the **Scheduled Run** node. In the configuration of the node: 1. Set the **Run trigger** option to **all time**. 2. Select the **Everyday** tab. 3. Select the time zone. 3. Select the time when the workflow will be launched. 4. Confirm by clicking **Apply**.
Configuration of the workflow that sends alert messages with the metric results to the Slack channel
Configuration of the workflow that sends alert messages with the metric results to the Slack channel
### Configure Slack Integration node In this step, you will configure the settings of the outgoing integration that sends the message to a Slack channel. #### Create a connection 1. On the **Scheduled Run** node, click **THEN**. 2. From the dropdown list, select **Slack > Send Channel Message**. 3. In the configuration of the node: - If you already create a connection, select the connection from the list. - If you haven't created any connection yet: 1. At the top of the dropdown list, click **Add connection**. 2. In the **Incoming Webhook URL** field, enter the incoming webhook URL you created as a part of [prerequisites](/use-cases/slack-integration#prerequisites). 3. Click **Next**. 4. In the **Connection name** field, enter the name for the connection you created. 5. Click **Apply**. **Result**: A connection is created and selected. #### Define the integration parameters 1. In the **Type of message** field, choose **interactive message (JSON)**. 2. Below add JSON body of message which should be sent to Slack channel.
{
       "blocks": [
           {
               "type": "section",
               "text": {
                   "type": "mrkdwn",
                   "text": "Number of people signed in for the videocall: `{% metricsvar metric_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX %}{{ metric_result }}{% endmetricsvar %}`\nNumber of people having the videocall today: `{% metricsvar metric_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX %}{{ metric_result }}{% endmetricsvar %}`"
               },
               "accessory": {
                   "type": "button",
                   "text": {
                       "type": "plain_text",
                       "text": "check dashboard",
                       "emoji": true
                   },
                   "url": "https://app.synerise.com/spa/modules/dashboards/analytics/dashboards/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
               }
           }
       ]
       }
In the JSON body: - Insert the ID of the metric you created in the [previous step](/use-cases/slack-integration#create-a-metric-in-synerise). - Optionally, if you want to refer users to the analytical dashboard, for the `url` parameter, insert the link to the dashboard. If you choose not to, remove the `accessory` object from the JSON body. 3. Confirm by clicking **Apply**. 5. Add the **End** node. 6. Launch the workflow by clicking **Save&Run**.
Configuration of the workflow that sends alert messages based on the metric results to the Slack channel
Configuration of the workflow that sends alert messages based on the metric results to the Slack channel
**Result**: The message is sent to the Slack channel.
Message on the Slack channel
Message on the Slack channel
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Metric](https://app.synerise.com/analytics/metrics/b4a6958d-7f86-47d6-a8c8-c89fe1c76aba) - [Workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/3509dfae-73b4-4333-9e16-c3d957568748) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`slack.sendChannelMessage`](/docs/assets/events/event-reference/integration#slacksendchannelmessage) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integration](/docs/automation/integration) - [Inserts](/developers/inserts) # Similar recommendations from the same category This recommendation focuses on showing similar products to the one currently viewed on the page. It aims to help users discover alternatives within the same category while avoiding exact duplicates. The logic is split into two slots to balance precision and completeness, ensuring a consistent and meaningful recommendation experience. In this use case, the recommendation returns 12 products, divided into two slots: - Slot A returns 1 to 4 items using a static filter. Recommended products must have the same category and categoryId as the context product but a different title and item ID, ensuring that only distinct alternatives are shown. - Slot B fills the remaining space with 4 to 8 products using an elastic filter. It still excludes items with the same title or ID but allows for more variation, such as partial name matches or model variants, to increase coverage when Slot A produces limited results. These two slots together form a complete "You may also like" recommendation block, where: Slot A focuses on quality (diverse alternatives), Slot B ensures quantity (variants and similar products). ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable similar recommendation model. - Implement the [transaction events](/developers/web/transactions-sdk). ## Prepare an AI recommendation --- We will configure similar recommendation which returns 2 slots. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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 an item feed. 5. In the **Type** section, choose the **Similar recommendation** type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 2. Define the minimum and maximum number of items that will be recommended to the customer in the first slot. In our case it will be 1-4. 3. Define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters). 4. Click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **category**. 6. As an operator, choose **Equals**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Context** (eye icon). 7. As the value, choose `category`, to be sure that the category of recommended products will be the same as the category of the currently viewed item. 8. In the **Category level** input, select **Category as a whole**. 9. Click **and where** to add another condition. 10. Choose **itemId**. 6. As an operator, choose **Does not equal**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Context** (eye icon). 7. As the value, choose `itemId`, to be sure that the itemId of recommended products will not be the same as the ID of the currently viewed item. 9. Click **and where** to add another condition. 10. Choose **name**. 6. As an operator, choose **Does not equal**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Context** (eye icon). 7. As the value, choose `name`, to be sure that the title of recommended products will not be the same as the name of the currently viewed item. 4. Confirm by clicking **Apply**.
AI Hub recommendation static filter showing items in the same category and categoryId as the currently viewed product, excluding items with the same title or ID
Configuration of the static filter
5. Add the second slot. 2. Define the minimum and maximum number of items that will be recommended to the customer in the first slot. In our case it will be 4-8. 4. In the **Elastic filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **category**. 6. As an operator, choose **Equals**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Context** (eye icon). 7. As the value, choose `category`, to be sure that the category of recommended products will be the same as the category of the currently viewed item. 8. In the **Category level** input, select **Category level - Take first (2)**. 9. Click **and where** to add another condition. 10. Choose **itemId**. 6. As an operator, choose **Does not equal**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Context** (eye icon). 7. As the value, choose `itemId`, to be sure that the itemId of recommended products will not be the same as the ID of the currently viewed item. 9. Click **and where** to add another condition. 10. Choose **name**. 6. As an operator, choose **Does not equal**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Context** (eye icon). 7. As the value, choose `name`, to be sure that the title of recommended products will not be the same as the name of the currently viewed item. 4. Confirm by clicking **Apply**.
AI Hub recommendation elastic filter showing items in the same top-level category as the currently viewed product, excluding items with the same title or ID
Configuration of the elastic filter
8. Additionally define the boosting rules by clicking **Define** in the **Boosting** section. 9. In the **Additional settings** section, choose **Exclude already bought products**. If your company sells replenishable products, you can set exclusion for specific number of days, for example, exclude products bought not later than 30 days ago. 9. In the right upper corner, click **Save**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/6gKg9VwwoAyC) in our Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~2), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Recommendations](/docs/ai-hub/recommendations-v2) # Extra points for purchase from specific category during specific time The pre-Christmas period is a very suitable moment for temporary actions to diversify basic loyalty programs, as it usually works well for your customers who have promised to themselves to buy a gift. You can launch a special time-limited promotion for a selected product category during the weekend right before Christmas for the purchase of which the customer can gain twice as many points. In this use case, we will present an example of an action that doubles points for the purchase of all products from the `Christmas` category during the pre-Christmas weekend. Customers who make such a purchase will receive an email with information about doubling of points for the specific purchase and the current points balance. ## Prerequisites --- - [Create an email account](/docs/campaign/e-mail/creating-email-campaigns). - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Implement basic [loyalty program](/use-cases/loyalty-programs-basics) based on which you granted customers with 1 point for every 1 PLN spent. - Create an [email template](/docs/campaign/e-mail) with the information about current point balance.
To add the current point balance dynamically to your email template, use the [expression insert](/developers/inserts/insert-usage#expressions) and use the ID of the [expression created in the next step](/use-cases/loyalty-points-for-category#create-an-expression-with-points-balance). The example usage of the expression insert: Your current loyalty points balance is {% expression %}EXPRESSION ID{% endexpression %} points.
## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- 1. [Create an aggregate](/use-cases/loyalty-points-for-category#create-an-aggregate) that returns the sum of loyalty points for an individual customer. 2. [Create an expression with points balance](/use-cases/loyalty-points-for-category#create-an-expression-with-points-balance). 3. [Create a workflow](/use-cases/loyalty-points-for-category#create-a-workflow) which doubles the points for every product from the `Christmas` category purchased during the specific weekend and sends the email with the final point status. ## Create an aggregate --- Create an aggregate that returns the sum of loyalty points for an individual customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Set the **Analyze profiles by** option to **Sum**. 4. Click the **Choose event** dropdown list. 5. From the dropdown list, select the event that is generated every time the customer is awarded with loyalty points, in this use case it's the `points.loyalty` event. 6. From the **+ where** dropdown list, select the `points` parameter. 7. Using the date picker in the lower-right corner, set the time range to **Lifetime**. 8. Save the aggregate.
The aggregate that sums points from the points.loyalty event
The aggregate that sums points from the points.loyalty event
## Create an expression with points balance --- In this part of the process, create an [expression](/docs/crm/expressions) which will be used to calculate points balance for the customer. In this use case, the expression is built based on the aggregate that returns the sum of loyalty points gained.
The described expression configuration is just an example. You can define additional conditions such as burned points or points added additionally for completing some other extra activity. It all depends on your business requirements and how your loyalty program is implemented.
1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the expression type at default (**Attribute**). 4. Build the formula of the expression. 1. Click the **Select** node. 2. From the dropdown list, select **Profile**. 3. Click the **unnamed** node that appeared on the canvas. 4. Scroll down the page and click **Choose attribute**. 5. On the dropdown list, select the aggregate for `points.loyalty` that you created [earlier](/use-cases/in-app-point-balance-reminder#create-an-aggregate). 6. Save the expression.
Behavioral Data Hub expression formula returning the points.loyalty aggregate value from a customer profile
The configuration of the expression
## Create a workflow --- Create a workflow which: - doubles the points for the purchase of every product from the `Christmas` category during the specific weekend, - sends the email message with the current point balance 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node At this stage, we will configure the conditions that launch the workflow. As a trigger, we will use the `product.buy` event. 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 2. From **Choose event** dropdown menu, choose the `product.buy` event. 3. Click the **+ where** button and from the dropdown list, choose **category**. 4. From the **Choose operator** dropdown, select **Equal**. 5. In the text field, type the name of the category. In our case it will be `Christmas`. 6. Click the **+ where** button and from the dropdown list, choose **TIMESTAMP**. 7. From the **Choose operator** dropdown, choose **Custom (Date)**. 8. Click **Select date range**. 9. Set the time range in which your promotion is active. In this use case, it will be the weekend before Christmas. 6. Confirm by clicking **Apply**.
Profile
Profile Event trigger node
### Configure the Generate Event node In this part of the process, you will create a node which generates a `points.loyalty` event which adds extra loyalty points. This event is created in addition to the regular `points.loyalty` event. In result, the customer receives points for a purchase from the `Christmas` category twice: 1. Points based on the [loyalty points schema](/use-cases/loyalty-programs-basics#prepare-the-points-schema) described as a part of prerequisites. 2. Extra points through this workflow. The body of the additional event will contain the `points` parameter calculated by multiplying the value of the `$finalUnitPrice` and `$quantity` parameters from the `product.buy` event. 1. As the second node of the workflow, add **Generate Event**. 2. In the **Event name**, enter `points.loyalty`. 4. In the **Body** section, define the parameters of this event, and click **Apply**. **Example content of **Body** section:**
{
     "points": "{{ event.params.$finalUnitPrice * event.params.$quantity }}",
     "promo": "ChristmasPromo"
   }
The event body is an example. You can add more parameters or change the point calculation, perform any mathematical formula according to your business needs.
Generate Event node configuration
Generate Event node configuration
### Configure the Event Filter node At this stage, we make sure the points have beed awarded to the customer before sending an email. 1. Add the **Event Filter** node. 2. Check **without limits**. 3. From the **Choose event** dropdown list, select the `points.loyalty` event (the same you generated in the [previous step](/use-cases/loyalty-points-for-category#configure-the-generate-event-node). 4. As the event parameter, select **promo** (the same parameter as in the body of the **Generate Event** node). 5. From the **Choose operator** dropdown list, select **Equal**. 6. As the value, enter `ChristmasPromo` which is the value of the `promo` parameter from the body of the **Generate Event** node. This way you make sure that a customer got extra points for the purchase. 7. Confirm by clicking **Apply**.
Event Filter node configuration
Event Filter node configuration
### Configure the Send Email node --- 1. Add a **Send Email** node to the **matched** path. 2. In the settings of the node: 1. Define the settings of the **Sender details** section. 2. In the **Content** section, enter the subject of the email and select choose the template of the email you have prepared as a part of the prerequisites. 3. Optionally define the settings in the **UTM & URL parameters** and **Additional parameters** sections. 2. Click **Apply**. ### Prepare the final settings --- 1. After **Send Email**, add the **End** node as well as to the **NOT MATCHED** path. 2. Optionally, define **capping**. 3. Optionally, add titles to each node so the workflow will be more understandable to your colleagues. 4. Activate the workflow by clicking **Save & Run**.
Automation Hub workflow for awarding loyalty points for category purchases
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the: - [aggregate with the points balance](https://app.synerise.com/analytics/aggregates/174ba14c-b0d7-372d-acb2-8f1365af3083) - [expression with the points balance](https://app.synerise.com/analytics/expressions/2d4c0862-31ac-43c7-a991-97a1e5455e8a) - [workflow doubling the points](https://app.synerise.com/automations/automation-diagram/db6e214d-59ee-49e1-ac73-62341017f825) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`points.loyalty`](/docs/assets/events/event-reference/loyalty#pointsloyalty) (~2), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Email campaigns](/docs/campaign/e-mail) - [Expressions](/docs/crm/expressions) - [Jinjava inserts](/developers/inserts) - [Loyalty programs basics](/use-cases/loyalty-programs-basics) # Lifetime value prediction Knowing how much money customers will spend in the next couple of days or weeks can be crucial for creating precise marketing campaigns. This use case describes how to make a prediction that returns the expected number of transactions in 90 days ahead for a specific group of customers.
LTV prediction
LTV prediction
## Prerequisites --- - [Integrate JS SDK](/developers/web/installation-and-configuration). - [Enable the Custom prediction model](/docs/ai-hub/predictions/enabling-predictions#enabling-regression-and-classification-predictions). ## Process --- In this use case, you will go through the following steps: 1. [Create prediction target](/use-cases/ltv-prediction#create-prediction-target) based on aggregate and expression. 2. [Create the segmentation](/use-cases/ltv-prediction#create-a-segmentation) for whom the prediction will be made. 3. [Create the prediction](/use-cases/ltv-prediction#create-a-prediction). ## Create prediction target --- In the first part of the process, create an analyses based on which the system will make a prediction. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Set the **Analyze profiles by** option to **Sum**. 4. Click **Choose event**. 5. From the dropdown list, select **transaction.charge**.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it's **transaction.charge**).
6. As the parameter of the event, select **$totalAmount**. 5. Using the date picker in the lower-right corner, set the time range to **Relative time range > Custom > last 90 days**. 6. Save the aggregate.
The formula of the aggregate
The formula of the aggregate
After building the aggregate, you have to create new expression. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Set the **Expression** to **Attribute**. Predictions work only with attribute expressions. 4. On the canvas, click **Select**. 5. From the dropdown list, select **Profile**. 6. Click the **unnamed** input that appeared on the canvas. 7. From the **Choose attribute** dropdown list, select the aggregate you created in the previous [part of the process](/use-cases/ltv-prediction#create-prediction-target). 8. **Save** the expression.
Behavioral Data Hub expression formula for LTV prediction using profile aggregate attribute
The formula of the expression
## Create a segmentation --- In this part of the process, create a group of customers for whom the prediction will be made.
The conditions of the segmentation can be very complex. It usually makes sense to analyze customers with some activities observed, so in this use case, the segmentation contains customers who have at least one page visit during the last 30 days.
1. Go to **Decision Hub > Segmentation > New segmentation**. 2. Enter the name of the segmentation. 3. Create a segmentation of customers who visited your website in the last 30 days.
You can find the instructions on creating segmentations [here](/docs/analytics/segmentations/creating-segmentations).
4. **Save** the segmentation.
The formula of the aggregate
Segmentation
## Create a prediction --- In this part of the process, create a prediction that returns the number of transactions that will be made in the 90 days in advance. 1. Go to AI Hub icon **(AI Predictions) Models > New prediction**. 2. On the pop-up, select **Create from scratch**, and then select **Regression**. ### Select the audience In this section, select the group of customers you created in [this part](/use-cases/ltv-prediction#create-a-segmentation) of the process.
Selecting the audience, especially its size, is always a trade-off between reach, duration of calculation and costs of data points produce.
1. In the **Audience** section, click **Define**. 2. Click **Choose segmentation**. 3. Select the the group of customers you created in [this part](/use-cases/ltv-prediction#create-a-segmentation) of the process. 4. Click **Apply**. ### Select the target 1. In the **What would you like to predict?** section, click **Define**. 2. Click **Select expression**. 3. From the dropdown list, select the expression you created in [this part](/use-cases/ltv-prediction#create-prediction-target) of the process. ### Select events [Events](/docs/assets/events/introduction-to-events) are customer activities on the website (visits to a website, adding a product to a shopping cart, and so on) and also your activities towards customers (such as sending messages to them). Select the events that the system will use as input to make a prediction. By default, the list already contains the events recommended for the prediction you are creating. The contents of the list is defined while enabling [Custom predictions](/docs/ai-hub/predictions/enabling-predictions#enabling-regression-and-classification-predictions). 1. Leave the **Auto-select events** option toggle on. ### Schedule recalculation and result settings In this section, define the frequency of recalculating the prediction and settings of the event that is generated for customers for whom the prediction is made. 1. In the **Prediction time window** section, from the **How many days in advance do you want to make a prediction?** dropdown list, select **90 days** as the number of days in advance. The time must correspond to the time range selected earlier in the prediction target. 2. In the **Calculation frequency** section, leave the settings at default (**One-time calculation**). As a result, the prediction is run only one time. 3. In the **Prediction start** section, leave the settings at default (**Immediately**). As a result, the prediction is calculated immediately after saving. 4. In the **How would you like to display results?** section, leave the settings at default (**5-point scale**). 5. In the **Define the value of the score name parameter** section, in the **Name** field, enter the user friendly name of predictions scores. The score name parameter is shown in the `snr.prediction.score` event. In our case it is 'Lifetime value'. 6. Click **Apply**. 7. Complete the prediction by clicking **Save&Calculate**. **Result**: The calculation begins. After it completes, an event named `snr.prediction.score` is saved to the customer profiles selected in the segmentation. The event will be available in the platform, for instance in Decision, Behavioral Data, and Automation Hubs. ## What's next --- You can use the prediction results in your work, for example to [Evaluate results](/use-cases/predictions-dashboard). ## Check the aggregate set up on the Synerise Demo workspace --- Check the settings of all analytics created in this use case in Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/84991085-f72c-3684-a1eb-57fc643830a8) - [Expression](https://app.synerise.com/analytics/expressions/ee582e83-0667-4580-b509-1ad1cd4aaad0) - [Segmentation](https://app.synerise.com/analytics/segmentations/11295db2-80c2-464e-b9be-61fa8e78b98b) - [Prediction](https://app.synerise.com/ai-v2/predictions/generic-scoring/ylhrexxshcak) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`snr.prediction.score`](/docs/assets/events/event-reference/predictions#snrpredictionscore) (~1). ## Read more --- - [Predictions](/docs/ai-hub/predictions) # Email with last viewed products Encourage your customers to buy the products they have looked at and potentially found interesting. Sometimes what they need to finalize the transaction is a reminder of their previous activity. Use email communication to remind customers about their last-viewed product. If the customers entered the store and viewed many products from your offer but in the end, they did not buy any of them and they left the site, you can wait for the selected period of time (for example, 3 hours) and send an email with pictures of the products they viewed. Sending the email an hour after the customer closes the session, can encourage them to return. You can also include information about things like free delivery, information about the product. ## Example of use - Retail industry A client from the retail industry (fashion) sent a communication with last seen products to customers who were on the site but did not make a transaction. In this email they could find products that they have recently viewed.
Screenshot presenting email with last viewed products
Email with last viewed products
**Results** Results from email: - 3,18% CTR, - 29,44% CTOR. ## Prerequisites --- To be able to implement this use case, check out articles: - [Implement a tracking code](/docs/settings/tool/tracking_codes). - [Create a sender account](/docs/campaign/e-mail/configuring-email-account). ## Process --- Creating an email with last viewed products, perform the steps in the following order: 1. [Prepare an aggregate](/use-cases/last-viewed-products#prepare-an-aggregate). 2. [Prepare the email template](/use-cases/last-viewed-products#prepare-the-email-template). 3. [Configure automation](/use-cases/last-viewed-products#configure-automation). ## Prepare an aggregate --- Build an aggregate which collects the SKUs of recently viewed products. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 1. Set **Analyze profiles by** to **Last Multi**. 2. In the **Size** field, enter the number of recent events (for example, 10). 3. Select the **Consider only unique occurrence of the event parameter** option. 4. Select the event **page visit** and the aggregate - in this case it will be the product id, which is stored in the OG tag called **retailer_part_no**.
Screenshot presenting aggregate
Configuration of the aggregate
## Prepare the email template --- Prepare an email template and include the ID of the catalog that contains items and the ID of the aggregate you prepared in the previous step. Those two ID will let you display last seen products by an individual customer in the email. 1. Go to **Experience Hub** > **Email**. 2. Click the Email template icon icon. 3. To create a new template, click Create new. 4. To create a template out of an existing template, click From template. 5. Select the template. 6. Select the form of template, more information about create template you will find [here](/docs/campaign/e-mail/creating-email-templates): 1. **Drag&drop builder** - Create email templates with ready-made components. 2. **Code editor** - Create email templates in CSS and HTML.
**Snrs-product-ogTag** catalog is built in Synerise by default if you have og tags on product page. Depending what OG tags you have, you can collect information like product id, title, price, brand etc. in the catalog, every time somebody visits a product.
## Configure automation --- To start sending emails to customers you will have to prepare a workflow, which in basic configuration may look like the one below - let’s take a closer look at each node. 1. Start with the **Profile Event** trigger and in the settings of the node, select the **page.visit** event. 2. As the event parameter, select **retailer_part_no** - this way, the workflow starts only when a customer visits a product page.
Use "." in a regular expression to accept a valid value of this parameter (except for null). This way, you know that this event has the **retailer_part_no** parameter.
Screenshot presenting automation
Profile Event
3. Add **Delay** and define the lag between the page visit and sending the message, in our example it is 2 hours.
Screenshot presenting automation
Configuration of the Delay node
4. Using the **Profile Filter** node, exclude users who have made a transaction in the last 2 hours – it's important to use minutes instead of hours.
Screenshot presenting automation
Configuration of the Profile Filter node
5. Configure the **Send Email** node by selecting the appropriate email account, choosing the template that you prepared in the previous step.
Screenshot presenting automation
Configuration of the Send Email node
6. Prepare the final settings - Add **End** nodes where the workflow should finish for users. - Specify capping (here 1 for 1 day). - Optionally add titles to each node so the workflow will be more understandable to your colleagues. - Name the workflow and Save it or Save & Run.
Screenshot presenting automation
Workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/892528ec-12d5-3e7b-987f-f3e2f79ed349) - [Workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/24cab624-aaa3-4d5a-a60f-6b0c4e963920) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Creating aggregates](/docs/crm/aggregates/creating-profile-aggregates) - [Creating workflow](/docs/automation) - [Email templates](/docs/campaign/e-mail/creating-email-templates) # Daily additional points for the fastest buyers Synerise offers endless possibilities for creating business loyalty scenarios. One of them may be a campaign that ends after a specific number of redemptions and revokes every day. It can increase the traffic in your mobile app. Combining this with additional loyalty points may bring you new customers. In this use case, you will create a scenario that awards customers with additional 1500 loyalty points for the purchase of a soda. The promotion works every day for the first 1000 buyers. The mechanism controls the number of purchases and informs the mobile app user if they can still get the additional points, or if they are late and need to try again on another day.
Mobile view of an example of promotion content
## Prerequisites --- - [Create a workspace API key](/docs/settings/tool/api#adding-api-keys) with permissions allowing to calculate metrics and update the catalog. - [Create a schema type](https://hub.synerise.com/api-reference/asset-management#tag/Documents/operation/addSchemaType). - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Integrate Synerise [mobile SDK](/developers/) in your mobile application. - Integrate mechanism for awarding loyalty points.
Find more in the [Loyalty programs basics](/use-cases/loyalty-programs-basics) use case.
## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following procedures: 1. [Create a metric](#create-a-metric) that calculates the number of purchases of soda on the current day. 2. [Create a catalog](#create-a-catalog) which stores the current information for the customers: whether they can get additional points or not. 3. [Create an automation updating the catalog content and awarding points](#create-an-automation-updating-the-catalog-content-and-awarding-points). 4. [Create an automation updating the catalog content to the default value](#create-an-automation-updating-the-catalog-content-to-the-default-value). Thanks to this, the mechanism will reset the information about promotion availability every day. 5. [Create a document with a catalog content](#create-a-document-with-a-catalog) which sends the content of the catalog with information for the customer to the mobile app. ## Create a metric --- In this part of the process, you will create a metric which counts how many times the product on promotion was bought on the current day. 1. Go to Behavioral Data Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 2. As the metric type, select **Simple metric**. 3. Leave the **Aggregator** at default (Count). 5. As the occurrence type, set **All**. 6. From the **Choose event** dropdown list, select the **product.buy** event. 7. Click the where icon button. 8. From the **Choose parameter** dropdown list, select **$sku**. 10. From the **Choose operator** dropdown list, select **Equal**. 12. As the value of the operator, add the SKU of the product for which you award the additional points. 13. Open the time range settings by clicking the calendar icon. 1. In the **Relative date range** section, choose **Today**. 2. Click **Apply**. 13. Click **Save**.
The view of the metric configuration
Configuration of the metric
## Create a catalog --- In this part of the process, you need to create a catalog, which will store the current information about promotion availability. At later stages of the process, this catalog will be updated on the basis of how many soda transactions have been made on a given day. Also, it will be separately updated at midnight every day when resetting the daily redemption counter. 1. Prepare a CSV file of your promotion content, according to [requriements](/docs/assets/catalogs/creating-catalogs#requirements). Below is the sample file used in this article. It consists of two columns, where the first is a message that will be shown to customers and the second is the key of the promotion. ``` copy;key Buy a soda and get extra loyalty points!;copyKey ```
You can use this file in your implementation, after changing the message to your business needs.
2. Go to Data Modeling Hub icon **Data Modeling Hub > Catalogs > New Catalog**. 3. Enter the name of the catalog. 4. Click **Apply** to confirm. The catalog will appear on the list. 5. Click on the created catalog. 5. In the upper right corner, click **Import**. **Result:** A pop-up appears. 6. As the import method, select **Import a local file**. 7. Click **Next**. 7. Upload the CSV file you prepare by using the **+ Upload file or drop one here** field. 8. Optionally, you can customize the file metacharacters by clicking the arrow down icon. 1. From the **Delimiter** dropdown, select the character that marks the end of a column. 2. From the **Quotation** mark dropdown list, select the characters that contain the text or data type. 4. From the **Escape character** dropdown lists, select the character which changes the default interpretation of a character or a string followed by the escape character. 9. To proceed to the next step, click the **Next** button. 10. Select the name of the column which is treated as the primary key. In our example, it’s `key`. 11. Click **Next**. 12. Click **Run import**.
The view of the CSV file upploaded to catalog
Configuration of the catalog
## Create an automation updating the catalog content and awarding points --- In this part, you will create a workflow which triggers when the product for which you assign additional points is bought. If the [result of the metric created earlier](#create-a-metric) is greater than 1000, it will update the catalog with the message that the promotion is over today. If the metric's result is smaller than 1000, it will grant extra points to the customer. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- At this stage, you will configure the conditions that trigger the workflow. 1. Add the first node - **Profile Event**. In the node configuration: 1. From the **Choose event** dropdown list, choose the **product.buy** event. 2. Click where icon button. 3. From the **Choose parameter** dropdown list, select **$sku**. 5. From the **Choose operator** dropdown list, select **Equal**. 7. As the value of the operator, add the SKU of the product for which you want to award additional points. 2. Click **Apply**.
The view of the Profile Event node configuration
Configuration of the Profile Event node
### Define the Outgoing Integration node --- In the **Outgoing Integration** node, you will create a webhook calculating the metric from [the previous step](/use-cases/limited-promotion#create-a-metric). The continuation of the workflow will depend on the result of the metric. 1. After the trigger node, add **Outgoing Integration**. 2. Select **Synerise API key** as your method of authorization. 1. From the dropdown list below, select your **API key**. 3. In the **Webhook name**, field enter a name for the webhook. In this case, `Metric recalculation`. 4. Optionally, in the **Webhook event name** field, choose an action name for the event that will be generated when Synerise receives a response from your selected endpoint. 4. In the **URL** section, select the **POST** method. 1. In the URL of the endpoint, enter `https://api.synerise.com/analytics/analytics/v3/metrics/ID/recalculate`, where the **ID** is the ID of your [metric created earlier](#create-a-metric). 5. Optionally, add key-value pairs for headers and the body of the request in the **Body** section. 5. Confirm the settings by clicking **Apply**.
The view of the Outgoing Integration node configuration
Configuration of the Outgoing Integration node
### Define two Event Filter nodes on the metric result --- In this step, you will split the automation path, so different actions can happen according to the [metric result created earlier](#create-a-metric). If the result is greater than 1000, it will update the catalog with copy that today the promotion is over. If the metrics result is smaller than 1000, it will grant extra points to the customer. 1. Click **THEN** on the **Outgoing Integration** node, and add **Split Path**. 2. Add two **Event Filter** nodes. 3. Configure the first **Event Filter** node: 1. Enter the meaningful name of the node, ex. `when promotion is over on the current day`. 1. From the **Choose event** dropdown list, choose the **webhook.response** event. 2. Click where icon button. 3. From the **Choose parameter** dropdown list, select **name**. 5. From the **Choose operator** dropdown list, select **Equal**. 6. As the value of the operator, add the name of [the webhook created earlier](#define-the-outgoing-integration-node). In this case, it's `Metric recalculation`. 7. Click the where icon button. 8. From the **Choose parameter** dropdown list, choose **body.result**. 9. From the **Choose operator** dropdown list, select **More than (Number)**. 10. As the value of the operator, type `1000`. 11. Click **Apply**.
The view of the Event Filter for metric result grater than 1000
Configuration of the first Event Filter node
4. Configure the second **Event Filter** node: 1. Enter the meaningful name of the node, ex. `when promotion still lasts on the current day`. 1. From the **Choose event** dropdown list, choose the **webhook.response** event. 2. Click where icon button. 3. From the **Choose parameter** dropdown list, select **name**. 5. From the **Choose operator** dropdown list, select **Equal**. 6. As the value of the operator, add the name of [the webhook created earlier](#define-the-outgoing-integration-node). In this case, it's `Metric recalculation`. 7. Click where icon button. 8. From the **Choose parameter** dropdown list, choose **body.result**. 9. From the **Choose operator** dropdown list, select **Less or equal to (Number)**. 10. As the value of the operator, type `1000`. 11. Click **Apply**.
The view of the Event Filter for metric result less than 1000
Configuration of the second Event Filter node
### Define the Outgoing Integration node changing the catalog copy --- This **Outgoing Integration** node will be connected to the first **Event Filter** node (where the condition is that the metric result is above 1000). When the number of sold sodas exceeds 1000, the automation will update the text in the catalog to inform that the offer is no longer available for the current day and the customer will receive such information in the mobile app. 1. To the first **Event Filter**, add the **Outgoing Integration** node. 2. As your method of authorization, select **Synerise API key**. 1. From the dropdown list below, select your **API key**. 3. In the **Webhook name**, field enter name for the webhook. In this case, it's `change.documentCopy`. 4. Optionally, in the **Webhook event name** field, choose an action name for the event that will be generated when Synerise receives a response from your selected endpoint. 4. In the **URL** section, select the **POST** method. 1. In the URL of the endpoint, enter `https://api.synerise.com/catalogs/bags/ID/items`, where the **ID** is the ID of your [catalog created earlier](#create-a-catalog). 5. Enter the request body. For the form used in this case, the body is as follows:
{
           "value": {
               "key": "copyKey",
               "copy": "Today, the use limit on this offer has already been reached 😞 Come back tomorrow!"
               },
           "itemKey": "copyKey"
       }
You can use this JSON code in your implementation, but change the names of the columns within the catalog and `copy` content according to your business needs.
7. Click **Apply**. 8. Add the **End** node. ### Define Generate Event node --- This **Generate event** node will be connected to the second **Event Filter** node. When the number of sold sodas is below 1000, the automation will generate an event granting extra loyalty points to the customers. 1. To the second **Event Filter**, add the **Generate Event** node. 2. In the **Define event** section: 1. As the **Event name** choose `points.upcharge`. 3. Enter the request body. For the form used in this case, the body is as follows:
{
               "name": "Extra points for buying a soda",
               "points": "1500"
               }
3. Click **Apply**.
The view of the Generate Event node configuration
Configuration of the Generate Event node
4. Add the **End** node. **Result**:
The view of the automation updating the catalog copy or awarding points
Automation updating the catalog copy or awarding points
## Create an automation updating the catalog content to the default value --- In this part of the process, you will create a workflow which triggers at midnight every day and changes the message in the catalog to its default value: information that you can buy a soda and get extra loyalty points. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the trigger node, add **Scheduled Run**. 4. In the configuration of the node: 1. Leave the **Run trigger** setting at default (**all time**). 2. In the **Repeat runs** section, set your **Timezone**, then choose **Everyday** and set the time to `0:00`. 3. Click **Apply**. 5. Add the **Outgoing Integration** node. 6. In the configuration of the node: 1. As your method of authorization, select **Synerise API key**. 1. From the dropdown list below, select your **API key**. 2. In the **Webhook name**, field enter name for the webhook. In this case, it's `change.documentCopy`. 3. Optionally, in the **Webhook event name** field, choose an action name for the event that will be generated when Synerise receives a response from your selected endpoint. 4. In the **URL** section, select the **POST** method. 1. In the URL of the endpoint, enter `https://api.synerise.com/catalogs/bags/ID/items`, where the **ID** is the ID of your [catalog created earlier](#create-a-catalog). 5. Enter the request body. For the form used in this case, the body is as follows:
{
                   "value": {
                       "key": "copyKey",
                       "copy": "Buy a soda and get extra 1500 loyalty points! 
                       Take advantage of this offer while you still can!"
                       },
                   "itemKey": "copyKey"
               }
You can use this JSON code in your implementation, but change the names of the columns within the catalog and `copy` content according to your business needs.
8. Click **Apply**. 7. Add the **End** node. **Result**:
The view of the workflow updating the catalog to the default value
Workflow updating the message in the catalog to the default value
## Create a document with a catalog --- In the final step of this process, you will create a document with [the catalog created earlier](#create-a-catalog) in order to be able to return the catalog content to the mobile application. This will let you display information for the customer whether they can still use the promotion or not. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Documents > Add document**. 2. Enter the name for your document. A slug (the ID of the document) is filled in automatically. 3. To select the type of schema, in the **Type** section, open the dropdown list. A schema defines the method of validating the data included in the document. 4. Optionally, in the **Description** field, you can add a description of the document. 5. In the **Content (JSON)** section, paste the JSON code:
{
   "copy": "{% set key = 'copyKey' %}{% catalog.UC-limited-promotion(key).copy %}"
   }
The above code contains the JSON object that will be returned to your mobile app. It contains one field (`copy`) with the value of message that should be displayed to the customer. This value is retreived using [the Jinjava insert](/developers/inserts/insert-usage#extracting-values-from-catalogs) that enables to extract values form catalogs. You can use the code in your implementation but change the name of the catalog to the one you have created, as well as the names of the columns within it.
6. Click **Apply** to save the document.
The view of the document configuration
Configuration of the document
## What's next --- For this business scenario and automation to work, creating a document with a catalog is crucial. The mobile application will be able to retrieve the document with the current copy content, with the download document method ([Android](/developers/mobile-sdk/method-reference/android/content#generate-document), [iOS](/developers/mobile-sdk/method-reference/ios/content#generate-document), [React Native](/developers/mobile-sdk/method-reference/react-native/content#generate-document)). Then, a JSON file with the raw content will be returned, which the app must properly display to the customer. ## Check the use case set up on the Synerise Demo workspace --- You can check the: - [catalog](https://app.synerise.com/assets/catalogs/14170) - [metric](https://app.synerise.com/analytics/metrics/5f7a2aff-27bd-4045-9d9b-e88837d41d25) - [automation updating the catalog copy or awarding points](https://app.synerise.com/automations/automation-diagram/271368bf-51f3-49a8-b172-b5509104f8e4) - [automation updating the catalog to the default value](https://app.synerise.com/automations/automation-diagram/dce35c9c-926a-4306-9404-28fffd40229c) - [document](https://app.synerise.com/assets/documents/a2cc179a-8d44-4555-9ac2-6d4c0723ccbb) configurations directly in the Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~4), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1), `points.upcharge` (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Documents](/docs/assets/documents/introduction-to-documents) - [Metrics](/docs/analytics/metrics) # Sending Mobile Push Birthday Discounts at the Best Time A properly designed and executed mobile push campaign can help attract users' attention and increase the conversion rate. Sending a push notification at the optimal time, when the customer is active in the app, increases the chances that the customer will read the communication. Customers may feel happy if you offer them a birthday discount to celebrate their big day. In this use case, you will learn how to prepare a mobile push campaign with a discount on products from specific categories for customers who have a birthday on the current day. The promotion will be available for 14 days after the birthday. You can optimize time of sending push notifications with the help of our time optimizer and connect with your customers at the right hour. The sending time is adjusted to the customers' activity in the mobile app. ## Prerequisities --- - Implement promotions in your [mobile application](/developers/mobile-sdk/loyalty), [API](https://hub.synerise.com/api-reference/authorization#tag/Authorization/operation/profileLogin). - Implement mobile pushes in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - [Import your product feed to a catalog](/use-cases/import-product-feed-to-catalog). - Collect data about customers' birthdays in their profiles. - If you want to limit the promotion to only some of your stores, add the list of stores to a catalog. Such a catalog must contain a unique store ID and any other store attributes by which you will filter stores, such as city, zip code, and so on. More information about catalogs can be found [here](/docs/assets/catalogs). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- 1. [Enable time optimizer](/use-cases/mobile-push-birthday-best-time#enable-time-optimizer). 2. [Create a mobile mode](/use-cases/mobile-push-birthday-best-time#create-a-mobile-mode) in time optimizer. 3. Create segmentations: 1. [A segmentation of customers whose birthday is on the current day](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-of-customers-whose-birthday-is-on-the-current-day) - needed to send the push notification. 2. [A segmentation of customers whose birthday was in the last 14 days](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-for-customers-whose-birthday-was-in-the-last-14-days) - needed to keep the promotion active for 14 days after the birthday. 2. [Create a promotion](/use-cases/mobile-push-birthday-best-time#create-a-promotion) for customers who have celebrated their birthday within the last 14 days on products in specific categories. 3. [Prepare a mobile push notification](/use-cases/mobile-push-birthday-best-time#prepare-a-mobile-push-notification). 4. [Create a workflow](/use-cases/mobile-push-birthday-promotion#create-a-workflow) to send the mobile push. The workflow runs once a day. ## Enable time optimizer --- 1. Go to **Settings > AI Engine Configuration**. 2. Select **Time optimizer** tab. 3. Click **Define**. 4. Switch the toggle on. ## Create a mobile mode --- Create a Mobile mode for Time Optimizer that will calculate the time when the customer is most active in the mobile application based on the events such as `screen.view` and `screen.interaction`. 1. Go to **Settings > AI Engine Configuration**. 2. Select the **Time optimizer** tab. 3. Click **Define**. 4. Click **Add new mode**. 5. To create a new mode, select **Custom**: 1. In the **Mode name** field, enter the name for the custom mode. 2. From the **Predicted event** dropdown list, select the `screen.view` activity to calculate the most probable time of occurrence. 3. From the **Input events** dropdown list, select the events: `screen.interactions`, `screen.click` and `screen.view`, based on which the engine will perform the predictions. 4. Click **Apply**. 6. Click **Apply** to save the new mode.
To keep the time optimizer enabled, at least one mode must be active.
New mode mobile
Configuration of custom mode in time optimizer
## Prepare segmentations --- ### Create a segmentation of customers whose birthday is on the current day 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. Click **Conditions**. 4. From the **Add condition** dropdown list, select the birthday attribute. 4. In the operator selection menu that opens: 1. Click the calendar icon. 3. Click **Matches current day**. 5. From the **Add condition** dropdown list, select the birthday attribute. 6. In the operator selection menu that opens: 1. Click the calendar icon. 3. Click **Matches current month**. 7. Click **Save**.
Segment of customers who have a birthday on the current day
Segment of customers who have a birthday on the current day
### Create a segmentation for customers whose birthday was in the last 14 days This segment identifies customers who have received a mobile notification about the birthday promotion within the last 14 days. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. Click **Conditions**. 3. From the **Add condition** dropdown list, select the **Mobile push sent** event. 4. Add the **campaignName** parameter. 5. As the logical operator, select **Equal**. 6. In the blank field enter the campaign name. You must use the same name later, when creating the mobile push template. 7. In the time range settings: 1. Click **Custom**. 2. Set the range to last 14 days. 8. Add additional filters identical to those in the previous segmentation, with the condition that today is the user's birthday. Choose **Add condition**. The `OR` operator should be applied between the "Mobile push sent" filter and the birthday date filter for the first contact. This ensures that customers who respond immediately to the push notification will have the promotion activated, even if there is a delay in processing the `push.send` event.
Segment of customers who have received a mobile notification of a birthday promotion within the last 14 days
Segment of customers who have received a mobile notification of a birthday promotion within the last 14 days.
## Create a promotion --- Create a promotion for customers whose birthday was within the last 14 days (including the current day) on products from the following categories: sweets, cosmetics, and coffee. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For selected items** option. 3. In the **Audience** section, select the segment created in [this step](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-for-customers-whose-birthday-was-in-the-last-14-days). 4. In the **Content** section: 1. Define the name, description, and image of the promotion. 2. In the price field, enter `0`. 3. Confirm the settings by clicking **Apply**.
Example of birthday promotion content
Example of birthday promotion content
5. In **Type & limits**, define the settings so that the promotion is available for use for up to 6 products in the cart, while giving a 20% discount on products defined in the **Items** section. 1. As the **Discount type**, choose **Percentage**. 2. In the **Limit per profile**, as the maximum value, enter `6`. 3. In the **Value** section, define the discount as `20`. 6. In the **Schedule** section, define the distribution period of your promotion. 7. **Optional** In the **Stores** section, specify stores where the promotion is available.
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
8. In the **Items** section, define a product catalog and a filter - specifying the products that will be discounted.
Example of a catalog filter with products from specific categories
Example of a catalog filter with products from specific categories
You can define the filter directly in the catalog with the products for which the promotion is created. To do this, go to **Catalogs** located in **Data Modeling Hub**, select the catalog you need and define a filter for the products in the categories that are included in the promotion.
Catalog filter
Catalog filter
10. To apply all changes and run the promotion, click **Publish**. ## Prepare a mobile push notification --- Prepare a mobile push with information about the promotion. 1. Go to **Experience Hub > Mobile > Template**. 2. You can use the template from the folder or create your own one using the mobile push code editor. Click **New Template > Simple Push**. 2. Create your mobile push in the code editor. For more information on creating a simple mobile push, visit our [User Guide](/docs/campaign/Mobile/creating-mobile-push).
The template name must be the same as the one you used in the filter when [creating the segmentation](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-for-customers-whose-birthday-was-in-the-last-14-days) earlier!
Example of mobile push notification
Example of mobile push notification
## Create a workflow --- In this part of the process, prepare a workflow that sends notifications for customers celebrating their birthday on the current day, delivering their birthday promotion at the optimal time determined by the Synerise Time Optimizer. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node of the workflow, add **Audience**. In the node settings: 1. As the **Run trigger** option, select **repeatable**. 2. Set the interval to 1 day. 3. In the **Begin at** field, select the date, select the hour as 00:00. 4. From the **Timezone** dropdown list, select the time zone consistent with the time zone of your workspace. 5. In the **Define audience** section, click **Segments**. 6. Click **Select segment**. 7. Select the segment of [customers whose birthday is on the current day](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-of-customers-whose-birthday-is-on-the-current-day). 8. Confirm by clicking **Apply**. 4. Add an **Optimize time** node. In the configuration of the node: 1. Select the [custom mode](/use-cases/mobile-push-birthday-best-time#create-a-mobile-mode) you created in previous part of the process. 2. Set the time period to analyze according to your business needs by clicking **Custom time period**. 3. In the **Time period** field, enter `24` 3. Confirm by clicking **Apply**. 4. As the next node, add **Send Mobile Push**. 5. In the configuration of the **Send Mobile Push** node: 1. From the **Template type** dropdown list, select **Simple Push**. 2. Select the **Push template** created in [this part](/use-cases/mobile-push-birthday-best-time#prepare-a-mobile-push-notification) of the process. 6. Confirm by clicking **Apply**. 7. Add the **End** node to finish the workflow. 8. Click **Save & Run**.
Final configuration of a workflow that sends a mobile push to customers whose birthday is on the current day
Final configuration of a workflow that sends a mobile push to customers whose birthday is on the current day
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the segmentations directly in Synerise demo workspace: - [a segmentation of customers whose birthday is on the current day](https://app.synerise.com/analytics/segmentations/eb0dc5de-da7b-420e-a20a-3f96e57546ff), - [a segmentation of customers whose birthday was in the last 14 days](https://app.synerise.com/analytics/segmentations/5c1343d0-c156-4f1f-9389-b04b5bf8da24). Check also the [configuration of the promotion](https://app.synerise.com/campaigns/promotions/42cfd4d0-dea4-43b5-aa19-34440a3ca350) and [workflow](https://app.synerise.com/automations/automation-diagram/aad0b2b5-401c-43f4-8f1a-48c8f2e265af) created for this use case. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`snr.ate.prediction`](/docs/assets/events/event-reference/predictions#snrateprediction) (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1). ## Read more --- - [Creating promotions](/docs/ai-hub/promotions) - [Mobile push notifications](/docs/campaign/Mobile) - [Time optimizer](/docs/settings/configuration/time-optimizer) - [Workflow](/docs/automation/creating-automation) # Personalized recommendations for 404 error page There are many reasons why users may end up on a 404 error page, including situations when the user mistyped the URL. It is very important to have an optimized 404 page, as it significantly affects the user experience. By providing personalized recommendations or any alternative content on the error page, you can prevent users from feeling lost or frustrated and keep them engaged by encouraging them to continue browsing your site. A well-designed and informative 404 page can help improve user satisfaction, reduce bounce rates, and ultimately drive conversions. This use case describes the creation of personalized recommendations on a 404 page that will display items most relevant to the user's interests based on their activity on the site.
Personalized recommendations on 404 error page
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - The [item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) must be provided. - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable the personalized recommendations. ## Process --- In this use case, you will go through the following steps: 1. [Create AI recommendations](/use-cases/personalized-reco-on-error-page#prepare-ai-recommendations) with personalized products. 2. [Create a dynamic content campaign](/use-cases/personalized-reco-on-error-page#create-dynamic-content). ## Prepare AI recommendations --- In this step, create an AI recommendation campaign that will be used to display products on page 404. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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. 5. Select the **Personalized** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 6. In the **Items** section, click **Define**. 7. Click **Add slot**. 8. Click **Unnamed slot** that was created. 8. Define the minimum and maximum number of products displayed in the frame according to your needs. 9. Optionally, you can use filters to include specific items in the recommendation frame.
Learn about the difference among [elastic, static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter).
10. Confirm the configuration by clicking **Apply**. 11. Optionally, you can use boosting option to promote or demote any items attributes in the recommendation frame. 12. Optionally, you can also define the settings in the **Additional settings** tab according to your needs. 13. Click **Save**. ## Create dynamic content --- Use dynamic content to insert recommendations in the specific place on your 404 page. The most efficient way to do so is to use a unique CSS selector which is added only to the 404 page. In our case, we use the `body.cms-no-route` selector.
If you don’t want to use dynamic content, you can retrieve recommendations through API, [using this method](https://hub.synerise.com/api-reference/ai-recommendations#tag/Recommendations/operation/GetRecommendationsByCampaignV2).
To prepare dynamic content: 1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 1. Choose the **Insert Object** type. 2. In the **Audience** section, select **Everyone**. 3. In the **Content** section specify the CSS selector where you want to insert recommendations. 4. In the **Content** tab, click **Create Message**. 5. In the code editor, insert Jinjava with the AI recommendation and add your own CSS.
Click to see Jinjava

Replace `your_campaign_ID` with the ID of the AI recommendation. The ID of the AI campaign is contained in the URL of the recommendation.

<!-- Downloading the AI campaign --> {% recommendations3 campaignId=your_campaign_ID %} {% for p in recommended_products3 %} <li data-snr-ai-product-id="{{p.itemId}}"> <a class="snrs-AI--item-link" href="{{p.link}}" title="{{p.title}}"> <img src="{{ p.imageLink }}"class="products-slider__item-image snrAI-product-image snrAI-product-image-{{p.itemId}}" width="90" alt="{{p.title}}" id="snrAI-image-{{p.itemId}}"> <h3 class="snrs-AI-product--product-name"> <span class="snrs-AI-product--name-first">{{p.title}}</span> </h3> <span class="snrs-AI-product--series">{{p.attributes.series}}</span> </a> </li> {% endfor %} {% endrecommendations3 %}
6. Save the template. 7. In the **Schedule** section, select the date when the dynamic content is activated. 8. In **Display settings**, define the circumstances for displaying the content.
Instructions how to do it are available [here](/docs/campaign/dynamiccontent/creating-dynamic-content/creating-dynamic-content).
9. Confirm by clicking **Apply**. 10. In the **UTM & URL parameters** section, click **Skip step**. 11. Activate the dynamic content. **Result**: The recommendation frames are displayed on the website. ## Check the use case set up on the Synerise Demo workspace --- You can check the [recommendations settings](https://app.synerise.com/ai-v2/recommendations/y9BygrOc69U0) and [dynamic content campaign](https://app.synerise.com/campaigns/preview/b2229cd9-5021-4629-9e66-60a99bd284ae) in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Recommendations](/docs/ai-hub/recommendations-v2/recommendation-statistics) - [Using recommendations in dynamic content](/developers/inserts/recommendations-v2) # Promotion triggered by basket value In order to increase your sales, you need to make every customer count. The ability to automatically trigger a promotion for your loyal customers at certain basket values will help you boost your average basket value. It can also make customers more satisfied, reliable, and profitable. In this use case, you will create a promotion for members of a loyalty program: they will receive a specific product for free when their cart value exceeds 100 PLN. ## Prerequisites --- - [Implement promotions in your mobile application](/developers/mobile-sdk/loyalty), [API](https://hub.synerise.com/api-reference/authorization#tag/Authorization/operation/profileLogin). - [Import your product feed to catalogs](/use-cases/import-product-feed-to-catalog). - If you want to limit the promotion to only some of your stores, add the list of stores to a catalog. Such a catalog must contain a unique store ID and any other store attributes by which you will filter stores, such as city, zip code, etc. More information about catalogs can be found [here](/docs/assets/catalogs). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- 1. [Prepare segmentation](/use-cases/promotion-triggered-by-basket-value#prepare-a-segmentation) of customers who are members of the loyalty program. 2. [Create a promotion](/use-cases/promotion-triggered-by-basket-value#create-a-promotion). ## Prepare a segmentation --- In this part of the process, create a segmentation of customers who are members of the company's loyalty program. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. From the **Choose filter** dropdown list, select the **loyaltyCard** attribute. 4. As the logical operator select Boolean **Is true**.
The conditions used in the segment will vary depending on your loyalty program integration (for example, the name of the attribute may be different). You must define the segmentation accordingly.
5. Click **Save**.
An example of a customer segment that participates in a loyalty program
An example of a customer segment that participates in a loyalty program
## Create a promotion --- 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For selected items** option. 3. In the **Audience** section, select the segmentation created in [this step](/use-cases/promotion-triggered-by-basket-value#prepare-a-segmentation). 4. In the **Content** section: 1. Define the name, description, and image of the promotion. 2. In the **price** field enter `0`. 3. Confirm the settings by clicking **Apply**.
AI Hub promotion Content section with name, description, image, and zero price for a basket value triggered promotion
Example of promotion content
5. In the **Type and limits** field, define the settings so that the promotion is only available once to loyalty program members: 1. As the **Type**, choose **Members only**. 2. In the **Limit per profile** section, enter `1`. 3. In the **Value** section, define the discount as `100%`. 4. Switch the **Basket trigger** toggle on. 5. In the **Minimum value** field, enter `100`. 6. Apply changes. 6. In the **Schedule** section, define the promotion distribution period according to your business needs. 7. **Optional** In the **Stores** section, specify stores where the promotion is available.
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
8. In the **Items** section, specify the catalog item to be discounted: 1. In the **Source catalog** field, select an item catalog to select the promotional items from. 2. Select a promotional item by using the **Select items** option (in our case, the item is a coffee). 10. To apply configuration and run the promotion, click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [segmentation](https://app.synerise.com/analytics/segmentations/1f34841c-8dd8-49f6-acd9-aab7ce928e23) and [promotion settings](https://app.synerise.com/campaigns/promotions/b168dea2-0f33-46a5-8066-68e8d380c40d) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Creating segmentations](/docs/analytics/segmentations) - [Creating promotions](/docs/ai-hub/promotions) # Send an email with promotions labeled with a specific tag This use case describes the process of sending promotions through the email channel. The email template contains a predefined HTML block with promotions which retrieves a Synerise promotion you indicate in the configuration of this block. The promotions can be easily adapted for different communication channels, but in this scenario, we will focus on email campaigns. Our target audience consists of active users who have made at least one purchase in the past year. The campaign will dynamically deliver the list of active promotions available for a specific user, presenting only offers with a specific tag. This approach is especially important when managing multiple active promotions from different areas but intending to send only those that are tagged with the `home` label within your campaign. With the power of dynamic HTML blocks, we can seamlessly integrate these promotions into the email templates, ensuring that each recipient receives relevant offers. ## Prerequisites --- - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog). - Implement mobile pushes in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - [Implement a tracking code](/docs/settings/tool/tracking_codes). - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). ## Process --- In this use case, you will go through the following steps: 1. [Create promotions](/use-cases/promotions-in-email#create-promotions) with specific tag. 3. [Create a segmentation](/use-cases/promotions-in-email#create-a-segmentation) of customers who have made a transaction last year, this group will be the recipients of the email campaign. 4. [Create an email template](/use-cases/promotions-in-email#create-an-email-template). 5. [Create an email campaign](/use-cases/promotions-in-email#create-an-email-campaign). ## Create promotions --- In this part of the process, create a promotion (or more) which you will insert in the email template. You can create a promotion with the following scopes: - [For selected items](/docs/ai-hub/promotions/creating-promotions) - you can select items to which you want to apply a discount - [For entire basket](/docs/ai-hub/promotions/creating-promotions-for-entire-basket) - you can reduce the value of the whole shopping cart if its value matches the fixed price limit, Regardless of the selected promotion scope, in the configuration of the promotion, in the **Content** section, find the **Add tag** field and add a `home` tag.
Example of tag
Example of tag
## Create a segmentation --- In this part of the process, we will create a group of customers who have made a transaction during the last year. This group will serve as the recipients of an email campaign. It’s important to clarify that these customers will receive the email, rather than being the target audience for a promotion. Additionally, ensure that the conditions set for the Audience in the promotion do not conflict with those of the Audience for the email recipients, to avoid any discrepancies between the two groups. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. Click **Add condition**. 4. From the dropdown list, select the `product.buy` event. 6. From the **Choose operator** dropdown, choose **Boolean**, and then select **Is true**. 7. Using the date picker in the lower-right corner, set the time range to **Relative time range > Last 365 days**. Confirm by clicking **Apply**. 6. Save the segmentation.
Decision Hub segmentation configuration filtering customers who made a purchase in the last 365 days
Segmentation configuration
## Create an email template --- To distribute the promotions, you need to prepare an email template that includes the promotion created in the previous step of the process. This step involves incorporating Jinjava code into the email template to fetch the details of the promotion labeled with the `home` tag for which an email recipient is eligible. The instructions for this step include the necessary code. 1. Go to **Experience Hub > Emails > Templates > Drag&drop builder**. 2. From the **Content** section, click **HTML BLOCKS** and add pull it to the chosen place in your template. 2. Click the **Configure** button. 3. Choose the **Predefined blocks** folder where you will find the **Promotions** block. 4. You must edit the template of the predefined block. It already contains a universal reference to a promotion, but we need to narrow down the promotion scope to those which are labeled with the **home** tag. The following changes must be added to the code of the block in the **HTML** section: - to `{% set fieldsVar = ["code", "params", "name", "status", "images", "params", "description", "headline"] %}`, add `, "tags"` - replace `{%- if count < noOfItems -%}` with `{%- if count < noOfItems && i.tags|selectattr("name", "equalto", "home")|length > 0 -%}` and if you're using other tag than home, replace `"home"` with the name of your tag
**Below, you can compare the code before and after changes:**
{% set fieldsVar = ["code", "params", "name", "status", "images", "params", "description", "headline", "tags"] %}
   {% promotions fields=fieldsVar %} 
   {% set count = 0 %} {%- for i in promotions_result -%}
   {%- if count < noOfItems && i.tags|selectattr("name", "equalto", "home")|length > 0 -%}
{% set fieldsVar = ["code", "params", "name", "status", "images", "params", "description", "headline"] %} 
   {% promotions fields=fieldsVar %} 
   {% set count = 0 %} {%- for i in promotions_result -%} {%- if count < noOfItems -%}
4. When you finish customizing the block, to use proceed to saving changes in templates, click **Next**. If you want to save the block for future use, click **Save as**, in **Block name**, enter the name of the block and in **Block folder**, select the folder in which your block will be saved. 5. Save the template by clicking **Save as**. 6. In **Template name**, enter the name of the template. 7. In **Template directory**, select the folder in which the template will be saved.
Screenshot presenting email template for anniversarie coupon
Prepare an email template
## Create an email campaign --- In this part of the process, you will create an email campaign with the list of the promotions available for the recipient. 1. Go to Experience Hub icon **Experience Hub > Email campaign > Create new**. 2. In the **Audience** section, choose the [segmentation created in the previous step](/use-cases/promotions-in-email#create-a-segmentation).
Please remember that the predefined HTML block with promotions works for a given customer only if they are in the audience of at least one promotion. If none of the selected promotions are available for the user, the email will not be sent.
4. To confirm you choice, click **Apply**. 3. Configure the **Content** section. 1. In **From email address*, select the email account from which you want to send your message. 2. In **From name**, enter the sender name that is displayed in the mailbox. 2. In the **Subject** field, enter your message subject. 2. Click **Create message** and choose an email template created in the [previous step](/use-cases/promotions-in-email#create-an-email-template). 3. Apply changes. 4. In the **Schedule** section, specify the time when you want to send your communication. 4. You can optionally define **UTM & URL parameters**. 4. Confirm by clicking **Apply**. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [segmentation](https://app.synerise.com/analytics-v2/segmentations/c39f2834-3f44-4f1d-96d8-0ed6fb272221) - [example promotion](https://app.synerise.com/campaigns/promotions/dad398ae-ca99-421f-88d3-e21dcdf83564) - [email campaign](https://app.synerise.com/campaigns/email/create/1dd5c37d-da50-42dc-a0aa-7eb48755bab6) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Creating email templates](/docs/campaign/e-mail/creating-email-templates) - [Creating emails](/docs/campaign/e-mail/creating-email-campaigns) - [HTML blocks](/docs/campaign/e-mail/creating-email-templates/creating-custom-html-block-basic-builder) - [Promotions](/docs/ai-hub/promotions) - [Segmentation](/docs/analytics/segmentations) - [Workflows](/docs/automation). # Cart-Based Recommendation with Last Seen and Last Bought Exclusion When building product recommendations in the checkout flow, it's important to avoid redundancy and overexposure. Showing users items they’ve just viewed or recently bought can reduce relevance and lower conversion potential. In this use case, we implement a recommendation that suggests products related to items currently in the cart. To ensure the results remain fresh and relevant, we apply the following filters: - one to exclude last seen products, - and another to exclude items recently purchased, - using product context – excluding the currently viewed product from recommendations - considering the product context – displaying recommendations from the same category as the currently viewed product.
You can refine the item context even more by displaying items in the same color, style, or size as the item currently viewed, using the available item attributes in your product feed.
What is more, we will use boosting factors, to promote in recommendations products which: - costs more than 10$. In this way, you exclude recommending products that are too cheap and encourage the purchase of more expensive ones. This setup ensures that recommendations stay distinct from other modules on the page (like last seen or personalized offers) and avoid repeating content the user already interacted with — helping drive meaningful discovery and cross-sell opportunities. Additional boosting and filters let you present more personalized recommendations using the product context. ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable similar item recommendation model. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate returning last seen products](#create-an-aggregate-returning-last-seen-products) that returns the ID of the last seen product. 3. [Prepare an AI recommendation](#prepare-an-ai-recommendation) with the exclusion of last bought and last seen products. ## Create an aggregate returning last seen products --- In this part of the process, create an aggregate that returns the ID of the last 10 products a customer had visited. The recently viewed product itself will not display in the template, but will serve as a context for recommendations. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi**. As a size add **10**. You can also add more results. 4. From the **Choose event** dropdown list, select the **Visited page** event. 5. As the event parameter, select **product:retailer_part_no**. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select the **product:retailer_part_no** parameter. 8. From the **Choose operator** dropdown list, select **Is true (Boolean)**. 9. Using the date picker in the lower-right corner, set the time range to **Last 7 days**. Confirm your choice with the **Apply** button. 7. Click **Save**.
Decision Hub Last Multi aggregate returning the product ID of the last 10 visited product pages in the past 7 days
Configuration of the aggregate returing the ID of the last seen product
## Prepare an AI recommendation --- In this part of the process, you will configure AI Recommendations which exclude last seen and last bought products. AI Recommendations will be added to the website to the product page. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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 an item feed. 5. In the **Type** section, choose the **Similar items** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 4. In our case, in the **Elastic filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **itemId**. 6. As an operator, choose **Not in**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Aggregate**. 8. From the list, choose the [aggregate created in the previous part of the process](#create-an-aggregate-returning-last-seen-products). 4. Confirm by clicking **Apply**.
AI Hub recommendation elastic filter excluding last seen product IDs using the last viewed product aggregate
Configuration of the elastic filter
10. In the **Static filters** section, click **Define filter**. 11. Select **Visual Builder**. 5. From the **Select value** dropdown list, choose **category**. 6. As an operator, choose **Equals**. 7. Click the icon which appeared next to the field with operator and from the dropdown list select **Context** (eye icon). 8. From the **Select value** dropdown list, choose the **category**. Then, choose how you want to select your category level. In our case it will be **Whole**. 9. Click **and where** to add another filter. 5. From the **Select value** dropdown list, choose **itemId**. 6. As an operator, choose **Does not equal**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Context** (eye icon). 8. From the **Select value** dropdown list, choose **itemID**. 4. Confirm by clicking **Apply**.
AI Hub recommendation static filter showing items in the same category as the currently viewed product while excluding the current product
Configuration of the static filter
You can refine the item context even more by displaying items in the same color, style, or size as the item currently viewed, using the available item attributes in your product feed.
8. Define the boosting rules by clicking **Define** in the **Boosting** section. 1. In **Attributes** section, click **Add rule**. 2. Click **Define rule**. 3. Choose **Visual builder**. 3. From the **Select value** dropdown list, choose **price**. 4. As **Operator**, choose **More than**. 5. As the value, enter the minimum price a product should cost to be included in the recommendations. This way, you exclude recommending products that are too cheap and encourage the purchase of more expensive ones. 6. Click **Apply**. 7. Click **Promote**. 8. In the **Impact** section, set the impact of this rule to **High**.
AI Hub recommendation boosting rule promoting products priced above the minimum threshold with high impact
Configuration of the aggregate
9. In the **Additional settings** section: 1. Choose **Exclude already bought products**. If your company sells replenishable products, you can set exclusion for specific number of days, for example, exclude products bought not later than 30 days ago. 2. To make sure that you only display available products in the recommendations, click **Apply default filters**. 9. In the right upper corner, click **Save**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in our Synerise Demo workspace: - [Aggregate returning last seen products](https://app.synerise.com/analytics/aggregates/1162c599-338f-32f7-ba20-b1bb64fcaed0) - [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/nNL1ec4aj19V) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Recommendations](/docs/ai-hub/recommendations-v2) # Predict replenishment Recurring purchases are those purchases that are usually made with some frequency and regularity, such as the purchase of coffee, printer paper, hygiene products, etc. Products purchased on a regular basis fill the greater part of most customers' shopping baskets. That's why it's so important to provide customers with the best experience when making such purchases, reminding them of an upcoming purchase and encouraging them to return more often for these products in your store. The prediction created in this case is based entirely on analytics and calculates the average time between purchases for customers who have made at least three transactions in a given category, so we can calculate when a customer may make the next purchase, anticipating their intention by sending them an email reminder of the upcoming purchase. The described process consists of two automations, where one calculates the average interval between purchases and the other sends an email to the customer at the appropriate time to encourage to replenishment.
Communication for customers making repetitive coffee purchases
## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Create an email template](/docs/campaign/e-mail/creating-email-templates) to be used in the email campaign.
We recommend including an [insert](/developers/inserts/recommendations-v2) in the email template with a product recommendation from the specific category to make the buying decision process easier for customers. You can refer to [this use case](/use-cases/personalized-category-reco#create-a-recommendation) to see how to build recommendations filtered to the product category.
## Process --- 1. [Create an event expression](/use-cases/repetitive-purchases#create-an-expression) that converts the time of transaction to a number. 2. [Create an aggregate](/use-cases/repetitive-purchases#create-an-aggregate) that returns the timestamps of the purchased products from the specific category. 3. [Create a workflow](/use-cases/repetitive-purchases#create-a-workflow-to-predict-purchase-time) that calculates the average number of days between a customer's purchases of a product in a specific category and calculates the date of the next purchase based on that number. 4. [Create a workflow](/use-cases/repetitive-purchases#create-a-workflow-to-encourage-a-purchase) that is responsible for sending a reminder to a customer about the next recurring purchase. ## Create an expression --- In this part of the process, you need to create an event expression that converts the timestamp of transaction to a number. This expression will be used later to create an aggregate. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression. 3. Set the **Expression for** option to **Event**. 4. From the drop-down list, select **product.buy**. 5. In the **Formula definition** section, click **Select**. 6. From the list that opens, select **Function > To number**. 7. In the brackets, click the **Select** button and from the list, select **Event attribute**. 8. Click the **Unnamed** node that appeared. 9. At the bottom of the page, click **Choose parameter**. 10. In the list of attributes, find and select **TIMESTAMP**. 11. Save the expression.
An expression that converts the timestamp to a number
An expression that converts the timestamp to a number
## Create an aggregate --- In this part of the process, you create a dynamic aggregate that returns timestamps of purchases from a specific category. The aggregate will return timestamps (as numbers) from **product.buy** events. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi** and size `15`.
This is the maximum number of a customer's past transactions to be used in the calculation. You can change the number according to your business needs.
4. Select **Consider only distinct occurences of the event parameter**. 5. Select the **product.buy** event. 6. From the **Choose event** drop-down list, select the expression you created [in the previous step](/use-cases/repetitive-purchases#create-an-expression). 7. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **category**. 8. From the **Choose operator** drop-down, choose **Equal**. 9. Enter the name of the product category. In our example, it's `coffee`. 10. Define the time range as **Last 365 days**. 11. Confirm by clicking **Apply**.
The final configuration of the aggregate
The final configuration of an aggregate
## Create a workflow to predict purchase time --- You need to create a workflow that calculates the average number of days between a customer's purchases from a given category. The result is used to calculate the customer's next purchase probability. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node At this stage you will configure the conditions that will trigger the workflow. As a trigger, you will use the `product.buy` event for the coffee category. 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From the **Choose event** drop-down menu, choose the **product.buy** event. 2. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **category**. 3. From the **Choose operator** drop-down, choose **Equal**. 4. Enter the name of the product category for which you want to predict the time of the customer's next purchase. In our case, it's `coffee`. 5. Confirm by clicking **Apply**. ### Define the Profile Filter node In this part of the process, you need to identify customers for whom the workflow calculates the date of next purchase. It takes into consideration customers who have made at least three separate transactions (**transaction.charge** event) with products from the "coffee" category. 1. Add the **Profile Filter** node. 2. Click the node to open its settings. 3. Click the **Choose filter** button and choose the **product.buy** event. 4. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **category**. 5. From the **Choose operator** drop-down, choose **Equal**. 6. Enter the name of the product category for which you want to predict the time of the customer's next purchase. In our case it's `coffee`. 7. Click **+ Add funnel step** button and repeat steps 3-6. 8. Set the time range to **Last 365 days before 1 days**. 9. Click the **Choose filter** button and choose the **transaction.charge** event. 10. Click **+ Add funnel step** button and another **transaction.charge** event. 11. Set the time range to **Last 365 days before 1 days**. 12. Confirm by clicking **Apply**. 13. For the **Not matched** path, add the **End** node.
Automation Hub Profile Filter node with funnel checking at least three coffee category purchases and transaction events in the last 365 days
The Profile Filter node configuration
### Define the Generate Event node At this stage, an event is generated on the customer's profile, returning the number of days between purchases and the date when the customer may make the next purchase. It contains the following parameters: - **category** - the category of products for which the calculation is made, - **itemId** - the ID of last product bought from the specific category, - **predictedTime** - calculated date of the next purchase from the specific category, - **predictedTimeInDays** - average number of days between purchases from the specific category. 1. To the **Matched** path of the **Profile Filter** node created earlier, add a **Generate Event** node. In the configuration of the node: 1. In the **Event name**, enter the name of the event that will be generated on the customer's profile. In this case, it is `product.purchasePredictedTime` 3. Add the JSON body of the event. You can use the example below.
Example jinjava code
{ "category": "coffee", "itemId": "{{ event.params.$sku }}", "predictedTime": "{% set avgTime = [] %}{% aggregate PASTE_AGGREGATE_ID_HERE %}{%set timeDiff = []%}{% for item in range(aggregate_result|length-1) %}{%set diff = aggregate_result[loop.index] - aggregate_result[loop.index-1]%}{% do timeDiff.append(diff)%}{% endfor %}{% set temp = timeDiff|sum/(aggregate_result|length-1) %}{% do avgTime.append(temp) %}{{ datetimeformat(unixtimestamp(null) + avgTime[0], '%Y-%m-%d') }}{% endaggregate %}", "predictedTimeInDays": "{{avgTime[0]/86400000}}" }
The above jinjava code contains the logic of calculating the average number of days between purchases from the specific category and calculating the date of a next purchase. It can be copied 1:1 into the Generate Event node. However, remember to replace the ID of aggregate in this code with the [ID of the aggregate created earlier in the process](/use-cases/repetitive-purchases#create-an-aggregate).
4. Confirm by clicking **Apply**.
Configuration of the Generate Event node
Configuration of the Generate Event node
Example of a generated **product.purchasePredictedTime** event:
Example of a generated event
Example of a generated event
### Add final settings to your workflow 1. Add the **End** node. 2. Launch the workflow by clicking **Save & Run**.
Automation Hub workflow for re-engaging customers with repetitive purchase patterns
Configuration of the workflow
## Create a workflow to encourage a purchase --- With the above workflow in place, you can create another workflow in which you send a message reminding the customer of the next purchase. This workflow starts each day for a group of customers whose expected purchase date is the current day. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Audience node In this stage, you create an Audience that checks for the presence of the **product.purchasePredictedTime** event on a user's card in the last 30 days with a specific product category (in our case, coffee), where the predicted purchase date is on the current day. In addition, the Audience filter includes only those customers who have agreed to receive communications. 1. Start the workflow with the **Audience** node and open the node's settings. 2. In **Define audience**, choose **New Audience** and click **Define conditions**. 3. From the **Choose filter** drop-down menu, choose the **product.purchasePredictedTime** event. 4. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **predictedTime**. 5. From the **Choose operator** drop-down menu, select **Date > Current date > Matches current day**. 6. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **predictedTime**. 7. From the **Choose operator** drop-down menu, select **Date > Current date > Matches current month**. 8. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **predictedTime**. 9. From the **Choose operator** drop-down menu, select **Date > Current date > Matches current year**. 10. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **category**. 11. From the **Choose operator** drop-down, choose **Equal**. 12. Type the name of the product category - `coffee`. 13. Define the time range to the **Last 30 days**. 14. From the **Choose filter** drop-down, choose the **newsletter_agreement** parameter. 15. From the **Choose operator** drop-down, choose **Equal** and and specify the condition as **enabled**. 16. Confirm by clicking **Apply**.
Automation Hub Profile Filter node configuration with purchase prediction, category, and newsletter conditions
Configuration of the Audience node
### Define the Send Email node In this step, choose an email template for the upcoming purchase. 1. To the **Matched** path, add the **Send Email** node and open its settings. 2. In the **Sender details** section, choose the email account from which the email is sent. 3. In the **Content** section, select the template that you prepared as a part of the prerequisites. 4. **Optional**: In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 5. In the **Additional parameters** section, optionally describe campaigns with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 6. Click **Apply**. ### Add final settings to your workflow 1. Add the **End** node. 2. Launch the workflow by clicking **Save & Run**.
Automation Hub workflow for sending upcoming purchase reminder notifications
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: - [Expression](https://app.synerise.com/analytics/expressions/04e342d8-5e14-4d7b-be39-a6bf117c1bff) - [Aggregate](https://app.synerise.com/analytics/aggregates/0b329a23-4a80-3522-8938-981254f92150) - [Workflow for purchasing time calculations](https://app.synerise.com/automations/automation-diagram/44c9e618-f72a-4720-8dbc-774f8752ad30) - [Workflow for sending a mailing communication](https://app.synerise.com/automations/automation-diagram/dfaf267d-c186-40c3-965f-810646b4a982) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 12 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~2), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~2), `product.purchasePredictedTime` (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Email campaigns](/docs/campaign/e-mail) - [Expressions](/docs/crm/expressions) - [Segmentation](/docs/analytics/segmentations) # Recommendation with last seen items When providing product recommendations on the page displaying the cart summary or during the checkout process, it’s essential to avoid suggesting items the customer has just added to their cart — otherwise, the experience can feel redundant and irrelevant. In this use case, we build a recommendation that suggests from 1 to 10 products based on **last seen activity**, while using a **static filter to exclude the last 20 items added to the cart**. This setup ensures that: - The recommendation is grounded in the shopper’s actual behavior (last seen), - Redundancy is avoided by excluding what was just added to cart, - The experience feels intentional and clean, encouraging further discovery.
You can further enhance the experience by using item context (e.g. showing products in the same style, size, or color as those already viewed) — all directly supported through product feed attributes.
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable last seen recommendation model. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate returning IDs of the 10 last seen products](#create-an-aggregate-returning-last-seen-products). 2. [Create an aggregate returning SKUs of the last 20 products added to cart](#create-an-aggregate-returning-last-20-products-added-to-cart). 3. [Prepare an AI recommendation](#prepare-an-ai-recommendation) which excludes recently bought and items which are currently in the cart. ## Create an aggregate returning last seen products --- In this part of the process, create an aggregate that returns the ID of the last 10 products a customer had visited. The recently viewed product itself will not display in the template, but will serve as a context for recommendations. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi**. In **Size**, enter `10`. You can also add more results. 4. From the **Choose event** dropdown list, select the **Visited page** event. 5. As the event parameter, select **product:retailer_part_no**. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select the **product:retailer_part_no** parameter. 8. From the **Choose operator** dropdown list, select **Is true (Boolean)**. 9. Using the date picker in the lower-right corner, set the time range to **Last 7 days**. Confirm your choice with the **Apply** button. 7. Click **Save**.
Decision Hub Last Multi aggregate returning the product IDs of the last 10 visited pages in the past 7 days
Configuration of the aggregate returning the IDs of the last seen products
## Create an aggregate returning last 20 products added to cart --- In this part of the process, create an aggregate returning SKUs of the last 20 products added to cart in the last 30 days. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi**. In **Size**, enter `20`. You can also add more results. 4. From the **Choose event** dropdown list, select the **product.addToCart** event. 5. As the event parameter, select **$sku**. 9. Using the date picker in the lower-right corner, set the time range to **Last 30 days**. Confirm your choice with the **Apply** button. 7. Click **Save**.
Decision Hub Last Multi aggregate returning the SKUs of the last 20 products added to cart in the past 30 days
Configuration of the aggregate returning the SKUs of the last 20 items added to cart
## Prepare an AI recommendation --- In this part of the process, you will configure Last Seen AI Recommendations which excludes 10 recently visited items and last 20 products that have been added to cart. This will ensure that we do not recommend products that a customer has most recently interacted with. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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 an item feed. 5. In the **Type** section, choose the **Last seen** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 4. In our case, in the **Static filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **itemId**. 6. As an operator, choose **Not in**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Aggregate**. 8. From the list, choose the [aggregate, with 20 products added to the cart, created in the previous step](#create-an-aggregate-returning-last-20-products-added-to-cart). 4. Confirm by clicking **Apply**.
AI Hub recommendation static filter excluding the last 20 products added to cart using the cart SKU aggregate
Configuration of the static filter
4. In the **Elastic filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **itemId**. 6. As an operator, choose **In**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Aggregate**. 8. From the list, choose the [aggregate, with last seen products, created in the previous step](#create-an-aggregate-returning-last-seen-products). 4. Confirm by clicking **Apply**.
AI Hub recommendation elastic filter including only last seen product IDs using the last viewed product aggregate
Configuration of the elastic filter
8. Additionally define the boosting rules by clicking **Define** in the **Boosting** section. 9. In the **Additional settings** section, choose **Exclude already bought products**. If your company sells replenishable products, you can set exclusion for specific number of days, for example, exclude products bought not later than 30 days ago. 9. In the right upper corner, click **Save**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in our Synerise Demo workspace: - [Aggregate returning last seen products](https://app.synerise.com/analytics/aggregates/1162c599-338f-32f7-ba20-b1bb64fcaed0) - [Aggregate returning last 20 products added to cart](https://app.synerise.com/analytics-v2/aggregates/72e0076e-8076-38a5-8bc1-29c3aa9c8013) - [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/nNL1ec4aj19V) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Recommendations](/docs/ai-hub/recommendations-v2) # Predict Customer Propensity to Buy Items from Specific Brands You can use the Predictions feature to calculate the probability of customers buying items from a particular brand. The results can be used for better targeting of your marketing efforts. In this use case, we present a prediction that returns the probability of purchase if the item matches one of two brands selected for the analysis. If you want to create a prediction for only one brand, you will need to skip a few steps in the instructions.
Propensity to buy items from one of two matching brands
Propensity to buy items from one of the brands added to the analysis
## Prerequisites --- - [Enable the Propensity prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-propensity-and-best-fit-predictions). - The item catalog must include information about item brand and that attribute must be added to [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes). ## Creating the prediction --- 1. Go to AI Hub icon **(AI Predictions) Models > New prediction** and select **Propensity** as the prediction type. 2. Select an audience for the prediction. For more information, see the [Predictions quick start article](/docs/ai-hub/predictions/propensity#select-customers-to-be-analyzed). ### Define the brands In this section, you define the brands for which you want to calculate the prediction. This is done by creating a filter that will limit the calculation to items that match one of the selected brands 1. In the **Item feed** section, click **Define**. 2. Click **Choose item feed**. 3. Select the catalog that contains the items you want to make the prediction for. **Result**: the **Item filter** section appears. 4. Click **Define item filter**. 5. From the **Select attribute** drop-down list, select the attribute that denotes the brand in your item feed. You can use the search field. 6. From the drop-down list that appears, select the **Equal** operator. 7. From the list of available values that appears, select a brand. You can use the search field. You can only choose brands which already exist in the item feed. 8. If you want to add a second brand to the analysis: 1. Under the condition, click **Add filter**. 2. From the list that opens, select the same item filter as before. 3. Add the second brand by repeating steps 5-7. 4. Between the two brand filters, click **AND** and change the logic to **OR**.
Screenshot of an item filter that matches one of two brands
Item filter that matches one of two brands
9. Click **Save**. 10. Save the item feed configuration by clicking **Apply**. ### Additional settings and saving Configure the [additional settings](/docs/ai-hub/predictions/propensity#additional-settings) (or leave them at default) and click **Save & Calculate**. ## What's next --- After the calculation is completed, a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction. Based on the `snr.propensity.score` event, you can create segmentations of customers with different propensity and use those segmentations as campaign targets: - [email](/docs/campaign/e-mail) - [SMS](/docs/campaign/SMS) - [web push](/docs/campaign/Webpush) - [mobile push](/docs/campaign/Mobile) - [dynamic content](/docs/campaign/dynamiccontent) - [screen views](/docs/campaign/screen-views) Email, SMS, web push and mobile push can be sent manually or you can launch them by using [Automation Hub](/docs/automation). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [Propensity prediction](https://app.synerise.com/ai-v2/predictions/propensity/ozylkkojxbru) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1). ## Read more --- - [Predictions](/docs/ai-hub/predictions) # Use cases # Creating Segments Based on Quantiles for Targeted Marketing Quantiles are often used to describe the distribution of data. Segmenting customers based on quantiles is a powerful way to identify groups of customers with similar characteristics. This can be useful for a variety of business purposes, such as targeted marketing, product development, and customer service. In this use case you will create three segments of around 500, 700 and 1250 customers with marketing agreement with the help of quantiles in metrics. Customers will be assigned to a segment based on how their Client ID value meets the condition of quantiles. It is a simple way to create fixed size segments according to your business needs, for example to divide base into specific groups when sending emails, or when a 3rd party tool accepts a fixed maximum number of users. ## Prerequisites --- Implement solutions that collect marketing agreements from various touch points with your customers. ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](#create-a-segmentation) of customers with enabled newlsetter agreement. 2. [Create a metric](#create-a-metric) that returns the Client ID value which meets the condition of set quantile. 3. [Create a segmentation of 500 customers](#create-a-segmentation-of-500-customers). 4. [Create a segmentation of 700 customers](#create-a-segmentation-of-700-customers). 5. [Create a segmentation of 1250 customers](#create-a-segmentation-of-1250-customers). ## Create a segmentation --- In this part of the process, we create a group of customers with enabled newlsetter agreement. This segmentation will be used in a metric in the next step, and later divided into smaller segments of 500, 700 and 1250 customers. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New Segmentation**. 2. Enter the name of the segmentation. 3. From the **Add condition** dropdown list, select the **Email agreement** attribute. 4. Click the **Choose** button, and from the list of operators, choose **Equal**, and then select **enabled**. 5. Save the segmentation.
Decision Hub segmentation configuration for customers with email marketing agreement
Email marketing agreement segmentation configuration
6. In the **Preview** section, check the number of customers in the segmentation and make a note of it. In our case it is 2564. ## Create a metric --- In this part of the process create a metric with quantile that returns the value of client's Custom ID which meets the condition of this quantile. The metric reuses as a filter [the segmentation you created in the previous part of the process](#create-a-segmentation). A quantile is a value that divides a ranked set of data into equal parts. In this case, we get the quantile value by dividing the desired number of customers in the segment by all customers with the email agreement enabled. In our case, we want to have a segment of 500 customers from [the segmentation you created in the previous part of the process](#create-a-segmentation), which consists of 2564 customers: `500/2564≈0,19` `0,19` is the value of our quantile. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As **Type**, select **Profile**. 5. As the **Aggregator**, set **Quantile**. As the value, set the quantile for the first group which will be ~ `0,19`. 6. From the **Choose value** dropdown list, select **CLIENT_ID**. 7. Click **Enable filter**. 1. Click **Choose filter** and from the dropdown list, select [the segmentation you created in the previous part of the process](#create-a-segmentation). 2. Click **Choose operator** and from the dropdown list, select **Is true**. 3. Click **Apply**. 8. Click **# Format** and deselect **Use 1000 separator**. 9. Save the metric. 10. In the **Preview** section, check the **CLIENT_ID** value, it is approximately the client ID of the 500th customer with an email agreement enabled. Make a note of it. In our case it is `2527582910.8`. For further use, remove numbers after the dot. ## Create a segmentation of 500 customers --- Using the [the segmentation](#create-a-segmentation) and [the metric](#create-a-metric) you created in the previous part of the process, you will create a segmentation of 500 customers from the initial segmentation. This segment contains all customers with Client ID values below the the client ID's value of the 500th customer. 1. Go to Decision Hub icon**Decision Hub > Segmentations**. 2. Duplicate [the segmentation you created in the previous part of the process](#create-a-segmentation). 3. Rename the segmentation. 4. Click **Add condition**, and from the dropdown list, select **CLIENT_ID**. 5. Click the **Choose** button, and from the list of operators, choose **Less or equal to**. 6. As the **Value**, type the CLIENT_ID value from [the metric you created in the previous part of the process](#create-a-metric), in our case `2527582910`. 7. Save the segmentation.
Decision Hub segmentation configuration for the first 500 customers with email marketing agreement
500 customers with email marketing agreement segmentation configuration
## Create a segmentation of 700 customers --- Using the [the segmentation of 500 customers](#create-a-segmentation-of-500-customers) you created in the previous part of the process, and a modified metric, you will create a segmentation of 700 customers [from the initial segmentation](#create-a-segmentation). This segment contains all customers with Client ID numbers below the value of the 1200th Client's ID with the exclusion of the segmentation of 500 customers. We want to have a segment of 700 customers from [the initial segmentation you created in the previous part of the process](#create-a-segmentation), and we don't want to include the customers from [the segmentation of 500 customers](#create-a-segmentation-of-500-customers). To calculate the quantile: `(700+500)/2564≈0,46` `0,46` is the value of our quantile. ### Create a metric 1. Go to Decision Hub icon **Decision Hub > Metrics**. 2. Duplicate [the metrics you created in the previous part of the process](#create-a-metric). 3. Rename the metric. 4. Change the value of quantile to two groups summed, which in our case is `~0,46`. 5. Save the metric. 6. In the **Preview** section, check the **CLIENT_ID** value, and make a note of it. In our case it is `2660654991.9`. For futher use, remove the commas and numbers after the dot. ### Create a segmentation 1. Go to Decision Hub icon**Decision Hub > Segmentations**. 2. Duplicate [the segmentation of 500 customers you created in the previous part of the process](#create-a-segmentation-of-500-customers). 3. Rename the segmentation. 4. Change the CLIENT_ID value to [the metric result you created in in this step](#create-a-segmentation-of-700-customers), in our case `2660654991`. 4. Click **Add condition**, and from the dropdown list, select [the segmentation of 500 customers you created in the previous part of the process](#create-a-segmentation-of-500-customers). 5. Click the **Choose** button, and from the list of operators, choose **Is false**. 7. Save the segmentation.
Decision Hub segmentation configuration for 700 customers with email marketing agreement
700 customers with email marketing agreement segmentation configuration
## Create a segmentation of 1250 customers --- Using the [the segmentation of 700 customers](#create-a-segmentation-of-700-customers) you created in the previous part of the process you will create a segmentation of 1250 customers [from the initial segmentation](#create-a-segmentation). This segment contains all customers with Client ID numbers above the value of the 1200th Client's ID with the exclusion of previously created segmentations. 1. Go to Decision Hub icon**Decision Hub > Segmentations**. 2. Duplicate [the segmentation of 700 customers you created in the previous part of the process](#create-a-segmentation-of-700-customers). 3. Rename the segmentation. 4. Change the **CLIENT_ID** operator to **More than**. 5. Save the segmentation.
Decision Hub segmentation configuration for 1250 customers with email marketing agreement
1250 customers with email marketing agreement segmentation configuration
## 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: - [Segmentation of customers with marketing aagreement](https://app.synerise.com/analytics-v2/segmentations/2bc65c4b-6995-48d5-bd62-54b58cf1456f) - [Metric for 500 customers](https://app.synerise.com/analytics/metrics/b4a537e9-ba5a-4a23-ba07-bac195d47d01) - [Segmentation of 500 customers with marketing agreement](https://app.synerise.com/analytics-v2/segmentations/3ef7ceab-6dc3-42e8-bda8-524106e10083) - [Metric for 700 customers](https://app.synerise.com/analytics/metrics/f4a403cd-f7a7-4f11-93c4-00bb2821cbcf) - [Segmentation of 700 customers with marketing agreement](https://app.synerise.com/analytics-v2/segmentations/47422b14-4842-4b27-a109-ea8d1e0c7d40) - [Segmentation of 1250 customers with marketing agreement](https://app.synerise.com/analytics-v2/segmentations/b28da5bc-10ee-418f-9b14-5e707853ea73) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Metrics](/docs/analytics/metrics) - [Segmentation](/docs/analytics/segmentations) # OAuth Integration via Firebase JWK Authentication OAuth-based authentication is one of the most secure and scalable ways to identify users across platforms. In this use case, we show you how to integrate Firebase Authentication with Synerise Identity and Access Management (IAM) using the JWK method. This setup allows you to authenticate users via Firebase and automatically create or update their Synerise profiles — all based on validated token data, without handling credentials directly. This method is ideal for mobile and web applications that use Firebase for user authentication and need to seamlessly connect those identities with Synerise.
Diagram showing OAuth-based authentication flow between Firebase and Synerise IAM
## Prerequisites --- - Firebase project with OAuth enabled. More info in [Firebase documentation](https://firebase.google.com/docs). ## Process --- In this use case, you will go through the following steps: 1. [Enable OAuth Method in IAM](/use-cases/firebase#enable-oauth-method-in-iam). 6. [Integrate the method in the mobile application](/use-cases/firebase#integrate-in-mobile-application). ## Enable OAuth Method in IAM --- In this part of the process, you will activate OAuth-based authentication in Synerise. 1. Go to **Settings > Authentication for mobile apps** 2. Choose and click **OAuth** from Authentication methods. 3. Enable the OAuth method. 4. Provide a name for this authentication method. 5. Select JWT_TOKEN as the authentication method. 6. In **Endpoint URI** provide the URI where the JSON Web Key (JWK) is stored. For Firebase, use: `https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com`
Synerise IAM OAuth method settings showing JWT_TOKEN configuration and JWK endpoint URI
7. Enable the **Identification based on OAuth response data** option. 8. Specify a unique identifier key from the token (for example, `user_id` or `sub`).
Synerise IAM OAuth settings with identification based on OAuth response data enabled
9. Map any additional fields from the OAuth response token to corresponding Synerise profile attributes as needed.
Synerise IAM OAuth settings showing token field mapping to Synerise profile attributes
**Example of a decoded Firebase token:**
{
         "iss": "https://securetoken.google.com/chat-41de4",
        "aud": "chat-41de4",
        "auth_time": 1760008107,
        "user_id": "Lanl0b6unJUPX0QEHBhqsQRSsJq1",
        "sub": "Lanl0b6unJUPX0QEHBhqsQRSsJq1",
        "iat": 1760008107,
        "exp": 1760011707,
        "email": "john.doe.test@example.com",
        "email_verified": false,
        "firebase": {
        "identities": {
         "email": ["john.doe.test@example.com"]
        },
         "sign_in_provider": "password"
        }
10. Enable Claim Validation. It is recommended to enable claim validation to verify token claims during the authentication process. This ensures that only valid and trusted tokens are accepted.
Synerise IAM OAuth settings with claim validation enabled
11. To save your settings, click **Apply**. ## Integrate in mobile application -- In this final step, you will implement login via the Synerise Mobile SDK. After a user successfully logs in via OAuth, invoke the authentication method from the Synerise mobile SDK: [Authenticate Customer by Identity Provider – Mobile SDK](/developers/mobile-sdk/method-reference/android/client-authentication#authenticate-customer-by-identityprovider). Upon successful authentication, a customer profile is automatically created and recognized within Synerise. This integration ensures that users authenticated via Firebase are automatically recognized in Synerise without managing credentials separately. It allows seamless identity synchronization, enabling consistent user data for personalization, analytics, and automation.
Synerise customer profile created after Firebase OAuth authentication
Profile
## More information --- If you need more information about the autentication process, we recommend you to start the [free course](https://academy.synerise.com/course/android-integration-labs) on our Synerise Academy platform. This course will teach you how to implement Synerise features in your mobile applications by using an example application and explaining how to add functionalities to it, step-by-step. After each codelab, you can check the related folders in our Github repository to see if your code matches the expected results. You need to just create a free account to be able to start the course. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`client.add`](/docs/assets/events/event-reference/profiles#clientadd) (~1), [`client.identify`](/docs/assets/events/event-reference/profiles#clientidentify) (~1). ## Read more --- - [Method reference - Android - Mobile SDK - mobile SDK help](/developers/mobile-sdk/method-reference/android/client-authentication#authenticate-customer-by-identityprovider) - [OAuth - OAuth documentation](/docs/settings/tool/iam-for-apps/oauth) # Calculating Customer Age from Birthdate Attribute The Customer Age Calculation offers businesses a robust solution to automatically calculate their customers' age based on the birthdate attribute. This approach has several noteworthy benefits for businesses: - Improved Customer Insights: Access to age demographics enables more informed decision-making, enhancing the effectiveness of marketing initiatives and customer engagement strategies. - Personalized Customer Experiences: Armed with accurate age data, businesses can provide tailored interactions and experiences, such as age-specific discounts, content recommendations, and product suggestions. - Compliance and Age Verification: In industries governed by age-related regulations, such as age-restricted products or services, this use case serves as a robust tool for age verification, ensuring compliance and safeguarding against unauthorized access. In this use case, you will verify the presence of the birthdate attribute within a customer's profile. Upon confirmation, the use case proceeds with a series of precise calculations. In summary, this process simplifies age calculations, it will enrich customer understanding, enable personalized interactions, and contribute to more effective marketing campaigns and age-related compliance. What's more, this calculation also takes leap years into account. ## Prerequisites --- - Implement [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Import of customer base with birthdate attribute.
To collect birthdates from customers already in the database without this attribute, consider using targeted email campaigns with incentives, implementing loyalty programs that require birthdate information, engaging customers on social media with contests, and training customer support to politely request this missing data during interactions, emphasizing the benefits of sharing it. These methods will enhance your customer relationships and enable tailored marketing strategies.
## Process --- In this use case, you will go through the following steps: 2. [Create an expression](#create-an-expression). 2. [Create a segmentation](#create-a-segmentation). ## Create an expression --- Create an expression that will calculate age of a customer based on the birthdate attribute. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 2. As a type of expression, select **Attribute**. 3. Click the **Select** button and select **Function**. 4. From the dropdown list, select **To date**. 5. Click the **Select** button. 6. From the dropdown list, select **Profile**. 6. Click **Unnamed** to display the settings. 7. Choose the **birthdate** attribute. 6. Save the expression.
Expression settings
Expression with age calculation
## Create a segmentation Create a segmentation that groups profiles whose birthday falls on the current date. In the settings of the segmentation, you will use the expression you created in the [previous step](#create-an-expression). 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentation > New Segmentation**. 2. Enter the name of segmentation. 3. From the list, select an expression created in the [previous step](#create-an-expression). 7. Choose the **Matches current day** operator. 7. From the **Add condition** dropdown list, select again the expression created in the [previous step](#create-an-expression). 7. Choose the **Matches current month** operator. 9. Click **Save**.
Segment configuration
Segment configuration
## Check the use case set up on the Synerise Demo workspace --- Check the prepared [expression](https://app.synerise.com/analytics/expressions/61824dcd-6689-490b-838d-d31c0998be0c) and [segmentation](https://app.synerise.com/analytics-v2/segmentations/cdb3467d-a292-4916-b075-0e14a63ec2f2) directly in the Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Expressions](/docs/crm/expressions) - [Functions in expressions](/docs/crm/expressions/functions-in-expressions) - [Birthday-related use cases](/use-cases/?query=birthday&ordering=DESC&sortBy=publishDate) # AI recommendations in blog posts Blogging enables you to reach your target group in an easier way than other conventional marketing channels. Preparing articles connected with your offer can promote your products or brand, attract an audience, and establish you as an authority in the field. If you have a blog with a lot of readers, there may be a great opportunity to boost revenue because you can implement recommended products below your blog posts or inside them and make it easier to find the products that engage readers. This use case describes how to enrich a blog with recommendations of outdoor running shoes suitable for specific terrains. The output of the use case are two separate frames which present the following recommendations: - Bestselling road racing shoes - the filters of the recommendation use custom `surface` attribute set to `asphalt`. - Bestselling trail racing shoes - the filters of the recommendation use custom `surface` attribute set to `off-road`.
AI recommendations in a blog post
AI recommendations in a blog post
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) to the blog. - [Import a product feed](/use-cases/import-product-feed-to-catalog). ## Process --- In this use case, you will go through the following steps: 1. [Preparing AI recommendations](/use-cases/ai-recommendations-blog-post#prepare-ai-recommendations). 2. [Create dynamic content campaign](/use-cases/ai-recommendations-blog-post#create-dynamic-content). ## Prepare AI recommendations --- As the first part of the process, create two separate AI recommendations: - Bestselling racing shoes suitable for running on asphalt - Bestselling racing shoes suitable for running off-road The recommendations will differ only in the filter conditions. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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 and click **Define**. 4. From the **Items feed** dropdown list, select a product feed that has a trained model. 5. Select the **Top products** recommendation type.
Selected type and product feed of the recommendation
Selected type and product feed of the recommendation
6. In the **Items** section, click **Define**. 7. Click **Add slot**. 8. Click the **Unnamed slot** that was created. 8. Define the minimum and maximum number of products displayed in the frame according to your needs. 9. In the settings of the **Static filters**: - For the bestselling racing shoes suitable for running on asphalt:
Configuration of static filters for asphalt shoes
Configuration of static filters for racing shoes suitable for running on asphalt
- For the bestselling racing shoes suitable for running off-road:
Configuration of static filters for racing shoes suitable for running off-road
Configuration of static filters for racing shoes suitable for running off-road
10. In the **Additional settings**, click **Define**. 11. From the **Sort metric** dropdown list, select **Conversion Percent in the last 30 days**.
A metric that arranges the order of the items in the recommendation according to the conversion percentage
A metric that arranges the order of the items in the recommendation according to the conversion percentage
12. Click **Save**. 13. Create the second recommendation. Repeat the steps. ## Create dynamic content --- Create two sets of dynamic content to insert the recommendations on your blog. The first set will use in the dynamic content template the AI recommendation that contains bestselling racing shoes suitable for running on asphalt, the other bestselling racing shoes suitable for running off-road. Apart from that, you will put them in different blog posts.
If you don’t want to use dynamic content, you can retrieve recommendations through API, [using this method](https://hub.synerise.com/api-reference/ai-recommendations#tag/Recommendations/operation/GetRecommendationsByCampaignV2)
1. Go to **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 1. Choose **Insert Object** type. 2. As the audience, select **everyone**. 3. In the **Content** section, select **Simple message**, and specify the CSS selector where you want to insert recommendations. 4. In the **Content** tab, click **Create Message**. 5. In the code editor, insert Jinjava with the AI recommendation and add your own CSS.
Click to see Jinjava

Replace `your_campaign_ID` with the ID of the AI recommendation (either of the bestselling shoes suitable for asphalt or off-road). The ID of the AI campaign is contained in the URL of the recommendation.

<!-- Downloading the AI campaign --> {% recommendations3 campaignId=your_campaign_ID %} {% for p in recommended_products3 %} <li data-snr-ai-product-id="{{p.itemId}}"> <a class="snrs-AI--item-link" href="{{p.link}}" title="{{p.title}}"> <img src="{{ p.imageLink }}"class="products-slider__item-image snrAI-product-image snrAI-product-image-{{p.itemId}}" width="90" alt="{{p.title}}" id="snrAI-image-{{p.itemId}}"> <h3 class="snrs-AI-product--product-name"> <span class="snrs-AI-product--name-first">{{p.title}}</span> </h3> <span class="snrs-AI-product--series">{{p.attributes.series}}</span> </a> </li> {% endfor %} {% endrecommendations3 %}
8. Save the template. 5. In the **Schedule** section, select the date when the dynamic content is activated. 6. In **Display settings**, configure the settings: - **Triggers** set to **On landing**. - Leave **Delay** at default. - In the **Page targeting** section, select **Others**: - Under **Display on pages** banner, click **Add rule**. - From the dropdown list, select **Page containing URL**. - In the text field, enter the link to your blog post. - Leave the rest of the settings at default.
`Screenshot presenting display settings`
Display settings
6. Confirm by clicking **Apply**. 7. In the **UTM & URL parameters** section, click **Skip step**. 8. Activate the dynamic content. 9. Create the second dynamic content template to display the recommendations with the other group bestselling shoes for specific terrain. Repeat all the steps. **Result**: The recommendation frames are displayed at the URLs with the blog posts. ## Generated events This use case generates approximately 8 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~2), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~2), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~2), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [API Recommendations](https://hub.synerise.com/api-reference/ai-recommendations#tag/Recommendations) - [Dynamic content campaigns](/docs/campaign/dynamiccontent) - [Recommendations](/docs/ai-hub/recommendations-v2) # Pop-up with a reminder about abandoned products in the cart An effective strategy for online businesses to retrieve lost sales is through an abandoned cart pop-up message. Such notifications serve as a reminder to customers about the products they have left in their shopping cart and urges them to finalize their purchase. They often include a personalized message, a list of items left in the cart, and a call-to-action button to encourage the customer to complete their purchase. By using this method, online businesses can potentially increase sales and improve customer engagement while being cost-efficient. This use case describes the implementation of dynamic content (DC) with abandoned cart notification. With predefined dynamic content web layer templates, you can create such a DC much faster without having to create a template from scratch.
The view of the dynamic content pop-up message
## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes). - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Implement the `cart.status` event](/developers/web/cart), which stores the current status of the basket in the form of an event on the profile's card. The event has to be sent to Synerise after every change in the cart status. - Collect [product.addToCart event](/docs/assets/events/event-definitions). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggregate) that returns the products in the cart for every individual customer. 2. [Create a dynamic content](#create-a-dynamic-content) with the contents of the abandoned cart using the predefined template. ## Create an aggregate --- In this step, create an aggregate that returns the list of products in a cart. The result of the aggregate will be used to display products in your dynamic content. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 5. From the **Choose event** dropdown list, select the `cart.status` event. 6. As the event parameter, select **products**. 7. Set the period from which the aggregate will analyze the results to **Lifetime**. 12. Save the aggregate.
Decision Hub Last aggregate returning the products parameter of the last cart.status event over a customer's lifetime
Configuration of the aggregate
## Create a dynamic content --- Create a dynamic content campaign with abandoned cart items using a predefined web dynamic content layer template. This dynamic content will be displayed as a pop-up on your site for customers who haven't made a transaction within an hour from adding the product to cart. 1. Go to Experience Hub icon **Experience Hub > Dynamic Content > Create new**. 2. Enter the name of the content. 3. Choose **Web layer** type. ### Define Audience 1. In the **Audience** section, select **New Audience** and click **Define conditions**. 1. From the **Choose filter** dropdown list, select the `product.addToCart` event. 2. Click the calendar in the right bottom of the page. 1. In the **Relative date range** section, define the analyzed period. In this case, choose **Today**. 2. Click **Apply**. 3. Click **Choose filter**, from the dropdown list, select the `product.addToCart` event. 4. Click **add funnel step**. 5. From the **Choose event** dropdown list, select the `transaction.charge` event. 6. Change **matching** to **not matching**. 7. Click the calendar in the right bottom of the page. 1. In the **Relative date range** section, define the analyzed period. In this case, choose **Today**. 2. Click **Apply**. 8. Click the clock next to the calendar. 1. Type `1` and from the dropdown list, select **Hours**. 2. Click **Apply**.
The view of the Dynamic Content Audience configuration
Audience configuration
8. To save the audience, click **Apply**. ### Define content 1. In the **Content** section, click **Create Message**. 2. From the list of template folders, select a folder with the predefined **Web layer templates**. **Result:** You are redirected to the list of predefined templates.
The view of the Web layer templates folder
Web layer templates folder
3. Select the **Abandoned cart** template. **Result:** You are redirected to the template builder.
You can edit the template in two ways, by editing the code of the template ([add snippets](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit the form in the Config tab The form in the Config tab is already filled in with default values. You can keep them or change them to fit your business needs. 1. From the **Aggregate with products left in the cart** dropdown list, select the ID of the aggregate you created [in the previous step](#create-an-aggregate). You can find it by typing its name or ID in the search box. 2. In the **Header text** field, define the header you want to display in the pop-up message. 3. In the **Currency** field, specify the currency in which you want to display the prices of the items. 4. In the **Bottom text** field, define the copy you want to appear on the bottom of the page. 5. In the **Font** field, define the font of all text displayed in the dynamic content. 6. Define the colors in the **Bottom bar background** and **Bottom bar text color**. 7. Choose the most suitable carousel scrolling method for you by enabling one or all toggles the same time: - **Carousel autoplay**: activation of this toggle allows automatic scrolling of items in the carousel; - **Carousel loop**: activation of this toggle allows users to navigate to the first article in the carousel by clicking the arrow after the last article displayed in the carousel; - Enabling these two options at the same time will combine these functionalities. In this case, the recommendation carousel will scroll automatically and return to the first item automatically after displaying the last one. - If you don’t activate any of the toggles, users will have to scroll through the carousel on their own, and when they get to the last item, it won’t automatically redirect them to the beginning of the carousel 8. In the following fields, define the item amount that you would like to display in small, medium, large and extra large screens. 9. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer.
Select a customer who has the `product.addToCart` event in their activity list in **Behavioral Data Hub > Profiles**.
3. Click **Apply**.
If you are using custom attributes in your product feed, you need to replace the names of the standard attributes used in the template code with the names of the attributes used in your feed.
10. If the template is ready, in the upper right corner, click **Save this template > Save as**. 11. On the popup: 1. In the **Template name** field, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 12. To continue the process of configuring the dynamic content campaign, click **Next**. 13. To save your content changes, click **Apply**. ### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. In our case, we will define the frequency of dynamic content to be displayed to **Once per day**. You can also define the type of device you want to show your dynamic content. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the the configuration of each step from this use case in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/17d214c4-5644-33b1-b0c6-9fab96b26b3e) - [Dynamic Content](https://app.synerise.com/campaigns/create/3cbc322f-74e4-4fb8-8897-8ef9d96fdd9c) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`cart.status`](/docs/assets/events/event-reference/items#cartstatus) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic content template builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder) - [Snippets](/docs/assets/snippets) # Sync Microsoft Azure Forms Data with Synerise for Customer Profile Updates You can integrate Microsoft Azure Forms with Synerise to collect data from the forms in Synerise and create new customer profiles or update the existing ones. In this use case, a submission of a form that contains three fields (name, surname and email address) launches a workflow that creates a customer profile or updates an existing profile with identical credentials.
Completing this procedure requires some knowledge on sending API requests using cURL, Postman, or similar tools.
Workflow that sends data from forms to Synerise
## Prerequisites --- Access to Microsoft Forms and Microsoft Azure. ## Process --- In this use case, you will go through the following steps: 1. [Create an incoming webhook](/use-cases/send-data-from-forms#create-an-incoming-webhook). 2. [Create a form](/use-cases/send-data-from-forms#create-a-form). 3. [Create a workflow](/use-cases/send-data-from-forms#create-a-workflow). ## Create an incoming webhook --- Create an incoming webhook to which you will send the data submitted through Microsoft Forms. 1. In Synerise, go to **Automation Hub > Incoming > New integration**. 2. Enter the name of the webhook. 3. In the **Endpoint** section, click **Define**.
The URL field is already is filled in with the endpoint to which the data submitted throught the form will be sent.
1. Optionally, you can add an icon to this integration. 3. Confirm by clicking **Apply**.
Configuration of the Endpoint section
Configuration of the Endpoint section
4. In the **Incoming data** section, click **Define**. 5. Click **Retrieve data**. Right after you click the button, send a request to the endpoint in the **Endpoint** section with the sample of data that will be sent through forms. The system waits for the incoming request for 1 minute and 30 seconds. Example request:
Replace the endpoint URL from the example with the endpoint URL from step 3.
curl --location --request POST 'https://{SYNERISE_API_BASE_PATH}/automation-endpoint/endpoints/END_ID/trigger' \
   --header 'Content-Type: application/json' \
   --data-raw '{
    "firstname": "test",
    "lastname": "test",
    "email": "test"
   }'
6. When the endpoint receives data from the request, verify the list of variables. If the variables include those which are in the payload (in this case, firstname, lastname, and email), click **Define**. If not, click **Start again** re-send request, and wait for the results.
Collected variables from the request
Collected variables from the request
7. Click **Save & publish**.
You can read the documentation of Incoming integration [here](/docs/automation/integration/incoming-webhook-node).
## Create a form --- In this part of the process, you need to create a form in Microsoft Forms app and configure the flow of sending data from the form to Synerise. 1. Go to Microsoft Forms app. 2. Create a form.
If you need help, you can refer to the [documentation](https://support.microsoft.com/en-us/office/create-a-form-with-microsoft-forms-4ffb64cc-7d5d-402f-b82e-b1d49418fd9d).
Example form used in this use case
Example form used in this use case
3. Go to Azure Portal. From the list of Azure services, select Logic Apps. If you don't see the icon right away, click **More services** and find the app.
Azure services available in the Azure Portal
Azure services available in the Azure Portal
4. As the connector of the Logic App, select Microsoft Forms.
Example form used in this use case
Connecting Logic App with Microsoft Forms
4. As a trigger, from the dropdown list, select **when a new response is submitted**. 5. Choose the form you want to connect.
Selecting a form
Selecting a form
6. In the panel of operations, choose **Microsoft Form Standard**. As an action, choose **get response details**. 7. From the **Form Id** dropdown list, select the ID of your form. 8. From the **Response Id** dropdown list, As response Id select **List of response notifications Response Id**.
Selecting an action to be performed when a form is submitted
Selecting an action to be performed when a form is submitted
9. In the panel of operations, choose **HTTP**. Configure this section according to the [incoming webhook](/use-cases/send-data-from-forms#create-an-incoming-webhook) you created before. The body must be identical to the body you defined in the incoming webhook in Synerise.
Configuring the endpoint section
Configuring the endpoint section
10. Save the workflow. ## Create a workflow --- In this part of the process, you create a workflow in Synerise. The workflow starts with the business event trigger that is launched every time a customer submits the form. In response to that, a customer profile is created or updated if it exists already. 1. In Synerise, go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, select **Business Event**. In the configuration of the node: 1. Select the incoming webhook you created as the first part of this use case. 2. Confirm by clicking **Apply**.
Configuring the Business Event node
Configuring the Business Event node
4. Add the **Outgoing Integration** node to the workflow. In the configuration of the node: 1. Enter the name of the webhook. This name will be used as a value of the `name` parameter of the `webhook.response` event. 2. Select the **POST** method. 3. Enter the endpoint URL: - For workspaces hosted in Microsoft Azure EU: `https://api.synerise.com/v4/clients/batch` - For workspaces hosted in Microsoft Azure USA: `https://api.azu.synerise.com/v4/clients/batch` - For workspaces hosted in Google Cloud Platform: `https://api.geb.synerise.com/v4/clients/batch` 4. Enter the following headers: - set the `content-type` header to `application/json` (default), - set the `accept` header to `application/json`, - set the `api-version` header to `4.4` 5. Enter the request body. For the form used in this case, the body is as follows:
{
           "email": "{{ request.body.email }}",
           "firstname": "{{ request.body.firstname }}",
           "lastname": "{{ request.body.lastname }}"
       }
5. In the **Authorization** section, select **By API key**. 6. From the dropdown list, select API key that has permissions to create or update customer's data.
You can read more about API keys [here](/docs/settings/tool/api) and you can find more information about the endpoint and required API key permissions [here](https://hub.synerise.com/api-reference/profile-management#tag/Profile-management/operation/BatchAddOrUpdateClients).
6. Confirm by clicking **Apply**.
Configuring the Outgoing Integration node
Configuring the Outgoing Integration node
7. Add the **End** node. 8. Activate your workflow by clicking **Save & Run**.
Automation Hub workflow for sending data from web forms
Final workflow configuration
## Testing --- If the workflow works, you will see a new/updated customer in **Behavioral Data Hub > Profiles** and a success in the statistics of the **Outgoing Integration** node:
Workflow statistics
Workflow statistics
## Watch video --- You can watch the video that presents the whole process of implementing this use case.
Send data from Microsoft Azure Forms to Synerise
## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check the configuration of: - the [incoming integration](https://app.synerise.com/automations/custom-blocks/integrations/incoming/edit/a205358b-d82b-4e35-88a3-b511d8e3a04d) - the [workflow](https://app.synerise.com/automations/automation-diagram/f3c9163c-a6e8-4276-a11c-6e45ce1f181f) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: `incoming webhook event` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integrations](/docs/automation/integration) # Efficiently Sync Customer Data Across Multiple Platforms Using Automation If you manage the customers' data in several places at once, you can use Automation Hub to synchronize it. It's possible thanks to the HTTPS and SFTP integrations that allow you to send data from Synerise to external sources and the other way round. This use case describes how to prepare an automated workflow that launches every day and sends the updated list of customers with the agreement for email communication from Synerise to an external resource using the SFTP protocol. One of the challenges addressed in this use case is modifying the value of the customer attribute (a newsletter agreement attribute) so the data structure is consistent. ## Prerequisites --- - You must have customers in **Behavioral Data Hub > Profiles**. - You must have a target resource with which you synchronize the data (in this use case, an SFTP server is used). ## Process --- 1. [Create a segmentation of customers](/use-cases/synchronize-profile-data-with-external-services#prepare-a-segmentation) whose data you want to send to the external resource. 2. [Prepare a transformation](/use-cases/synchronize-profile-data-with-external-services#prepare-a-transformation) to modify the data to meet the requirements of the external resource data structure. 3. [Prepare a workflow](/use-cases/synchronize-profile-data-with-external-services#prepare-a-workflow) that sends the data of customers from Synerise to the external resource. ## Prepare a segmentation --- As the first part of the process, create a segmentation of customers who agreed to receive emails. Data of these customers will be sent to the external resource. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. As the name of the segmentation, enter `Subscribers`. 3. Click **Add condition**. 4. From the dropdown list, select `newsletter_agreement`. 5. As the logical operator, select **Equal**. 6. In the text field, enter `enabled`. 7. Click **Save**.
The configuration of the segmentation
The configuration of the segmentation
## Prepare a transformation --- In this part of the process, you define the rules of modifying data before sending it to the SFTP server, so the data is consistent. For the purposes of this case, a `newsletter_agreement` parameter value will be changed from `enabled` to `true`. Additionally, we add a parameter which marks data as imported, so this import can be distinguished in the SFTP server. The transformation which is the output of this part of the process is used later to [automate sending the data](/use-cases/synchronize-profile-data-with-external-services#prepare-a-workflow). ### Prerequisites You need a sample of data that will be used in data transformation. You can add it in two ways: - Prepare a `.csv` file with a few columns and example values.
Click here to see an example file
clientId,email,newsletter_agreement 111111111,john.doe@synerise.com,enabled 222222222,kathy.smith@synerise.com,enabled 333333333,lily.novak@synerise.com,enabled 444444444,matt.turner@synerise.com,enabled
- Export several customers from **Behavioral Data Hub > Profiles** to a `.csv file`.
Click here to read the instructions
  1. Go to Behavioral Data Hub > Profiles
  2. On the list, select several customers.
  3. At the top of the list, click the Export button.
  4. On the pop-up, enter the name of the export.
  5. Select three attributes: email, clientId, and newsletter_agreement.
  6. Click Apply.
  7. On the pop-up, click Go to Reports.
  8. On the list, find your export.
  9. Next to the export, click the Three dot icon icon.
  10. From the context menu, select Download.
    Result: A `.csv` file is downloaded.
1. Go to Automation Hub icon **Automation Hub > Transformations > New transformation**. 2. Enter the name of the transformation. 3. Click **Upload a new file or drag one here**. ### Add file with sample data This step allows you to add a data sample. In further steps, you define how the data must be modified. Later, when this transformation is used in the workflow, the system uses the rules created with the sample data as a pattern for modifying actual data. 1. Upload the file with the sample data. 2. Set **Delimiter** and provide **Quotation mark** and **Escape character**. 3. Click **Apply**.
Transformation file upload showing sample data for profile synchronization with external services
The configuration of the file upload
### Edit the newsletter_agreement value The **Edit Values** step allows you to replace the `enabled` value of the `newsletter_agreement` attribute with `true`. 1. On the right panel, click **Add step**. 2. From the dropdown list, select **Edit Values**. 3. Click the **Edit Values** step. 4. In the configuration of the step: 1. Select the **newsletter_agreement** column. 2. Under **Edit values by**, from the dropdown list, select **Replacing**. 3. In the dropdown below, leave the **Static value** option at default. 4. In the text field, enter `true`. 5. Confirm by clicking **Apply**.
The configuration of the Edit Values step
The configuration of the Edit Values step
### Add the parameter which marks data as imported The **Add Column** step allows you to add a column to the data. As a result, you can easily identify the import in the external source (the SFTP server). 1. On the right panel, click **Add step**. 2. From the dropdown list, select **Add Column**. 3. In the configuration of the step: 1. In the **Add Column** field, enter `importType`. 2. In the dropdown, select **Static value**. 3. In the text field, enter `synerise_subscribers`. 4. Confirm by clicking **Apply**.
The configuration of the Add Column step
The configuration of the Add Column step
### Preview and save the transformation 1. Preview the results in the **Output** tab.
The preview of modifications to the file
The preview of modifications to the file
2. In the upper right corner, click **Save**.
Transformation for synchronizing customer profile data with external services
The transformation configuration
## Prepare a workflow --- As the final part of the process, create a workflow which sends the customers' data every day to the external source using the SFTP protocol. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 1. As the trigger node, add **Scheduled Run**. 2. In the configuration of the node: 1. Select the **Repeat runs** option. 2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace. 3. Define the frequency of the workflow (for example, every day at 6.00 A.M.). The workflow will automatically launch every day at 6.00 A.M. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering profile data synchronization with external services
The configuration of the Scheduled Run node
### Select customers to export 1. Add a **Get Profiles** node. 2. In the configuration of the node: 1. Select **Segments** and then the segmentation you [created in the first part of the process](/use-cases/synchronize-profile-data-with-external-services#prepare-a-segmentation). 2. In the **Attributes values** section, select **newsletter_agreement** and **email**. 3. Confirm by clicking **Apply**.
Automation Hub Get Profiles node selecting customers by segmentation with newsletter agreement and email attributes for external service synchronization
The configuration of the Get Profiles node
### Select the transformation 1. Add a **Data Transformation Studio** node. 2. In the configuration of the node, keep the default **From workflow context** option. 3. In the editor, click **Templates library**: 1. Select the [transformation you have created before](/use-cases/synchronize-profile-data-with-external-services#prepare-a-transformation). 2. Click **Use template**. 4. Confirm by clicking **Apply**.
The configuration of the Data Transformation Studio node
The configuration of the Data Transformation Studio node
You can also create a transformation directly in the **Data Transformation Studio** node instead of selecting a template.
### Configure settings for SFTP protocol 1. Add the **Send File** node by clicking **THEN > SFTP - Send File**. 2. In the configuration of the node: 1. Select the SFTP connection type as **Public key**, choose the connection in the **Select connection** field, and click **Next**. 2. Enter the path to your server. 3. Select the port. 4. Enter the path to the directory. 5. Enter the name of the file. 6. If needed, in the **File name suffix**, select the suffix of the file name. 7. From the **File format** dropdown list, select the **CSV** format. 8. Verify and modify the delimiters if needed. 9. Confirm by clicking **Apply**.
The configuration of the SFTP Send File node for exporting profile data
The configuration of the SFTP Send File node
### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for synchronizing profile data with external services
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each item created in this use case on our Synerise Demo workspace: - [Segmentation of customers who agreed to receive newsletters](https://app.synerise.com/analytics-v2/segmentations/7655038e-99bc-4876-9d7a-90f801ae6a5c). - [Transformation](https://app.synerise.com/automations/data-transformation/19add353-ade6-406f-8e1c-db51229aa785). - [The workflow](https://app.synerise.com/automations/automation-diagram/72a4d7e2-d2a0-40bd-a1a2-373bb7ae33b8). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1). ## Read more --- - [Data Transformation](/docs/automation/data-transformation-and-imports/introduction) - [Segmentations](/docs/analytics/segmentations) - [Workflows](/docs/automation) # Send propensity-based customers to Facebook With Synerise you can choose very specific segments of customers for your marketing communication on Facebook and spend less on your campaigns. In this use case, you will use the Predictions feature to calculate the probability of customers buying items from shoes category. The results will be later used in the conditions of segmentation that will trigger the workflow. In the workflow we will use the native Facebook integration to send customers with highest propensity to buy, as a Custom Audience. This group of customers can be later used for better targeting of your marketing efforts. ## Prerequisites --- - [Enable the Propensity prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-propensity-and-best-fit-predictions). - [Generate the system user access token in Facebook](https://developers.facebook.com/docs/audience-network/optimization/report-api/system-user/); as the `scope` value, select `ads_management`. - [Create Custom Audience in Facebook](https://developers.facebook.com/docs/marketing-api/reference/custom-audience/) - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events). - Create an [item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements). - The `category` attribute must be added to [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes). ## Process --- In this use case, you will go through the following steps: 1. [Create a Propensity prediction](/use-cases/send-propensity-to-facebook#create-a-propensity-prediction) that produces the 2-point score (low and high). 2. [Create a segmentation](/use-cases/send-custom-audience-webhook#create-a-segmentation) of customers. 3. [Create a workflow](/use-cases/send-custom-audience-webhook#create-a-workflow). ## Create a Propensity prediction --- In this part of the process, you will create a propensity prediction to purchase any product from the shoes category for the audience of recognized customers (those that have the email attribute, and have a page vist event in the last 30 days). In further steps, an email address will be used as a customer identifier while sending audience to Facebook. ### Select the model type 1. Go to AI Hub icon **AI Hub > (AI Predictions) Models > New prediction**. 2. On the pop-up, select the **Create from scratch** option. 3. Select **Propensity**. 4. Name your prediction. ### Select customers to be analyzed Select the audience for whom you want to prepare a prediction. 1. In the **Audience** section, click **Define**. 2. Click **Choose segmentation**. 3. On the dropdown list, click **Create new**. 4. In the **Segmentation name** field, enter a meaningful name of the segmentation. 5. Click **Next step**. 5. Click **Add condition**: 1. From the dropdown list, select the `email` attribute. 2. From the **Choose operator** dropdown list, select **String** and **Is not empty**. 6. Once again click **Add condition**: 1. From the dropdown list, select the `Visited page` event. 2. In the calendar in the bottom right corner, leave **Last 30 days**. 7. Save the segmentation by clicking **Create segmentation**. 8. Click **Apply**.
The view of propensity audience configuration
Propensity audience configuration
### Define the item In this section, you define the category for which you want to calculate the prediction, in our case it's the shoes category. This is done by creating a filter that matches the category in the catalog. 1. In the **Item selection** section, click **Define**. 2. Click **Choose item feed**. 3. Select the catalog that contains the items you want to make the prediction for. **Result**: The **Item filter** section appears. 4. Click **Define item filter**. 5. From the **Select attribute** dropdown list, select the `category` attribute. 6. As the logical operator, select **Equal**. 7. Click **0 items**. **Result**: An **Array values** pop-up appears. 8. Use the search field to add the desired product category. In our case:`root catalog> default category>men>shoes`. 9. Click **Add**. 10. Click **Apply**. 12. Click **Add filter** and repeat steps **5-10** to add another category. In our case: `root catalog> default category>women>shoes`. 13. Click **Save**. 10. Save the item feed configuration by clicking **Apply**.
The view of propensity item filter configuration
Propensity item filter configuration
### Additional settings and saving Configure the [additional settings](/docs/ai-hub/predictions/propensity#additional-settings) (or leave them at default) and click **Save & Calculate**. **Result:** After the calculation is complete a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction. Based on the `snr.propensity.score` event, you can create segmentations of customers with different propensity. ## Create a segmentation --- Based on the `snr.propensity.score` event, create a segmentation of customers with high propensity to purchase any item from the shoes category. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 1. Click **Add condition**. 2. Select the `snr.propensity.score` event. 3. Click **+ where**. 4. As the event parameter, select `modelId` (available in the parameters of the `snr.propensity.score` event).
The wiev of properties of the snr.propenisty.score event
Properties of the snr.propenisty.score event
3. As the logical operator, select **Equal**. 4. In the text field, enter the value of the `modelId` parameter. 5. Click **+ and where**. 6. As the event parameter, select `score_label`. 7. As the logical operator, select **Equal**. 8. In the text field, enter `high`. 9. Set the date range according to your buisness needs. 5. Click **Save**.
The view of segmentation configuration
Segmentation configuration
## Create a workflow --- As the final part of the process, create a workflow that sends customers with the high propensity to buy items from the shoes category to Facebook. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Choose the segmentation of customers 1. As the first node of the workflow, add **Audience**. In the node settings: 1. In the **Define audience** section, select the [segmentation you created in the previous step](#create-a-segmentation), click **Apply** to confirm. 9. Confirm by clicking **Apply**. ### Configure the Facebook integration 1. On the **Audience** node, click **then**. 2. From the dropdown list, select the **Add Profiles to Custom Audience** node. 3. Click the node. 4. From the **Select connection** dropdown list, select an existing connection which allows you to authorize in Facebook Ad. If you haven't established a connection yet: 1. At the top of the dropdown list, click **Add connection**. 2. In the **Access token** field, paste the token generated as a part of [prerequisites](#prerequisites). 3. Click **Next**. 4. In the **Connection name**, enter the name of the connection (it will be only visible on the list of connections).
The connection can be re-used to any custom audience created in the Facebook Ad Account related to the token generated as a part of [prerequisites](#prerequisites).
3. In the **API version** field, enter the Facebook API version according to the [Facebook documentation](https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences/). 5. From the **Identified type** dropdown list, select **Email**. 6. In the **Identifier source** field, enter `{{ client.email }}`.
You can read more about Jinjava tags in Automation Hub [here](/developers/inserts/automation).
4. In the **Audience ID** field, enter the ID of the Custom Audience to which you want to send your group of customers. 5. Confirm by clicking **Apply**. ### Add the End node 1. On the **Add Profiles to Custom Audience** node, click **then**. 2. From the dropdown list, select **End**. 3. In the upper right corner, click **Save & Run**.
Wait a few minutes for the response of the webhook.
**Result**: An **automation** event is saved to the profiles of the customers. Then, go Facebook, to **Facebook Manager > Audiences** to check your Custom Audience.
The view of workflow configuration
Workflow configuration
## What's next? --- You can start creating personalized ads to your customers in Facebook. You can see your custom audience in **Facebook Manager > Audiences**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of every element of this process directly in Synerise Demo workspace: - [Propensity prediction](https://app.synerise.com/ai-v2/predictions/rrkxxklvzaip) - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/cf199cb0-c497-4c04-bfe4-4136f2640982) - [Workflow configuration](https://app.synerise.com/automations/automation-diagram/e9aa0276-521f-44df-8774-cc2484d266c2) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `facebook.addProfilesToCustomAudience` (~1). ## Read more --- - [Predictions](/docs/ai-hub/predictions) - [Segmentation](/docs/analytics/segmentations) - [Add Profiles to Custom Audience node](/docs/automation/integration/facebook/send-custom-audience) # Visual search Visual search can really enhance shopping experience. By just taking a photo or uploading one of the items your customers are interested in, they will can search for visually similar products. Implementing visual search can connect online and offline shopping and the path from search to conversion may get shorter. Customers will be more willing to make a purchase when finding items is easier. Combining this with functionalities such as query rules, ranking may bring your business some serious benefits, and take the search experience to another level. This use case describes the process of creating an index for a visual search engine and further step you should take to implement it on your website, including ideas on how you can upgrade it for an even better search experience.
The view of implemented visual search in Synerise demo shop
## Prerequisites --- - [Prepare an item feed](/developers/product-feed). - [Enable AI Search for the selected feed](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search#enabling-ai-search-for-the-feed)
After the configuration, contact [Synerise Support](https://hgintelligence.atlassian.net/servicedesk/customer/portal/1?snrs_cl=c4396770-2f57-11ed-91d5-d354b5b26860&snrs_medium=email&snrs_test=true&snrs_cp=a3e34858-a036-42b8-b794-31c1415855a8&snrs_he=-1381345904&snrs_n=4&snrs_action=newsletter.click&snrs_category=client._DEVICE_.browser.mail&snrs_var=6853245&snrs_redir=1) and ask to enable visual search for your workspace.
## Create an index --- We will configure an index for AI search and the settings for how it will work - this is the place for adding proper rules, ranking settings, returned attributes, and so on. Later, this index will be used during the implementation of the search - in the application or on the website. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Click **Add index**. **Result:** The index creation screen opens. 4. From the **Choose feed** dropdown list, select a catalog that contains an item feed based on which you would like to create an index. 5. From the **Choose search language** dropdown, select the language of your search engine. 7. Click **Next step**. 6. Choose **Search Method**. 9. **Add searchable attributes**. Searchable attributes are used by the search engine to calculate the item’s relevance to the query phrase provided by the customer. Attributes can be assigned to three importance levels: high, medium and low. When a word from the phrase matches an attribute, the score amount is assigned depending on importance assigned to the attribute. 6. Optionally, to display unavailable items in the search results, enable the **Include out of stock items** option. 7. Click **Next step**.
The view of creating new index
New index configuration
8. Optionally, you can select item attributes which will be used as response, filterable, facetable, and sortable attributes. 9. In the Item ranking section, define the criteria for sorting items in search results. 14. Click **Finish**. **Result:** Your index is configured, now you can use the **Preview** tab to test the if the results meet your expectations.
The testing of the index setup
The Preview section
## What's next --- Once you set up AI search, you can use it in various channels. For example, you can incorporate it into a website with [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content). Alternatively, you can implement it as a feature in a mobile app or use it in an in-app message. In order to get the visual search results, you need to [use the dedicated API method](https://hub.synerise.com/api-reference/ai-search#tag/Visual-Search). In our demo workspace, we have prepared [a ready-made implementation of visual search](https://app.synerise.com/campaigns/preview/120e4d68-8d2d-45cb-90b4-c26be451616d), from which you can take inspiration when it comes to implementing it in your own shop. Check out an example visual search in our [demo shop](https://demoshop.synerise.com/). ## Check the use case set up on the Synerise Demo workspace --- You can check the [index configuration](https://app.synerise.com/ai-v2/search/indices/f2fc5cbb9955469b1c94368ee66de93c1663658739/stats/global) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AI Search](/docs/ai-hub/ai-search) - [Dynamic content](/docs/campaign/dynamiccontent) # Displaying a set of promotion banners powered by a Brickworks schema To create a flexible in-app promotional experience, start by building a promotion layout schema that stores all necessary details for each offer—such as descriptions, expiration dates, images, button text, and target URLs. Each promotion is saved as a separate record, which makes managing and updating promotions simple. While you can display a single promotion record in an in-app message, the main advantage comes from creating a schema retrieving a list of promotions that acts as a selector to retrieve multiple records from the promotion layout schema. This approach allows your app to present multiple promotion banners in various formats—such as a scrollable list, a carousel, or another layout based on your design and placement needs. By organizing all promotional content within one schema, you ensure consistent messaging across channels, while still having full control over how many and which promotions are shown and where. Whether you display all promotions or select specific ones, this schema-driven setup offers precise control over promotion visibility and placement across different formats. In this setup, a single in-app banner containing promotional information and a countdown timer will be shown when the user enters a specific category related to the promotion. The full list of promotional banners—displayed as a carousel or list—is intended to appear after a product is added to the cart.
In-app message example
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - Implement promotions in your [mobile application](/developers/mobile-sdk/loyalty) and [API](https://hub.synerise.com/api-reference/loyalty-and-engagement). - In **Data Modeling Hub > Files**, add an image or images which you will use in promotions. ## Process --- In this use case, you will go through the following steps: 1. [Schema with the promotion layout](#schema-with-the-promotion-layout) with banners with the end date and a link to the page with promotions. 2. [Create a record with promotion details](#create-a-record-with-promotion-details). 3. [In-app campaign that displays a single promotion](#in-app-campaign-that-displays-a-single-promotion). 4. [Schema retrieving a list of promotions](#schema-retrieving-a-list-of-promotions) from the previous schema. 3. [Create the second record](#create-the-second-record). 4. [In-app campaign that displays a list of promotions](#in-app-campaign-that-displays-a-list-of-promotions). ## Schema with the promotion layout --- In this section, you will [create a schema](/docs/assets/brickworks/quick-start/creating-a-schema) with fields for information about specific promotion, CTA button and counter which counts the minutes till the end of the promotion. By defining fields here, you create a single place where product-related information is stored, updated, and reused across templates, campaigns, and runtime contexts. This schema will serve as a catalog of promotions because each record will be a separate promotion. 1. Go to **Data Modeling Hub > Schemas > New schema**. 2. Choose **Simple Schema**. 3. Enter a name for the schema, in **Display name** for example **Banner template**. **API names** value is pre-filled with the value from Display name. The value in this field is the unique identifier used to reference this schema in API requests. 4. Optionally, fill in the **Description** field.
Brickworks new schema creation form for promotion banner layout
Brickworks configuration
### Add Headline 5. Click **Add new field** and choose **String**. 3. Complete the fields: - In **Display name**, enter `Headline`. - **API name** will be pre-filled automatically. 4. Check the field: **Use as record title**. 5. Check the field: **Character limits** and set it from 5 to 60. 5. To save your changes, click **Apply**. ### Add Description 5. Click **Add new field** and choose **String**. 3. Complete the fields: - In **Display name**, enter `Description`. - **API name** will be pre-filled automatically. 4. Set the field as **Required**. 5. Check the field: **Character limits** and set it from 5 to 60. 5. To save your changes, click **Apply**. ### Add Expiration date 5. Click **Add new field** and choose **Date&time**. 3. Complete the fields: - In **Display name**, enter `expireAt`. - **API name** will be pre-filled automatically. 4. Choose the format as a **Date**. 5. To save your changes, click **Apply**. ### Add Image 5. Click **Add new field** and choose **Image** 3. Complete the fields: - In **Display name**, enter `image`. - **API name** will be pre-filled automatically. 5. To save your changes, click **Apply**. ### Add action button text 5. Click **Add new field** and choose **String**. 3. Complete the fields: - In **Display name**, enter `actionButtonText`. - **API name** will be pre-filled automatically. 5. To save your changes, click **Apply**. ### Add action button link 5. Click **Add new field** and choose **String**. 3. Complete the fields: - In **Display name**, enter `actionButtonLink`. - **API name** will be pre-filled automatically. 4. Set the **validation patter** field as: `^([a-zA-Z]{2,}):\/\/([^\s\/]+)(\/[^\s]*)?$` 5. To save your changes, click **Apply**. ### Set up the Audience & Settings 1. Click the **Audience & Settings** tab. 2. In the **Audience** section, click **Define**. 3. Choose the schema recipients, in our case, choose **Everyone**. 4. Click **Apply**. 5. In the upper-right corner, click **Save.** ## Create a record with promotion details --- [Creating a record](/docs/assets/brickworks/quick-start/creating-a-record) means adding the data to the schema. It means that you fill out schema fields with the actual values. This step fills the structure you created earlier with real data that will be rendered to the user. Anything you enter here becomes the source of truth for templates. By storing product-specific information inside the record, you ensure that all in-app messages, PDP blocks, or emails referencing this schema always draw from the same, consistent data set. The records are created based on the promotion banner layout schema and each record will be a separate promotional banner. 1. Go to **Data Modeling Hub > Data collection > Select schema**. 2. Choose [schema created in the previous part of the process](#schema-with-the-promotion-layout). 3. Click **Add record**. 4. Add a name for the record. 5. Add a slug for the record. Slug is a unique, URL-friendly version of the name. It usually contains only lowercase letters, numbers, and hyphens. In our case it will be `promo6`. 6. Fill in the values in the **Headline** and **description** fields for the specific promotion. 7. From the **expireAt** field, choose the expiration date of the specific promotional action. 8. From the **Image** dropdown list, select an image to be used in a promotion which you added in **Data Modeling Hub > Files** as a part of prerequisites. 9. Fill the **actionButtonText** and **ActionButtonLink** fields. 7. To save and publish your record, click **Publish**.
Brickworks record form filled with promotional banner details
Brickworks configuration
8. To create more promotional banners with info about specific action, duplicate the record and add different data to the fields described in schema. They will be important in the further partof the use case. ## In-app campaign that displays a single promotion --- In this part of the process, you [create an in-app campaign](/docs/campaign/in-app-messages/create-inapp-message) triggered by the `product.addToCart` event. The data used in this in-app will be retrieved from the record with promotion details created in the [previous step](#create-a-record-with-promotion-details). 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. Make sure the conditions for in-app and schema audiences are not mutually exclusive. 1. In the **Audience** section, click **Define**. 4. Click **Everyone**. 8. To save the audience, click **Apply**. ### Define content --- In this part of the process, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template. 1. In the **Content** section, click **Define**. 2. Click **Create message**.
Create your template according to your needs, but make sure it pulls data from the record returned by this schema — the first line of the template should reference to the ID of the schema and ID of the record (in our case: `schemaId=banner recordId=promo6` )
Check the HTML code
{% brickworksgeneratevar schemaId=banner recordId=promo6 %}{%set data = brickworks_result %} <div class="banner" data-slug="{{ data.__slug }}"> <div class="banner-image"> <img src="{{ data.image.medium | default(data.image.large) }}" alt="{{ data.headline }}" /> </div> <div class="banner-content"> <h1 class="headline">{{ data.headline }}</h1> <p class="description"> {{ data.descrption }} </p> <div id='expiry' class="meta" data-expiry="{{ data.expireAt }}"> <span id="countdown"> </div> <a class="cta" href="{{ data.actionbuttonlink }}" target="_blank"> {{ data.actionbuttontext }} </a> </div> </div> {% endbrickworksgeneratevar %}
### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose the `page.visit` event. 3. Click the **+ where** button and select `category`. 4. As the logical operator, select **Equal**. 6. As the value add the name fo the specific category in which this in-app with the information about the specific promotional action should be displayed. 5. Click **Apply**.
Brickworks in-app message trigger event configuration with page visit condition
Brickworks configuration
### Schedule the message and configure display settings --- As the final part of the process, you will set [the display settings of the in-app](/docs/campaign/in-app-messages/create-inapp-message#define-the-display-settings) message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. .
You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general.
16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**.
Brickworks in-app campaign displaying a single promotion banner
Brickworks configuration
## Schema retrieving a list of promotions In this step, we will [create a schema](/docs/assets/brickworks/quick-start/creating-a-schema) that retrieves data from the Schema with the promotion layout, collecting all created banners for different promotional actions at once. This aggregated output will be used in the next step to build an in-app view displaying promotional banners as a list or a carousel, depending on business needs. This approach also demonstrates how one Brickworks schema can pull data from another, enabling more flexible content structures. The schema will contain a field which will let you indicate a schema whose records will be retrieved. 1. Go to **Data Modeling Hub > Schemas > New schema**. 2. Choose **Simple Schema**. 3. Enter a name for the schema, in **Display name** for example **Banner template**. **API names** value is pre-filled with the value from Display name. The value in this field is the unique identifier used to reference this schema in API requests. 4. Optionally, fill in the **Description** field.
Brickworks new schema creation form for retrieving a list of promotions
Brickworks configuration
### Add the reference to the previous schema 5. Click **Add new field** and choose **One to many**. 3. Complete the fields: - In **Display name**, enter `bannersv2`. - **API name** will be pre-filled automatically. 4. From the **Schema** dropdown list, select the [schema created in the previous step](#schema-with-the-promotion-layout). 5. Select the **Required filed** checkbox. 5. To save your changes, click **Apply**.
Brickworks schema field configuration showing One to Many reference to promotion layout schema
Brickworks configuration
## Create the second record --- This step fills the structure you created earlier with real data that will be rendered to the user. Anything you enter here becomes the source of truth for templates. In this part of the process, you will create a record based on a [schema that references the schema containing the list of promotions](#schema-retrieving-a-list-of-promotions). The purpose of this record is to retrieve and consolidate the records with promotions for use within the system. This created record will play an important role in later stages of the process - it will be referenced in the in-app message template designed to display a list of promotions to users. By linking this record to the template, the system can dynamically present promotion details within the mobile application interface. While [creating a record](/docs/assets/brickworks/quick-start/creating-a-record) you will select the promotion banner layout schema created as the first part of the process, this way you can retrieve all records (promotional banners) available in the schema. 1. Go to **Data Modeling Hub > Data collection > Select schema**. 2. Choose [Schema retrieving a list of promotions](#schema-retrieving-a-list-of-promotions). 3. Click **Add record**. 4. Add a name for the record. 5. Add a slug for the record. Slug is a unique, URL-friendly version of the name. It usually contains only lowercase letters, numbers, and hyphens. In our case it will be `activeBanners`. 6. Choose [the schema with the promotion layout ](#schema-with-the-promotion-layout). 7. Click **Add record**. 8. Choose the records (promotions) from the list which will be retrieved from the previous schema. 7. To save and publish your record, click **Publish**.
Brickworks record configuration aggregating multiple promotional banner records
Brickworks configuration
## In-app campaign that displays a list of promotions --- In this part of the process, you [create an in-app campaign](/docs/campaign/in-app-messages/create-inapp-message) triggered by the `product.addToCart` event. The data used in this in-app is set of banners with the information about promotions retrieved from the schema retrieving a list of promotions, created in the [previous step](#schema-retrieving-a-list-of-promotions). 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. Make sure the conditions for in-app and schema audiences are not mutually exclusive. 1. In the **Audience** section, click **Define**. 4. Click **Everyone**. 8. To save the audience, click **Apply**. ### Define content --- In this part of the process, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template. 1. In the **Content** section, click **Define**. 2. Click **Create message**.
Create your template according to your needs, but make sure it pulls data from the record returned by this schema — the first line of the template should reference to the ID of the schema and Id of the record (in our case: `schemaId=bannersv2 recordId=activeBanners` )
Check the HTML code
{% brickworksgeneratevar schemaId=bannersv2 recordId=activeBanners %}{%set data = brickworks_result.bannersv2 %} <div class="carousel" id="carousel"> <div class="track"> {% for item in data %} <div class="banner"> <div class="image"> <img src="{{ item.image.thumb | default(item.image.large) }}" alt="{{ item.headline }}" /> </div> <div class="content"> <div class="headline">{{ item.headline }}</div> <div class="description">{{ item.descrption }}</div> <div class="footer"> <a class="cta" href="{{ item.actionbuttonlink }}">{{ item.actionbuttontext }}</a> <div class="expiry" data-expiry="{{ item.expireAt }}">—</div> </div> </div> </div> {% endfor %} </div> <div class="dots"></div> </div> {% endbrickworksgeneratevar %} {% endbrickworksgeneratevar %}
### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `product.addToCart` event. 3. Click the **+ where** button and select `mobile`. 4. As the logical operator, select **Exists**. 5. Click **Apply**. ### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. .
You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general.
16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**.
Brickworks in-app campaign displaying a list of promotion banners
Brickworks configuration
## What's next --- After defining these schemas, you can reuse the template across other placements as needed. It can be applied not only in PDP blocks, emails, or in-app views, but also in any additional surfaces supported by your setup—for example homepage modules, product carousels, or campaign-specific placements. What’s more, the values retrieved from these schemas can be used to dynamically display multiple banners—either as a list or in a carousel format—depending on the design and placement requirements. This flexibility allows you to maintain consistency in your content while customizing the layout and volume of displayed items based on the context. Whether you want to show all available banners or just selected, the schema setup gives you full control over what is shown and where—across different channels and placements. ## Check the use case set up on the Synerise Demo workspace --- In Synerise Demo workspace, you can check the configuration of: - [Schema1](https://app.synerise.com/assets/brickworks/schemas/07f11534-3244-45a7-9094-a6df71fc53da) - [Schema2](https://app.synerise.com/assets/brickworks/schemas/bf202dba-e641-462b-a441-4cb40afd3d1c) - [In-app campaign 1](https://app.synerise.com/communications/in-app/5aaf1b76-2df1-47ca-a77b-8b32c67ca6ac) - [In-app campaign 2](https://app.synerise.com/communications/in-app/5e1fd07c-ad57-4a98-9321-3632bc6cd7ce/content-manager/template/editor?variant=0) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~2), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~2), [`brickwork.generated`](/docs/assets/events/event-reference/brickworks#brickworkgenerated) (~2). ## Read more --- - [Brickworks](/docs/assets/brickworks) - [In-app messages](/docs/campaign/in-app-messages) # Buy one, get one free Buy one, get one free (BOGO) is a popular discount technique that you may want to consider to include in your marketing campaign. Not only it is a great way to attract new customers in a persuasive but subtle manner, but also an opportunity to boost your sales. This use case describes how to create a buy one, get one (BOGO) promotion in which customers who purchased `XYZ` brand chips will receive a `XYZ` brand soda for free. The promotion will only work for loyalty program members (customers who logged into the mobile app). ## Prerequisites --- - Implement promotions in your [mobile application](/developers/mobile-sdk/loyalty) and [API](https://hub.synerise.com/api-reference/authorization#tag/Authorization/operation/profileLogin). - [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog). - If you want to limit the promotion to only some of your stores, add the list of stores to a catalog. Such a catalog must contain a unique store ID and any other store attributes by which you will filter stores, such as city, zip code, and so on. More information about catalogs can be found [here](/docs/assets/catalogs). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- 1. [Prepare segmentation](/use-cases/buy-one-get-one#prepare-a-segmentation) of customers who are members of the loyalty program. 2. [Create a promotion](/use-cases/buy-one-get-one#create-a-promotion). ## Prepare a segmentation --- In this part of the process, create a segmentation of customers who are members of the company's loyalty program. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. From the **Choose filter** dropdown list, select the **loyaltyCard** attribute. 4. As the logical operator, select a boolean value: **Is true**.
The conditions used in the segment will vary depending on your loyalty program integration (for example, the name of the attribute may be different). You must define the segmentation accordingly.
5. Click **Save**.
An example of a customer segment that participates in a loyalty program
An example of a customer segment that participates in a loyalty program
## Create a promotion --- 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For selected items** option. 3. In the **Audience** section, select the segmentation created in [this step](/use-cases/buy-one-get-one#prepare-a-segmentation). 4. In the **Content** section: 1. Define the name, description, and image of the promotion. 2. In the **Price** field enter `0`. 3. Confirm the settings by clicking **Apply**.
AI Hub promotion Content section with name, description, image, and zero price for a buy-one-get-one promotion
Example of promotion content
5. In the **Type and limits** section: 1. In the **Type** dropdown list, choose **Members only**. 2. In the **Discount type** dropdown list, choose **Exact price**. 3. Leave the **Discount mode** field value at default (**Static**). 4. In the **Limit per profile** section, enter `1`. 5. In the **Value** section, define the discount as `0`. 6. Enable the **Buy one, get one promotion** toggle. 7. Define the number of required and discounted items. 8. Enable the **Turn on required items** toggle.
Example of Type and limits settings
Example of Type and limits settings
6. In the **Schedule** section, define the promotion distribution period according to your business needs. 7. *Optionally*: In the **Stores** section, specify stores where the promotion is available.
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
8. In the **Items** section, specify the catalog item to be discounted: 1. From the **Source catalog** dropdown list, select an item catalog from which the items will be selected. 2. Select the **Select items** tab. 3. Click the **Select items** button. 4. On the list, select the item a customer will get for free (in this use case, it's `XYZ brand` soda). 9. In the **Required Items** section, choose the items a customer must buy to unlock "buy one, get one" discount: 1. From the **Source catalog** dropdown list, select an item catalog from which the items will be selected. 2. Select the **Select items** tab. 3. Click the **Select items** button. 4. On the list, select the item a customer will get for tree (in this use case, it's `XYZ brand` chips). 11. To apply configuration and run the promotion, click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- You can also check the [segmentation configuration](https://app.synerise.com/analytics/segmentations/1f34841c-8dd8-49f6-acd9-aab7ce928e23) and [promotion configuration](https://app.synerise.com/campaigns/promotions/36644435-cc09-43ba-abb0-4abe0beb0ad4) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Promotions](/docs/ai-hub/promotions) - [Segmentations](/docs/analytics/segmentations) # Cross-sell recommendations in the basket Display recommended products on the cart page, matched to the user's preferences using AI algorithms. You can encourage customers to buy other products and thus increase the value of the basket. Algorithms allow you to choose products commonly bought by past customers with the same basket content and are likely to interest current customers. It's also a good way to mention promotions for complementary product categories. Such recommendations are of value to customers, keep them engaged and encourage them to buy something more. Without such recommendations they would leave the website earlier and buy less. ![Screenshot presenting Cross-sell campaign in the Synerise platform](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/crosssell2.png) ## Example of use - Retail industry A client from the fashion industry used this type of recommendation, because they wanted to increase the average value of online shopping baskets. Profile decided to use recommendations of similar products on every product page and in this way encourage hesitate customer to make a faster decision. **Results** Results after one month: - CTR: 0.76%, - Conversion rate 38.5% (percentage of purchases to the number of clicks). ## How to do it --- The purpose of this type of recommendation is to offer additional products to the ones the customers are viewing and get them to add more items to their shopping carts. The system compares the products which were viewed by other users of a similar profile to the product that is currently being viewed by a specific user. On this basis, the system prepares product recommendations that may encourage the user to add a product to the cart. Learn how to configure your [cross-sell recommendations](/docs/ai-hub/recommendations-v2/recommendation-types#cross-sell-and-cart-recommendations). Above you will find complete guide which will show you how to create and configure your cross-sell recommendations and implement them in your campaigns. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). # In-app personalized recommendations with dynamic resize Returning users who revisit a product category but haven’t purchased anything often face the same friction as during their first visit — large assortment, filters, and product overload. To re-engage them effectively, you can display a personalized top (or bottom) bar that appears only for this specific audience. The bar acts as a shortcut to AI-based personalized recommendations from a category that the user viewed before, and allows them to explore those items on a personalized in-app. This campaign will be visible only for customers who have visited the specific category during the past 30 days but have not made any purchase. This approach works best on product or category-level pages and for users who already showed intent but didn’t complete a purchase. It combines behavioral segmentation and personalization in a single, adaptive in-app campaign.
UC - In app resize - recommendations
## Prerequisites --- - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) for recommendations; enable the personalized recommendation type. - Implement the transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). ## Process --- In this use case, you will go through the following steps: 1. [Prepare the segmentation](#prepare-the-segmentation) of users who have visited the specific category during last 30 days but have not made a purchase from this category. 2. [Prepare the recommendations](#prepare-the-recommendations) of personalized products from the category. 2. [Create an in-app campaign](#create-an-in-app-campaign) as a top bar which, after tapping, resizes to full screen with personalized products recommendations. ## Prepare the segmentation --- In this part of the process, you will create a segmentation of users who have visited the `women/shoes` category in the last 30 days (mobile/web) but have not made any transaction during that time. In this part of the process, we will create a segmentation of users who have visited the `women/shoes` category in the last 30 days (website of mobile) but have not made any transaction during that time. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. Click **Add condition**. 4. From the dropdown list, select the `page.visit` event. 6. Click **+ where** and from the dropdown list, select `url`. 7. Choose the **Contain** operator and enter the fragment of the URL for the specific category. In our case it will be `women-shoes`. Alternatively, you can build the following condition: **category equal [category name]**. 7. Using the date picker in the lower-right corner, set the time range to **Last 30 days**. 8. Click **Add condition**. 10. From the list, choose the `screen.view` event. 6. Click **+ where** and from the dropdown list, select `url`. 7. Choose the **Contain** operator and enter the fragment of the URL for the specific category. In our case it will be `women-shoes`. Alternatively, you can build the following condition: **category equal [category name]**. 12. Connect these conditions by the **OR** operator. 7. Using the date picker in the lower-right corner, set the time range to **Last 30 days**. 8. Click **Add condition**. 9. From the list, choose the `transaction.charge` event. 10. By clicking **Performed** above the event name change the condition to **Not performed**. 6. Save the segmentation.
Decision Hub segmentation configuration for targeting customers who visited but did not make a purchase in the last 30 days
Segmentation configuration
## Prepare the recommendations --- In this part of the process, you will prepare the personalized recommendations of products from a specific category. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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 an item feed that has a the **Personalized** model ready to use. 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. Define the minimum and maximum number of products displayed in the frame according to your needs. 3. Define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters). 4. Click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **category**. 6. As the operator, choose **Equals**. 7. Click the icon which appeared next to the field with the operator and from the dropdown list, select **Context** (eye icon). 7. As the value, choose `category`, to be sure that the category of recommended products will be the same as the category of the currently viewed item. 8. In the **Category level** input, select **Take first subcategories**. 9. In this use case, the **how many levels** setting is **2**, but remember to adjust it to how your item feed is built. 9. In the items, choose a category. In this case: `women/shoes`.
The view of the recommendation configuration
Recommendation configuration
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.
Learn more about [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors) and [additional settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#additional-settings).
## Create an in-app campaign --- In this part of the process, you’ll use a predefined "Resize Recommendations" template that starts as a compact top bar and expands into a full screen view with personalized recommendations. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. In this case, we will use the segmentation created in the [previous step](#prepare-the-segmentation). 1. In the **Audience** section, click **Define**. 2. Click **Segmentations**. 3. Click **Select segmentation** and choose the segmentation created in the [previous step](#prepare-the-segmentation). 3. Save settings in the **Audience** section by clicking **Apply**. ### Define content --- In this part of the process, you will use a ready-made template to create the content of the in-app message that will be displayed in the mobile application. 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Resize Recommendations** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways: - by editing the code of the template, [adding inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [adding variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) - by filling out the form on the **Config** tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs.
In-app resize recommendations Config tab with bar and general settings
In-app configuration
1. In the **Bar settings** section, set up the copy and style of the first banner. Choose the bar position (top or bottom bar). 2. In the **General Settings** section: - In **Title** and **Subtitle**, define the title and subtitles for the in-app. If you don't want to display them, enter a dash (-). 3. In the **AI Recommendations** section: - Enter your **AI Recommendation Campaign Hash** based on the [previously created campaign](#prepare-the-recommendations). - Decide if you want to display special price and cross out regular price when available 3. In the **CTA** section: - Customize the action button by defining the text on the button (**Text on the button**), the URL to which a user will be redirected (**Destination link**), colors of the button (**Button text color** and **Button color**). 5. After you complete editing the form, disable the **Config mode** option. 5. After you make changes to the template, you can check the preview. 1. Click the **Preview contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the campaign preview directly in the mobile app.
6. If the template is ready, in the upper right corner click **Save this template > Save as**. 7. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 8. To continue the process of configuring the in-app campaign, click **Use in communication**. 9. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. In this case, it will be visible after opening the application but - as it was specified in the campaign settings - only for a specific segment as it was set up before. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `screen.view` event. 3. Click the **+ where** button and select `source`. 4. As the logical operator, select **Equal**. 5. As the value add `MOBILE`. 5. Click **Apply**.
In-app message trigger configured with screen.view event filtered by MOBILE source
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. 16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ### Test the in-app campaign --- Read the ["Testing" section](/docs/campaign/in-app-messages/create-inapp-message#testing) to discover how to test your in-app campaign. ## Check the use case set up on the Synerise Demo workspace --- You can check the [segmentation](https://app.synerise.com/analytics-v2/segmentations/e9ba4f5e-76e6-4782-8bc5-3bdb72281688), [AI recommendations](https://app.synerise.com/ai-v2/recommendations/yYjFMYPeofN5) and [in-app message campaign](https://app.synerise.com/communications/in-app/1edbf12c-47c2-4c20-83b8-a7c8edb0cff5) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`screen.view`](/docs/assets/events/event-reference/web-and-app#screenview) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) # In-app Stories with Personalized Product Recommendations Display an engaging in-app story that combines interactive storytelling with AI-driven product recommendations. This feature allows businesses to present relevant products in a dynamic and visually appealing format, enhancing user engagement and increasing conversion opportunities. By leveraging predefined, ready-to-use templates, brands can easily create and adapt stories to their specific needs. In this use case, you'll discover how to create an interactive in-app story promoting a running challenge and specific brand of running shoes. The guide offers detailed steps for using a predefined template, customizing content, and including AI-based recommendations for a personalized and engaging user experience. The target audience consists of women who visited the shoes category in the last 30 days without making a purchase.
In-app Interactive Stories
## Prerequisites --- - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) for recommendations; enable the personalized recommendation type. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). ## Process --- In this use case, you will go through the following steps: 1. [Prepare the segmentation](#prepare-the-segmentation) of women who have visited the shoes category during the last 30 days and have not made any transaction. 2. [Create an in-app message](#create-an-in-app-message) with product recommendations using the predefined template. ## Prepare the segmentation --- In this part of the process, we will create a segmentation of users who have visited the `women/shoes` category in the last 30 days (website of mobile) but have not made any transaction during that time. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. Click **Add condition**. 4. From the dropdown list, select the `page.visit` event. 6. Click **+ where** and from the dropdown list, select `url`. 7. Choose the **Contain** operator and enter the fragment of the URL for the specific category. In our case it will be `women-shoes`. Alternatively, you can build the following condition: **category equal [category name]**. 7. Using the date picker in the lower-right corner, set the time range to **Last 30 days**. 8. Click **Add condition**. 10. From the list, choose the `screen.view` event, 6. Click **+ where** and from the dropdown list, select `url`. 7. Choose the **Contain** operator and enter the fragment of the URL for the specific category. In our case it will be `women-shoes`. Alternatively, you can build the following condition: **category equal [category name]**. 12. Connect these conditions by the **OR** operator. 7. Using the date picker in the lower-right corner, set the time range to **Last 30 days**. 8. Click **Add condition**. 9. From the list, choose the `transaction.charge` event. 10. By clicking **Performed** above the event name change the condition to **Not performed**. 6. Save the segmentation.
Decision Hub segmentation configuration for targeting customers who visited but did not make a purchase in the last 30 days
Segmentation configuration
## Create an in-app message --- In this part of the process, you will create an in-app campaign. We will use a predefined template for the message with interactive in-app stories, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. In this case, we will use the segmentation created in the [previous step](#prepare-the-segmentation). 1. In the **Audience** section, click **Define**. 2. Click **Segmentations**. 3. Click **Select segmentation** and choose the segmentation created in the [previous step](#prepare-the-segmentation). 3. Save settings in the **Audience** section by clicking **Apply**. ### Define content --- In this part of the process, you will use a ready-made template to create the content of the in-app message that will be displayed in the mobile application. 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **STORIES** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template, [add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs.
In-app stories message Config tab with slide and general settings
In-app configuration
1. To lock a specific slide that you want to preview and edit, to prevent it from switching automatically, enable the **Config Mode**. 2. In the **Slide number** field, enter the slide number from which you want to edit. 2. In the **General Settings** section: - In **Number of stories**, enter the number of slides in the stories (no more than 5). - In **Stories order**, define the order of stories (for example, 2,3,5,1). - In **Title** and **Subtitle**, define the title and subtitles of the stories respectively. If you don't want to display them, enter a dash (-). - If you want to display the avatar, enable the **Display avatar image** option and in **Avatar image**, enter a link to the source of avatar image. 3. In the **Button** section: - Customize the action button by defining the text on the button (**Text on the button**), the URL to which a user will be redirected (**Destination link**), colors of the button (**Button text color** and **Button color**). 4. Configure the settings for each story - Each story can be customized separately. You can customize copy in a story, select colors of text and background, provide the links to image or video included in the story, and define the display time. 5. After you complete editing the form, disable the **Config mode** option. 5. After you make changes to the template, you can check the preview. 1. Click the **Preview contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the campaign preview directly in the mobile app.
6. If the template is ready, in the upper right corner click **Save this template > Save as**. 7. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 8. To continue the process of configuring the in-app campaign, click **Use in communication**. 9. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `screen.view` event. 3. Click the **+ where** button and select `source`. 4. As the logical operator, select **Equal**. 5. As the value add `MOBILE`. 5. Click **Apply**.
In-app message trigger configured with screen.view event filtered by MOBILE source
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. 16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ### Test the in-app campaign --- Read the ["Testing" section](/docs/campaign/in-app-messages/create-inapp-message#testing) to discover how to test your in-app campaign. ## Check the use case set up on the Synerise Demo workspace --- You can check the [segmentation](https://app.synerise.com/analytics-v2/segmentations/e9ba4f5e-76e6-4782-8bc5-3bdb72281688) and [in-app message campaign](https://app.synerise.com/communications/in-app/0954550c-eb59-4b33-a92c-662e348a3029) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`screen.view`](/docs/assets/events/event-reference/web-and-app#screenview) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) # Integration with Accredible You can integrate a full-service digital credentialing solution, Accredible, with Synerise to issue digital certificates, diplomas, badges, and many other credentials to the users based on their profiles and activity in Synerise. This use case presents the integration used for the purposes of user certification in Synerise. The workflows include sending data of users who reached a certification level in Synerise to Accredible in order to issue their certificate and badge.
In this use case, we cover only the part of issuing the digital credentials.
Accredible integration
Accredible integration
## Prerequisites --- - Access to Accredible. - If you want to [trigger the workflow](/use-cases/integration-with-accredible#create-a-workflow) by occurrence of a custom event, you must add one in Synerise in **Data Modeling Hub > Events** and implement it in your application. You can read more about adding events [here](/docs/assets/events/event-definitions). - Create a schema that stores the certification questions in [Schema Builder](/docs/assets/schema-builder). ## Process --- In this use case, you will go through the following steps: 1. [Create credentials in Accredible](/use-cases/integration-with-accredible#create-credentials-in-accredible). 3. [Create a catalog](/use-cases/integration-with-accredible#create-a-catalog). 4. [Create a workflow](/use-cases/integration-with-accredible#create-a-workflow). 5. [Test](/use-cases/integration-with-accredible#testing) your integration. ## Create credentials in Accredible --- In this part of the process, in your Accredible account, create a group of credentials.
Groups in Accredible
Groups in Accredible
You can find the full documentation [here](https://help.accredible.com/how-do-i-create-a-group).
A group receives a unique identifier.
ID of the group
ID of the group
## Create a catalog --- In this part of the process, prepare a CSV file that contains Accredible group identifier and Synerise ID of the certificate level. Next, create a catalog to which you import the file. 1. Go to **Data Modeling Hub > Catalogs > Create new**. 2. Enter the name of the catalog.
Don't use diacritical letters and spaces.
3. Click **Import CSV**. If you prepared a CSV file in Excel, open it in a text editor to check whether commas are used as separators. If not, replace them with commas. 4. Upload the file by clicking **Upload file**. 5. In the **Order key** field, type the name of the column which values are treated as the key - `syneriseID`.
The value of `syneriseID` is the ID of the schema created as a part of [prerequisites](#prerequisites).
6. Complete the process by clicking **Import**. **Result**:
CSV file imported to catalog
CSV file imported to catalog
## Create a workflow --- In this part of the process, create a workflow that is triggered by receiving a certification. Then, a request is sent to Accredible to issue credentials for the user who received the required score. 1. In Synerise, go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, add **Profile Event**. In the configuration of the node, select the event that triggers the workflow. In this use case, it's a custom event - `certification.acquired`.
If it suits your business scenario, you may use default Synerise events, or instead of **Profile Event**, you may use the **Audience** node to trigger the workflow for the selected group.
4. Confirm the settings by clicking **Apply**. 4. Add the **Outgoing integration** to the workflow. In the configuration of the node: 1. Change the webhook type to **Custom**. 2. As the connection type, select **No authentication**. 3. Click **Select connection** and select a connection. If you want to create a connection, click **Add connection** and [create it](/docs/automation/actions/webhook-node#set-up-a-connection). 1. Select **Custom** and **no authentication**. 1. Enter the name of the node. 2. In the **Webhook name** field, enter the value of the `name` parameter of the event generated by this node. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `accredible.userSent` 2. As **Display name**, enter `User sent to Accredible` 3. Select the **POST** method. 4. In the **URL** field, enter `https://api.accredible.com/v1/credentials`
You can find more information about this endpoint [here](https://docs.api.accredible.com/#tag/Credentials).
5. In the **Headers** section, use the following headers: - Set `Content-type` to `application/json`. - Set `Authorization` to `Token token=YOUR ACCREDIBLE API_KEY` 6. Enter the request body, you may reuse and modify the example request below according to your needs:
{
               "credential": {
                   "recipient": {
                       "name": "{{ event.params.firstName }} {{ event.params.lastName }}",
                       "email": "{% customer email %}",
                   "group_id":"{% set key = event.params.certificationId %}{% catalogitem.certificationList(key) %}{% set object = catalog_result %}{{ object.get('accredibleid')}}{% endcatalogitem %}"
               }
           }}
The example request contains three Jinjava inserts: 1. Customer's name sourced from Profile Event node, [read more about reusing information in nodes](/developers/inserts/automation) 2. Customer's email address according to the context 3. Reference to the catalog column You can read more about inserts in Automation [here](/developers/inserts/automation).
Configuration of the Outgoing Integration node
Configuration of the Outgoing Integration node
8. Confirm by clicking **Apply**. 9. Add the **End** node. 10. Click **Save&Run**.
Automation Hub workflow for sending certificates via Accredible integration
Final configuration of the workflow
## Testing --- 1. Use the API to send a test event and simulate a user completing a certification 2. Open the **Statistics** tab available in your workflow. 3. Click the **Outgoing Integration** node. If the **Entered** and **Executed** counters have incremented after you sent the test certification, your survey triggered the workflow and completed it. 4. Go to the profile of the test user, look for the `automation` event. Double-click it to see the details. If the `status` parameter is `200`, the workflow works.
Event generated on the customer's profile
Event generated on the customer's profile
You can use this webhook response to trigger further campaigns to the user as well as create analytical dashboards with clear information on how many users received their credentials. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Catalog](https://app.synerise.com/assets/catalogs/200765) - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/d62c7285-1698-48a7-b5be-a6238679c78e) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: `certification.acquired` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `accredible.userSent` (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integration](/docs/automation/integration) # Landing page with personalized listing and brand-focused product recommendations
Use Case - Landing Page with brand propensity product listing
In today's competitive e-commerce landscape, personalization plays a crucial role in improving customer engagement and increasing conversion rates. By leveraging customer data such as purchase history, browsing patterns, and product preferences, businesses can provide a tailored shopping experience. This is especially critical during high-stakes sales events like Black Friday, when customers are bombarded with a vast range of products and deals. A well-executed personalized approach not only enhances user experience but also helps in reducing decision fatigue and boosting conversion rates. This use case demonstrates how a dynamically personalized product listing can be integrated into a landing page. The listing presents products that are relevant to each customer's interests, based on their past purchases and browsing activities. With the use of Synerise Predictions, presented results will be even more accurate. **Here’s how it works**: - Customers with a high propensity to purchase from a particular brand will receive an email that guides them to a personalized landing page. - The page features an **automatically filtered product listing that spotlights items from their preferred brand**. - Customers can further refine their browsing experience by applying additional filters, such as product category or price, for an even more tailored shopping journey. For special occasions such as Black Friday or Power Monday, you can enrich this scenario and apply additional settings, such as showcasing only offers with a specific "black-friday" tag. In this use case, we will guide you through every step of the scenario. We will prepare the email campaign as well as the landing page which will be created based on a predefined template that makes the scenario easy to prepare by adapting the ready project to your business needs. ## Prerequisites --- To be able to implement this use case, you must: - [Create a sender account](/docs/campaign/e-mail/configuring-email-account) - Configure AI Engine for: - [AI Search](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search) - [Propensity predictions](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-propensity#enabling-propensity-and-best-fit-predictions) - Create and configure [search index](/docs/ai-hub/ai-search/create-index) and add the desired [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes) - [Predict propensity to buy items from specific brand](/use-cases/propensity-brand) - If you plan to publish a landing page within your own domain, follow instructions from ["Requirements for custom domains" section](/docs/campaign/landing-page/creating-landing-page#requirements-for-custom-domains); if you choose to publish it on the Synerise domain, no additional requirements are necessary - Optionally you can [configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) to be able to add personalized AI recommendations to your landing. - Optionally create [AI recommendations](/docs/ai-hub/recommendations-v2) which you can add to your landing page. ## Process --- Perform the steps in the following order: 2. [Create a landing page](/use-cases/landing-page-personalized-listing#create-a-landing-page). 2. [Create an email campaign](/use-cases/landing-page-personalized-listing#create-an-email-campaign). ## Create a landing page --- In this part of the process, you will create a landing page with personalized product listing. The listing will have filtering options (such as filters by brand, by category or price) as well as sorting. We will use a predefined template so there is no need to create a template from scratch. In this example we will use a landing page approach, but you can implement the same scenario in any other structure or flow that fits your project. 1. Go to Experience Hub icon **Experience Hub > Landing Page > Create new**. 2. Enter the name of the campaign. ### Define content --- 1. In the **Content** section, click **Create message**. 2. From the list of template folders, select the **Predefined templates** folder. **Result:** You are redirected to the list of predefined templates. 3. Select the **Personalized Listing** template. **Result:** You are redirected to the code editor. The form in the **Config** tab is pre-filled with default values, which you can modify to suit your business needs. 5. In the **General** section: 1. In the **ID of AI search index** field, enter the ID of search index you created as a part of [prerequisites](/use-cases/landing-page-personalized-listing#prerequisites). 10. In **Additional Recommendation**, you can select an AI recommendation that will be used to present additional product offers, if switched on. In this section, apart from selecting the recommendation, define the header for the recommendation frame, and the number of items to display in the recommendation frame. 6. In the **Buttons, Hero, Footer** sections, you can configure the layout and appearance of your landing page, including fonts, colors, and backgrounds, to ensure it matches your branding. 7. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
The view of the Edit form in the Config tab
Edit form in the Config tab
8. If the template is ready, click **Use in communication** in the upper right corner. ### Define schedule settings --- 1. In the **Schedule** section, click **Define**. 1. Select the timezone. 2. Select the time when the landing page will be active - in this case, choose the start and end date, so they overlap the period before and after Black Friday. 6. Click **Apply**
The view of the Schedule tab
Edit form in the Schedule tab
### Define the SEO settings --- In this part of the process you may define technical details concerning search engine optimization and increase the chances of placing high in search results. ### Set up the URL --- In this part of the process, you will define the URL to your landing page. 1. From the **Domain** dropdown list, select the address of your landing page. 2. Optionally, if you want to add a part to the address after the domain, in **Nice URL** provide this part, for example, `black-friday` (don't use a slash, it is added automatically). 3. In **URL for redirecting users when the landing expires (optional)**, enter the URL to which you will redirect users after the landing page expires. 4. Optionally, in **Fallback URL**, enter the URL to which users will be redirected if your landing page is unavailable due to errors (for example, when it can't be rendered due to Jinjava syntax error). If you leave this field empty, users will be redirected to a generic error page. 4. In **URL preview**, you are provided with a final link to your landing page. The preview is in real time, so if you fill a domain or URL, you get the preview of the address simultaneously. 5. Confirm the settings by clicking **Apply**. ### Adjust optional settings --- 1. In the **HTTP headers** section, you can add custom HTTP headers to your landing page. In the **Key** and **Value** fields, enter a header and its value, respectively. 2. In the **Customize** section: - you can add CSS and scripts to your landing page - you can define the URLs to external sources or paste the snippets - in the JS section under the **Advanced options** option, to enable additional tracking on your landing page, you can paste the [tracking code](/developers/web/installation-and-configuration#adding-the-tracking-code-to-your-site). ### Save your campaign --- 1. After you make changes to the campaign, you can check the preview. Click the **Preview** button on the upper right side. 2. When your landing page is ready you can **Save it as a draft** or directly click **Publish**. ## Create an email campaign --- In this part of the process, you will create an email campaign with the link to the landing page with personalized listing, automatically filtered to the brand you specified while [building prediction](/use-cases/landing-page-personalized-listing#prerequisites). The campaign will be directed to all customers with high propensity to buy items from that brand. 1. Go to Experience Hub icon **Experience Hub > Email campaign > Create new**. 2. In the **Audience** section, choose the **New audience**. 3. Define the conditions: 1. Choose event `snr.propensity.score`. 2. As the parameter, choose **modelId**. 3. As the operator, choose **Equal**. 4. In the text field, enter the ID of the prediction you created as a part of [prerequisites](/use-cases/propensity-brand). 5. Click **+ where**. 6. From the dropdown list, select **source_label**. 7. As the operator, choose **Equal**. 8. Depending on the scale selected in the prediction, please enter the highest possible value that can be achieved here. In our case, in the text field, enter `high`.
The conditions for the audience of the email
The conditions for the audience of the email
4. Apply and save your changes. 3. Configure the **Content** section. 3. Choose the email account from which you want to send your message. 2. In the **Subject** field, enter your message subject. 2. Click **Create message**. You can create a template out of scratch or use the ready-made templates in the **Predefined dynamic templates** and **Predefined simple templates** folders.
An email template must contain a link to the landing page with brand filter passed in the link. Based on the personalized listing on our predefined template, the link would look in the following way: `https://your.landingpage.com/black-friday?brand=xyz`.

To ensure that the landing page content is personalized and rendered specifically for the customer who is being redirected, you must also pass the UUID of the customer in the link. This can be done by adding `snrs_cl` parameter in the URL in the following ways: - by adding manually the Jinjava insert that retrieves UUID to the link, for example: `https://your.landingpage.com?snrs_cl={{customer.uuid}}` - by inserting the link using `{% preparelink %}YOUR_LANDING_PAGE_URL{% endpreparelink %}` tags which automatically adds the `snrs_cl` parameter to the link. Taking the above into consideration, the final link that must be embedded in email template will look in the following way: `{% preparelink %}https://your.landingpage.com/black-friday?brand=xyz{% endpreparelink %}`.

You can read more about customer context in landing pages in ["Establishing customer context" section](/docs/campaign/landing-page/creating-landing-page).
4. After finishing email template, click **Use in communication**. 5. In the **Content** section, to confirm the settings, click **Apply** 4. In the **Schedule** section, specify the time when you want to send your communication. 4. You can optionally define **UTM & URL parameters**. 4. To send the email, click **Send**.
The view of the Schedule tab
Example of email template
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [landing page](https://app.synerise.com/campaigns/landing-pages/create/d2fffb37-e736-4ef2-acd7-e80c23516b01:2024-11-13T11:06:52.595559351) with personalized product listing directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`landingpage.visit`](/docs/assets/events/event-reference/landing-page#landingpagevisit) (~1), [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [Email communication](/docs/campaign/e-mail/creating-email-campaigns) - [Jinjava inserts](/developers/inserts) - [Landing page](/docs/campaign/landing-page) # Send customers SMS with link to download the application In today's retail landscape, engaging customers through smart technology is essential. This use case demonstrates how a customer service system, integrated with automation and messaging tools, can boost customer interaction. By using Synerise's API, retailers can send timely SMS notifications, promoting app downloads and driving personalized marketing campaigns. The workflow is triggered when a customer contacts a consultant, sending an SMS with an app download link. This enhances the customer experience by providing immediate app access, improving efficiency, and encouraging deeper engagement with the platform. This strategy fosters customer loyalty, ensures relevant, well-timed communications, and respects preferences with a weekly message cap. The integration is simple, scalable, and adaptable to future needs. ## Prerequisites --- - [Implement a dedicated custom event](/developers/api/events/sending-events#send-custom-event-endpoint), triggered when a customer contacts a consultant, sending an SMS with an app download link. In this use case, we use `customer.call` event. - [Integrate with the SMS provider](/docs/campaign/SMS/configuring-sms-gateway). ## Create a workflow --- You will create a workflow which will be triggered by a custom.call event and send an SMS to a customer with a link to the application. ### Select the trigger 1. Go to **Automations > Workflow > New workflow**. 2. Enter a name of the workflow. 2. Define the trigger by choosing **Profile Event**. 3. To open the settings of the node, click the node. 4. In the settings of the node, from the **Choose event** dropdown list, select **customer.call**. 5. Confirm the settings by clicking **Apply**. ### Select the action node 1. To add a node, click **THEN**. 2. From the dropdown list, select **Send SMS**. 3. To open the settings of the node, click the node. 4. In the settings of the node, in the **Content** section, click **Define**. 5. From the **From phone number** dropdown list, select the SMS account from which the message will be sent. 6. Click **Create message**. 7. In the upper right corner, click **New template**. 8. In the **SMS Message** field, enter the contents of your message. You can [use inserts to personalize](/docs/campaign/SMS/creating-SMS-template#personalization) the message, you can use emoji to make the message look breezy or use [short links](/docs/campaign/SMS/creating-SMS-template#short-links).
Write SMS content
Profile Event trigger configuration
9. After the content is ready, click **Use in Node**. 10. In the **Content** section, click **Apply**. 24. If you want to add custom parameters to the events generated automatically by this workflow (for example, sms.send), in the **Additional parameters** section, click **Define** and add a pair or more of parameter and value. Confirm the settings by clicking **Apply**. 25. If you want to send a test SMS, perform the instructions in the [Sending a test message](/docs/automation/actions/send-sms-node#sending-a-test-message) section. 26. You can define additional node setting such as enabling ignoring limits or global control group. You can find more information about it in [Defining additional node settings](/docs/automation/actions/send-sms-node#defining-additional-node-settings) section.
Send SMS node
Profile Event trigger configuration
27. To confirm the node settings, click **Apply**. **Result**:
Send SMS automation
Profile Event trigger configuration
### Add finishing node 1. To add a node, click **THEN**. 2. From the dropdown list, select **End**. This node doesn't require configuration.
Remember to define additional settings for the workflow, in this case: capping, for example 1x per week.
3. In the upper-right corner, click **Save & Run**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [workflow](https://app.synerise.com/automations/workflows/automation-diagram/5201cfbf-e695-406a-858c-949ff34e367f) configuration directly in Synerise demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: `customer.call` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`sms.send`](/docs/assets/events/event-reference/sms#smssend) (~1), [`sms.click`](/docs/assets/events/event-reference/sms#smsclick) (~1). ## Read more --- [Send SMS node](/docs/automation/actions/send-sms-node) # Import Custom Events from CSV Files You can use the Synerise Imports feature to import custom events of your customers. You can upload any custom events to Synerise, such as cart status, adding product to wishlist or any offline events. Example of offline event can be contact with customer support call center. Import events that signify customer's contact with your call center, in order to have them historically assigned to customers and include them in your marketing efforts. Once imported, our platform empowers you to gain valuable insights from these custom events, enabling data-driven decision-making and personalized customer experiences. In this use case, you will import custom event data (`support.contact`) of customers who contacted your customer support. You will use a `.csv` file with these data and you will import them with the Simple Import feature. ## Prerequisites --- Add [custom event](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent) and its [parameters](/docs/assets/events/adding-event-parameters) to save data to customers' profiles when they perform an activity. In this particular use case: - `support.contact`. ## Process --- In this use case, you will go through the following steps: 1. [Create a `.csv` file](#create-a-csv-file) with data about custom event to import to Synerise. You can use our example file, which can be downloaded using the **Get Sample File** button while uploading the file. The sample file shows the recommended column names and the recommended formatting of the values in those columns. 2. [Import the file](#import-the-file). ## Create a .csv file --- In this part of the process, prepare a `.csv` file that contains one of the following profile identifiers: (the list contains recommended column names, if you use different names you will be able to map data during the process): - `email` (only if your workspace uses [unique emails](/docs/settings/configuration/non-unique-emails)), - `uuid`, - `clientID`, - or `customID`. This is a required column, the rest is optional, should contain the custom event's parameters.
If you choose an email as an identifier, pay attention to the correct format of emails. Otherwise, your import will fail.
`.csv` files must be UTF-8 encoded, spaces, and special characters in the column headers are not allowed. Check [tips for preparing a CSV file]. **Example CSV file might look like this:** ```csv email,contactPurpose,duration,resolved johndoe@example.com,complaint,200s,true jnowak@example.com,ordercancellation,320s,false jperez@example.com,complaint,150s,false ``` ## Import the file --- In this part of the process, you will upload a file from your device. 1. Go to **Data Modeling Hub > Imports> New import**. 2. As the data type for import, select **Custom events**. ### Select the file for import --- 1. As the import method, to import a single `.csv` file to Synerise, select **Import a local file**. 4. To upload the `.csv` file you [created in the previous step](#create-a-csv-file), click **+ Upload file or drag one here field**. 5. Optionally, you can customize the file metacharacters by clicking the arrow down icon next to **Customize file markup**. 1. From the **Delimiter** dropdown, select the character that marks the end of a column. 2. From the **Quotation mark** dropdown list, select the characters that contain the text. 3. From the **Escape character** dropdown lists, select the character which changes the default interpretation of a character or a string followed by the escape character. 6. You can preview the data output by clicking **Preview data**. 7. Click the **Next** button to upload the file. 8. When the file is uploaded click **Next** to proceed.
The view of the Import Events configuration
Import Events configuration
### Select the target event --- In this part of the process, you will select the event which you want to import. Thanks to that, during the mapping process the system will prompt the parameters for mapping based on the event type.
You can import one type of event at a time.
1. Click **Select target event** and from the dropdown list, select `support.contact`. 2. Click **Next**.
The view of the Target event configuration
Target event configuration
### Mapping the columns with parameters in Synerise --- In this part, you will map parameters based on the event type [selected in the previous step](#select-the-target-event). You can exclude parameters from the import. On the user interface, you will be presented with two columns - the left column displays the names of the columns from the imported file, the other contains dropdown lists with the parameters available in Synerise. The dropdown lists indicate the required parameters for a an import. If you skip mapping the non-required parameters, the name of these parameters will be the same as the names from the imported file. If parameters don't exist in Synerise, they will be imported as new parameters. 1. Next to the file column name, from the dropdown list, select the corresponding parameter in Synerise. Perform this step for all columns in your file. 2. To exclude a parameter from import, next to the column name, click this icon: Exclude paramater icon
The view of the mapping process
Mapping
3. To proceed to the summary of the import, click **Next**. **Result:** The summary of the import is displayed.
The view of the Import summary
Import summary/figcaption>
4. After checking the import summary, to start the import, click **Run import**. 5. You can monitor the status of your import and potential errors due to incorrect data in the **Imports List**. ## Generated events This use case generates 1 event per profile that completes the flow: `support.contact` (~1). ## Read more --- - [Custom events](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent) - [Imports](/docs/assets/imports/introduction-to-imports) # Multiple metrics in one report Answering a question such as *"Which campaigns drive engagement? Which stores perform best? How do loyalty tiers affect purchase behavior?"* usually requires building three or four separate reports and comparing them manually, or writing an API query. A single report can include several metrics of the same type, displayed side by side and split by one dimension. Instead of exporting multiple CSV files and combining them in a spreadsheet, you get one report, multiple columns, and one table. This applies to any scenario where you need three to four KPIs of the same type, split by a single dimension such as campaign, store, segment, or channel. ## Example - Campaign effectiveness --- **Business question:** *"Which email campaigns drive the most opens AND clicks - and which just burn volume?"* **Why this matters:** The number of messages sent does not indicate campaign quality on its own. A campaign with a high send volume but a low click-through rate may perform worse than a smaller campaign with strong engagement (for example, a campaign with 100k sends and a 1% CTR is less effective than one with 10k sends and a 20% CTR). By combining Sent, OR, CTR, and CTOR in a single report, you can evaluate the full performance of each campaign in one view, rather than analyzing each metric separately. **What the report shows:** - campaignName - Sent - count of message.send - OR - open rate in % - CTR - click-through rate in % - CTOR - click-to-open rate in %
The preview of the campaign effectiveness report with a chart and a breakdown table split by campaignName
Report preview with a chart and a breakdown table split by campaignName
**Based on this report, you can:** - Reduce investment in campaigns with high send volumes but low engagement. - Identify subject line or content patterns shared by the best-performing campaigns. - Support decisions to pause or rework specific campaigns with data rather than assumptions. The process below builds this campaign effectiveness report step by step. The same steps apply to other scenarios — only the metrics and the dimension change. For more examples, see [Other applications](#other-applications). ## Prerequisites --- - The metrics you want to compare must be the **same type** — all profile-based or all event-based. Different metric types cannot be mixed in one report. - You need a **dimension to split the results by**, for example `campaignName`, `retailStoreID`, `customerLoyaltyTier`, or `campaignId` - in this case, `campaignName`. - The metrics you want to display must already exist in the workspace. For information on building metrics, see [Creating metrics](/docs/analytics/metrics). To reuse the rate metrics referenced in this use case (`Open Rate`, `CTR`, `CTOR`), see [Calculate CTR, OR, and CTOR based on unique event occurrences](/use-cases/calculate-ctr-or-ctor). ## Process ---
The configuration of the Metrics, Dimension, and Range sections for the campaign report
Configuration of the metrics and dimension
In this use case, you will go through the following steps: 1. Create the report. 2. Add the dimension `campaignName`. 3. Add the metrics using [existing formulas](/use-cases/calculate-ctr-or-ctor). 4. Rename columns and format as percentages. 5. Preview the results. 6. Save the report. ## What's Next --- After saving the report, you can: - Monitor it weekly on a dashboard. - Share with your team inside and outside of Synerise. - Export for analysis in other tools. ## Other applications --- The same report-building steps apply to other analyses. Only the metrics and the dimension change. The scenarios below show common variations. ### Store Performance **Business question:** *"Which physical stores sell the most - and which have the best basket quality?"* **Why this matters:** A store with an average transaction count but a high Average Order Value (AOV) represents a different situation than a store with many transactions and a low Average Order Size (AOS). Analyzing all three metrics together provides the context needed to make accurate operational decisions.
The configuration of the Metrics, Dimension, and Range sections for the store performance report
Configuration of the metrics and dimension
Each metric describes a different aspect of store performance: - Transaction count reflects traffic.
The configuration of the Number of transactions metric used in the store performance report
Configuration of the Number of transactions metric
- AOV reflects basket size.
The configuration of the AOV metric used in the store performance report
Configuration of the AOV metric
- AOS reflects the number of items per purchase.
The configuration of the AOS metric used in the store performance report
Configuration of the AOS metric
**What the report shows:**
The preview of the store performance report with a chart and a breakdown table split by retailStoreID
Report preview with a chart and a breakdown table split by retailStoreID
**Based on this report, you can:** - Identify stores that may benefit from upsell training (high traffic, low AOV). - Recognize stores outperforming others in their region (high AOV and high AOS). - Share a single report view with store operations teams, without exporting data to external tools. ### Loyalty Tier Analysis **Business question:** *"Do loyalty members spend more than non-members, and is the program worth maintaining?"* **Why this matters:** Without this comparison, the return on investment of a loyalty program is difficult to assess. Viewing Transactions, AOV, and AOS split by loyalty tier (basic, plus, and non-members) in a single table provides the data needed to support or challenge the program investment during business reviews.
The configuration of the Metrics, Dimension, and Range sections for the loyalty tier report
Configuration of the metrics and dimension
**What the report shows:**
The breakdown table of the report split by customer loyalty tier
Report breakdown table split by customer loyalty tier
**Based on this report, you can:** - Confirm or disprove that loyalty members generate higher basket value. - Determine whether the program primarily drives purchase frequency (Transactions) or order value (AOV). - Use the results to justify program costs or to support changes to the tier benefit structure. ## Generated events This use case does not generate any events. ## Read more --- - [Reports](/docs/analytics/reports) - [Creating reports](/docs/analytics/reports/creating-reports) - [Metrics](/docs/analytics/metrics) - [Dashboards](/docs/analytics/analytics-dashboard/introduction-to-dashboards) # Gravity Form integration If you use the Gravity Form plugin for building custom forms in WordPress, you can use webhooks to send data from forms to Synerise. In this use case, the answers from the form are saved as the event parameters on a customer's profile.
Completing this procedure requires some knowledge on sending API requests using cURL, Postman, or similar tools.
You may want to split your browser window into two. In one browser window, open the WordPress account, in the other, log in to the Synerise application.
## Prerequisites --- - Create a form in Gravity Form plugin. The example form used in this use case contains three pieces of information: - Email address of a user who submits the form - The name of the form - A question about a vehicle condition - Install and activate [the webhooks add-on](https://docs.gravityforms.com/installing-a-gravity-forms-add-on/) in your WordPress account. ## Process --- In this use case, you will go through the following steps: 1. [Create an incoming webhook](/use-cases/gravity-form-integration#create-an-incoming-webhook). 2. [Create a webhook in Gravity Form](/use-cases/gravity-form-integration#create-a-webhook-in-gravity-form). 3. [Finish incoming integration](/use-cases/gravity-form-integration#finish-incoming-integration). 4. [Create a workflow](/use-cases/gravity-form-integration#create-a-workflow). 5. [Testing](/use-cases/gravity-form-integration#testing). ## Create an incoming webhook --- In this part of the process, create an incoming webhook to which you will send the data submitted through Gravity forms. 1. In Synerise, go to **Automation Hub > Incoming > New integration**. 2. Enter the name of the webhook. 3. In the **Endpoint** section, click **Define**.
The URL field is already is filled in with the endpoint to which the data submitted through the form will be sent.
1. Optionally, you can add an icon to this integration. 3. Confirm by clicking **Apply**. 4. Click **Finish later**. **Result**: The incoming webhook is saved as a draft. ## Create a webhook in Gravity Form --- In this part of the process, you need to configure the webhook which will send data from the form to Synerise. 1. In the WordPress account, go to **Form Settings > Webhooks tab**, and then click the **Add New** button. 2. Fill in the form: 1. In the **Name** field, enter a name for your form. 2. In the **Request URL**, enter the Synerise endpoint URL from step 3 in [Creating an incoming webhook](/use-cases/gravity-form-integration#create-an-incoming-webhook) procedure. 3. From the **Request method** dropdown list, select **POST** method. 4. From the **Requested Format** dropdown list, select **JSON** format. 5. In the **Request body** input, choose **Select fields** (recommended set-up).
- The **Select Fields** option displays the field values setting which let you define what you send to Synerise. - The **All Fields** option sends the entire unformatted entry.
6. In the **Field Values** inputs, define how each entry from the survey should be sent in the webhook response. - In the **Key** column, enter the name of variables visible in the webhook response.
Use letters only without diacritical characters.
- In the **Value** column, enter the question in the form that is assigned to the key. 7. Confirm the settings by clicking **Update settings**. **Result**: From now, everytime somebody submits the survey, the request will be sent to the Synerise endpoint.
Configuration of the Gravity form webhooks
Configuration of the Gravity form webhooks
## Finish incoming integration --- Go back to creating the incoming webhook in Synerise. 1. In Synerise, go to **Automation Hub > Incoming**. 2. On the list, find the draft incoming integration you created in step [Create an incoming webhook](/use-cases/gravity-form-integration#create-an-incoming-webhook). 3. In the **Incoming data** section, click **Define**. 6. Fill in the form you created in Gravity Forms and submit it. Alternatively, you can send a request in Postman to this endpoint. Example request:
Replace the body of the request with a sample of the data you will send from the form
curl --location --request POST 'ENDPOINT_URL_FROM_STEP_3' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "email": "john.doe@example.com",
        "formType": "formTitle",
        "VehicleCondition": "neutral",
    }'
5. In the **Incoming data** section in Synerise, click **Retrieve data**. The system waits for the incoming request for 1 minute and 30 seconds. ## Create a workflow --- In this part of the process, you create a workflow in Synerise. The workflow starts with the business event trigger that is launched every time a customer submits the form. In response to that, on the profile of the customer who submitted the form, an event is saved with the answers in the survey in the form of parameters. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, select **Business Event**. In the configuration of the node: 1. Select the incoming webhook you created as the first part of this use case. 2. Confirm by clicking **Apply**.
Configuring the Business Event node
Configuring the Business Event node
4. Add the **Outgoing integration** to the workflow. In the configuration of the node: 1. Change the webhook type to **Custom**. 2. As the connection type, select **API Key**. 3. Click **Select connection** and select a connection. If you want to create a connection, click **Add connection** and [create it](/docs/automation/actions/webhook-node#set-up-a-connection). 1. Enter the name of the webhook. This name will be used as the value of the `name` parameter of the event generated by this integration. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `gravityform.submit` 2. As **Display name**, enter `Gravity Form survey submitted` 2. Select the **POST** method. 3. Enter the endpoint URL: - For workspaces hosted in Microsoft Azure EU server: `https://api.synerise.com/v4/events/custom` - For workspaces hosted in Microsoft Azure USA server: `https://api.azu.synerise.com/v4/events/custom` - For workspaces hosted in Google Cloud Platform: `https://api.geb.synerise.com/v4/events/custom` 4. Enter the following headers: - set the `content-type` header to `application/json` (default), - set the `accept` header to `application/json`, - set the `api-version` header to `4.4` 5. Enter the request body. For the form used in this case, the body is as follows:
{
           "action": "form.submit",
           "label": "Customer submitted a survey",
           "client": {
               "email": "{{request.body.email}}"
           },
           "params": {
               "formTitle": "{{request.body.formTitle}}",
               "VehicleCondition": "{{request.body.VehicleCondition}}"
           }
       }
Learn more about reusing data from incoming integrations in the Outgoing Integration node [here](/docs/automation/integration/incoming-webhook-node#example-of-use)
6. Confirm by clicking **Apply**.
Configuring the Outgoing Integration node
Configuring the Outgoing Integration node
7. Add the **End** node. 8. Activate your workflow by clicking **Save & Run**.
Automation Hub workflow for Gravity Forms data integration
Final workflow configuration
## Testing --- Fill in your survey and check if data is collected in Synerise properly. Open the workflow statistics and the survey. Fill in the survey, send it, and observe the statistics. If the **Entered** and **Executed** counters increment, your survey triggered the workflow and completed it.
Automation Hub workflow for Gravity Forms data integration
Final workflow configuration
The profile whose identifier was entered in the survey is updated.
Event with survey on a customer's profile
Event with survey on a customer's profile
## Generated events This use case generates approximately 6 events per profile that completes the flow: `incoming webhook event` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1), [`form.submit`](/docs/assets/events/event-reference/web-and-app#formsubmit) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integration](/docs/automation/integration) # Personalized Checkout Promotions Based on Category Slots in Offline Stores Don't ignore dedicated discounts in your brick-and-mortar stores and their possibilities to increase revenue. To keep customers, give them an additional reason to come back and buy with a personalized promotion. This use case will help you create a set of personalized promotions for customers to receive at check-out in physical stores. The set contains slots of customer-dedicated promotions from specific categories. Promotions will work for 24 hours from the date of assigning and can be printed together with the receipt after the transaction. Personalization of promotions on check out can work for both recognized customers, for example paying with card, or those paying with cash. ## Prerequisites --- - Implement transaction events using [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction).
We recommend implementation of transactional events so that the hash of the card can become an identifier for the customer when they are paying by card. Thanks to this, a customer who will come to the store and pay with the same card can get personalized offer (even if they are not recognized, for example does not scan the mobile application at checkout), because we will be able to properly collect their transaction history.
- [Import the product feed to a catalog](/use-cases/import-product-feed-to-catalog). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Create personalized promotion](#create-personalized-promotions). 2. [Define groups of promotions](/use-cases/personalized-promotions-on-checkout#define-groups-of-promotions) to use them as base for AI engine. 3. [Define a personalized promotion](/use-cases/personalized-promotions-on-checkout#define-a-personalized-promotion). ## Create personalized promotions --- In this part of the process, create personalized promotion. Further on, the AI engine selects among the available candidates the best tailored promotions to display in personalized promotions. 1. Go to AI Hub menu icon **> Regular Promotions > Add promotion**. 2. According to your buissness needs select one of the scopes: - **For selected items** - **For entire basket** 3. Define **Audience**. Select the group of customers for whom you want to prepare promotion. 4. In the **Content** section: 1. Define the name, description, and image of the promotion. 2. In the **Price** field, enter `0`.
AI Hub promotion Content section with name, description, image, and price fields for a checkout promotion
Example of promotion content
3. Confirm the settings by clicking **Apply**. 4. Add [customer tags](/docs/crm/customer-tag). In our case, to each promotion we will add a customer tag with the name of category it concerns - so that we can make groups of promotions dedicated for the certain category. 5. In the **Types & limits** section, select **Personalized promotion** as the promotion type. 1. Leave the rest of the settings in this section at default. 2. Confirm by clicking **Apply**.
Type & limits section with Personalized promotion selected in the Type dropdown
Personalized promotion type
7. In the **Schedule** section, define the promotion distribution period according to your business needs. 8. Optionally, in the **Stores** section, specify stores where the promotion is available.
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
9. In the **Items** section, select the item catalog from which the items will be discounted: 1. From the **Source catalog** dropdown list, select the item catalog. 2. Select the **Entire catalog** tab using the **Select items** option, as in this use case promotion works on all items. 10. To apply configuration and run the promotion, click **Publish.** 11. Repeat all the steps and create more personalized promotions. In step 9, instead of entire catalog, select specific items (for example, a brand, a category of items - depending on your business assumptions). ## Define groups of promotions --- In this part of the process, you create a filter of promotions which will be used in a personalized promotion. 1. In **Promotions**, above the list of promotions, click Filter icon **> Define.** 2. Click **Choose filters**. 3. Use the tag you assigned to [personalized promotion](#create-personalized-promotions) for categories you selected. This filter will be used while creating a personalized promotion.
Example of filters
Example of filters
4. Save the filter 5. Confirm the settings by clicking **Apply**. ## Define a personalized promotion --- In this part of the process, create a personalized promotion. The AI engine will select items from the group of personalized promotion [created in the previous step](#define-groups-of-promotions) based on the customer preferences. In personalized promotions you can also set how many products will be shown and adjust the variety of the offer. 1. Go to AI Hub icon **AI Hub > Personalized Promotions > New personalized promotion**. 1. As a type, choose **Check-out**. 2. In the **A/B Test settings**, click **Define**. 3. Click Plus icon. 4. Click **Advanced options**. 5. Select **AI Engine**. 6. Confirm by clicking **Apply**. 7. In the **Filters and limits** section, define two slots and to each slot assign the filter created before. Also, define the number of promotions in each slot that will be allocated for the customer. 1. In the **Promotions in set**, enter a number of personalized promotion to be used as candidates to display in a slot. 2. Click **Define filter**. 3. Select the filter you created in this [step](/use-cases/personalized-promotions-on-checkout#define-groups-of-promotions). 4. To add more slots, click **Ad another** and repeat steps i-iii. 5. Confirm by clicking **Apply**. 8. Define **Exclude items** section accordingly to your business needs. 9. In the **Activity** section: 1. Leave the **Lasting** option at default (**Relative**). 2. Set the activity time according to your business needs. In our case it is 24 hours. 3. Confirm by clicking **Apply**. 10. Configure the **Engine settings** section according to your needs.
You can read more about engine settings [here](/docs/ai-hub/personalized-promotions/creating-ai-promotions#ai-engine-boosting-settings).
2. To apply configuration and run the promotion, click **Publish.** ## What's next --- For this promotion to work you need to implement the personalized promotion in stores. Personalization of promotions on check out works for any customer, even for the anonymous ones. When the customer is anonymous/paying in cash, the personalization engine takes into consideration the current transaction that the customer makes in the store - and gives promotions with the context of products bought in this transaction. - To assign checkout personalized promotions coupons for anonymous profile/customer paying in cash, based on items in basket - implement anonymous Profile's checkout process in POS [using the API method](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Promotions%3A%20basket%20%26%20POS%20integration/operation/processAnonymousCheckout_POST). If the customer is recognized, the engine takes into consideration the whole history of their transactions and gives the most relevant results. For this to work we recommend using hash of the payment card as an identifier of the customer - for better personalization. - To assign checkout personalized promotions coupons for a profile, based on items in the basket and historical transactions - implement checkout process in POS [using the API method](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Promotions%3A%20basket%20%26%20POS%20integration/operation/processCheckout_POST). As the `identifierType` use `externalId`, where the `identifierValue` will be the hash of the payment card. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check the: - [personalized promotion candidate](https://app.synerise.com/campaigns/promotions/27ea16b6-521b-448c-9551-2f12d96257ad) - [personalized promotion](https://app.synerise.com/campaigns/handbills/ec712c10-dad1-407e-afe5-0344ab9321e7) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2), [`snr.bestfit.score`](/docs/assets/events/event-reference/predictions#snrbestfitscore) (~1), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~2). ## Read more --- [Personalized promotions](/docs/ai-hub/personalized-promotions/creating-ai-promotions#create-promotion-candidates) # Personalize item suggestions based on a clicked advertisement In today's digital landscape, delivering personalized experiences to customers has become essential for businesses to stand out and engage their audience effectively. One powerful approach to personalization is tailoring the content and product offerings based on the traffic source that brings visitors to a personalized landing page. This use case describes the process of implementing a dynamic content that displays item suggestions which are based on the clicked ad. Before you proceed to implementing this use case, you must configure an external advertisement campaign within which UTMs are added to URLs. These UTMs will be used in the targeting options of the dynamic content campaign, enabling the display of items suggestions based on the clicked ad. This use case provides you with an HTML code for the dynamic content to be edited in the [dynamic content template builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder). When you paste it to the editor, you will be able to configure the fields in the template by means of a user-friendly configuration form. The HTML code of the dynamic content consists of the following configurable elements: - The banner field in which you can paste a link to the image of the collection - The field with the main title displayed in the dynamic content - One object, dedicated to one item. The object let you define the title of the product, its description and price, and the link to the product's image. - Recommendation selection section.
Campaign with traffic source
## Prerequisites --- - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) and enable it for personalized recommendations. - Prepare an external advertising campaign for specific product category and configure UTM parameters for the ads. - Create a [landing page](/docs/campaign/landing-page). The dynamic content will be displayed on this page. ## Process --- In this use case, you will go through the following steps: 1. [Create a recommendation campaign](/use-cases/personalization-based-on-traffic-source#create-a-recommendation-campaign) which promotes the specific product category. 2. [Create a dynamic content](/use-cases/personalization-based-on-traffic-source#create-an-editable-dynamic-content) that will display the item collection based on the ad a customer has been redirected from. ## Create a recommendation campaign --- Create a recommendation campaign that will return the items of the specific category. Such recommendation will return the items based on customer's behavior on the website and browsing history. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation** 2. Enter the meaningful name of the recommendation. 3. In the **Type & Items feed** section, click **Define**. 1. From the **Items feed** dropdown list, select the main catalog with all products and categories. 2. As the type, select **Personalized**. 4. Click **Apply**. 4. In the **Items** section, click **Define**. 5. Click **Add slot**. You can name the slot for later reference. 6. In the **Number of items** subsection, set the minimum and maximum number of items to `6`.
Setting the minimum and maximum number of items to the same number ensures that exactly this many items will appear in the slot.
7. From the **Statics filters** dropdown, click **define filter** and choose **Visual Builder**. 8. In the visual builder, choose the **category** (or **brand**) attribute and set its value to the category from which the items will be presented in the recommendation. 8. Additionally, if you want to, you can apply [other filters types](/docs/ai-hub/recommendations-v2/recommendation-filters) to specify the range of items displayed in the recommendation. 9. In the **Items** section, click **Apply**. 10. In the **Boosting** section, you can enable [define boosting rules](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors). 11. Optionally, in the **Additional settings** section, you can exclude the items which were already purchased or select the metric according to which the items will be ordered in the recommendation. 12. Save the recommendation by clicking **Save**. ## Create an editable dynamic content --- In this part of the process, you will create a dynamic content campaign dedicated to a specific category. The provided HTML code has defined variables that can be easily customized to meet your unique business needs using the configuration form. The variables that are defined include: title, description, price, item link, and image link. 1. Go to Experience Hub icon **Experience Hub > Dynamic Content > Create new**. 2. Enter the name of the content. 3. Choose the **Insert object** type. 2. In the **Audience** section, select **Everyone**. 3. In the **Content** section, select **Simple message**, and specify the CSS selector where you want to insert dynamic content to your website. 4. Click **Create Message > New template**. 5. In the code editor, insert Jinjava with the configurable boxes and add your own CSS.
Below you will find the ready-to-use code with variables that will appear in the configuration form. You can implement it in your campaign, add CSS with specific styles and fill the config boxes based on your preferences. What is important, the code contain information about one exemplary item. You can add as many items as you want.
Click to see Jinjava
<h4>Intro</h4> <div style="max-width: 360px"> <img src="#### type: "string", groupName: "Intro", groupId: "Intro", label: "Banner", id: "image_1", defaultValue: "lorem_image" !####" /> <p>#### type: "string", groupName: "Intro", groupId: "Intro", label: "Title", id: "intro_1", defaultValue: "lorem_title" !####</p> </a> </div> <hr> <h4>Item 1</h4> <div style="max-width: 360px"> <a href="#### type: "string", groupName: "Item 1", groupId: "item_1", label: "Link", id: "link_1", defaultValue: "lorem_link" !####"> <img src="#### type: "string", groupName: "Item 1", groupId: "item_1", label: "Photo", id: "image_1", defaultValue: "lorem_image" !####" /> <p>#### type: "string", groupName: "Item 1", groupId: "item_1", label: "Title", id: "title_1", defaultValue: "lorem_title" !####</p> <p>#### type: "string", groupName: "Item 1", groupId: "item_1", label: "Description", id: "desc_1", defaultValue: "lorem_description" !####</p> <p>#### type: "string", groupName: "Item 1", groupId: "item_1", label: "Price", id: "price_1", defaultValue: "lorem_price" !####</p> </a> </div>
DC settings
Dynamic content settings
6. Additionally, you can add to the campaign as an insert link to the recommendation campaign with products from a specific brand. Click **Insert**, select **AI Recommendations 2** from the list and choose the recommendation campaign crated in the [previous step](/use-cases/personalization-based-on-traffic-source#create-a-recommendation-campaign). 7. Click **Get HMTL code**, click **Copy to clipboard** button visible on the upper right side of the screen. 8. Go to the HTML tab of the campaign editor on the right side of the screen and paste the code below the code added before. 7. Add CSS styles based on your business assumptions. 8. Save the template. 5. In the **Schedule** section, select the date when the dynamic content is activated. 6. In **Display settings**, define the circumstances for displaying the content. 1. In the **Triggers** section, select **on landing**. 2. Click **Advanced options**, go to the **Page targeting** section. 3. Below the **Display on pages** banner, click **Add rule**. 4. From the left dropdown list, select **RegExp**. 5. In the right field set the URL where you want your dynamic content to be shown. Add the UTMs of the external campaign. It will decide which DC campaign should be displayed. 3. In the **Frequency** section, select **Always**. 4. In the **stop display** section, select **Never**. 5. In the **Device** section, select on which device you want to show the dynamic content. 6. Confirm by clicking **Apply**. 7. In the **UTM & URL parameters** section, click **Skip step**. 8. Activate dynamic content.
DC settings
Dynamic content settings
## What’s next --- To measure campaign performance, you can create various custom analytics. Once these analytics are created, they can be brought together in a single dashboard to provide a holistic view of campaign performance, allowing you to quickly assess whether the given results met your specific campaign goals and objectives. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of every element of this process directly in Synerise [Demo workspace](https://demo.synerise.com/request): - [Recommendation campaign](https://app.synerise.com/ai-v2/recommendations/rotdrWmS5iJU) - [Dynamic content campaign](https://app.synerise.com/campaigns/create/ee4bbc3a-627d-4e20-bd95-9288cf411b23) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Recommendations](/docs/ai-hub/recommendations-v2) # Personalized search on "no results" website Your search engine should understand even poorly worded queries and return a good set of results – you can optimise it using [Synerise AI search](/use-cases/search-multiple-languages). It will handle misspellings, but what’s more, you can use synonyms and query rules to help customers find what they are looking for. But if you don’t use AI search yet, or your clients are searching for new queries, don’t let them waste time on a ‘No Results’ page. Instead of this, prepare personalized recommendations, which will show products suited to users based on their activity. ## Example of use - Home appliances industry A client from the electronics industry had their own search solution, but noticed that very often users were getting **zero page results**. The fastest way to improve the customer experience was to add additional recommendation frames on such subpages. Users were informed that there were no results matching their queries, but maybe they will be interested in some recommended products.
Screenshot presenting personalized search on a website with no results
Search on a website with no results
**Results** - **3,1%** CTR ## Prerequisites --- To implement this use case: - Add [tracking code](/docs/settings/tool/tracking_codes) to your website. - Import [product feed](/developers/product-feed). - Import [transaction events](/developers/web/transactions-sdk). ## Process --- To create AI recommendation adjusted to the customer's preferences, perform the steps in the following order: 1. [Prepare AI recommendation](/use-cases/personalized-search-no-results#prepare-ai-recommendation). 2. [Prepare dynamic content ](/use-cases/personalized-search-no-results#prepare-dynamic-content). ## Prepare AI recommendation --- To show recommendations on the website, first you must prepare AI recommendations. 1. Go to **Experience Hub** > **Recommendations**. 2. Add **New recommendation**. 3. Choose personalized recommendation type and define the number of products you want to show in the frame. You can add additional filters if needed.
more information about using filters you will find in [these](/docs/ai-hub/recommendations-v2/recommendation-filters) articles.
`AI campaign`
AI campaign
## Prepare dynamic content --- Use dynamic content to insert recommendations in the specific place on your website - you can recognize zero search results in two ways: - You can prepare a unique CSS selector which will be added only on zero search result pages. - If you won’t have such a selector, you will have to additionally use JS to check if there is no product on the page. It will depend on your website structure how to check it. To prepare dynamic content: 1. Go to **Experience Hub > Dynamic content > Add new** 2. Choose **Insert Object** type. 2. Select **Everyone** in the Audience. 3. In **Content** section, select **Simple message**, and specify CSS selector in which you want to insert recommendations. 4. In the **Content** tab, add appropriate **CSS selector** and click **Create message**. Insert Jinjava code with AI recommendation - let’s look at how to prepare the appropriate Jijnava code (you will have to add your own CSS to it).
Check the jinja code
<!-- Downloading the AI campaign --> {% recommendations2 campaignId=cg3HBgRC5P2h %} {% for p in recommended_products2 %} <li data-snr-ai-product-id="{{p.productRetailerPartNo}}"> <a class="snrs-AI--item-link" href="{{p.link}}" title="{{p.title}}"> <img src="{{ p.imageLink }}" class="products-slider__item-image snrAI-product-image snrAI-product-image-{{p.productRetailerPartNo}}" width="90" alt="{{p.title}}" id="snrAI-image-{{p.productRetailerPartNo}}"> <h3 class="snrs-AI-product--product-name"> <span class="snrs-AI-product--name-first">{{p.title}}</span> </h3> </a> </li> {% endfor %} {% endrecommendations2 %}
5. Schedule when the dynamic content has to be active. 6. In **Display settings**, specify that dynamic content has to be shown **Always, On landing, on Specific URL** which indicates its search page.
If you don’t want to use dynamic content, you can implement recommendations via API request, you can find details [here.](https://hub.synerise.com/api-reference/ai-recommendations#tag/Recommendations/)
## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [AI API](https://hub.synerise.com/api-reference/ai-recommendations#tag/Recommendations/) - [Dynamic content](/docs/campaign/dynamiccontent) - [Jinjava inserts](/developers/inserts/insert-usage) - [Personalized recommendations](/docs/ai-hub/recommendations-v2/recommendation-types#personalized) # Encourage customers with the highest propensity to join the loyalty club By promoting our loyalty program, we want to reach with our communication mainly those who are most likely to join it. Thanks to such optimization, campaigns encouraging to become a member are better targeted - only to a specific, most promising group. This use case describes the process of creating a segmentation of customers with the highest propensity for joining the loyalty club. This segmentation can later be used in selected campaigns that promote the loyalty club membership. It can help you optimize the cost of campaigns that are oriented toward users who will enjoy the loyalty program and the probability that this group of users will be really interested in joining is really high. ## Prerequisites --- - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - Collect the [custom event](/developers/mobile-sdk/event-tracking) which sends information to Synerise about joining a loyalty program (for example `account.status` with parameter `accountStatus` equal to `active`). Such an event with the appropriate status must be sent each time the membership status changes (when the customer resigns from the program or joins again). - [Enable the Lookalike prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-lookalikes). - Create an email template with a message which encourages users to become your loyalty club members.
We recommend using [snippets](/docs/assets/snippets) in email templates to personalize the message, for example, you can use the first name of the customer and [the promotion code for the first transaction](/use-cases/discount-promotion-for-first-transaction).
## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/probability-joining-loyalty-club#create-an-aggregate) that returns the current status of the customer’s membership in loyalty program. 3. [Create source segmentation](/use-cases/probability-joining-loyalty-club#create-source-segmentation) of customers who are members of loyalty program. 4. [Create target segmentation](/use-cases/probability-joining-loyalty-club#create-target-segmentation). 4. [Create a prediction](/use-cases/probability-joining-loyalty-club#create-a-prediction). 5. [Create an email campaign](/use-cases/probability-joining-loyalty-club#create-an-email-campaign). ## Create an aggregate --- In this part of the process, you create an aggregate analyzing the current status of the customer's membership. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown list, select the **account.status** event. 5. As the event parameter, choose **accountStatus**. 6. Define the period for the event as **Lifetime**. 7. To save the aggregate, click **Save**.
Decision Hub aggregate returning the last accountStatus parameter of account.status events in a customer's lifetime
Configuration of the aggregate
## Create source segmentation --- In this part of the process, create a source segmentation that contains model customers. These customers will be compared with those in the target segmentation to find the customers who are similar to the model group. This segmentation includes customers who currently are members of your loyalty club. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 5. From the **Add condition** dropdown list, select the [aggregate analyzing the active status of the customer's membership](/use-cases/probability-joining-loyalty-club#create-an-aggregate) you created in the previous step. 6. As an operator, choose **Equal**. 7. In the text field, enter `active`. 7. Confirm the settings by clicking **Save**.
Decision Hub segmentation filtering customers whose account.status aggregate equals active, used as source for the Lookalike prediction
Configuration of the source segmentation
## Create target segmentation --- Create a segmentation of customers among whom you would like to find those who are most likely to become a member of your loyalty program. In our case, as we want to direct to such customers email communication, we will narrow down the segmentation to customers who agreed to receive newsletters. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. From the **Add condition** dropdown list, select the [aggregate analyzing the active status of the customer's membership](/use-cases/probability-joining-loyalty-club#create-an-aggregate) created in the previous step. 4. As an operator, choose **Not equal**. 5. In the text field, enter `active`. 5. From the **Add condition** dropdown list, select `newsletter_agreement`. 6. As an operator, choose **Equal**. 7. In the text field, enter `enabled`. 7. Confirm the settings by clicking **Save**.
Decision Hub segmentation filtering customers whose account.status aggregate is not active and newsletter_agreement is enabled, used as target for the Lookalike prediction
Configuration of the target segmentation
## Create a prediction --- In this part of the process, create a Lookalikes prediction which compares the two segmentations - the engine looks for customers in the target segmentation who are most similar to the customers in the source segmentation. On the profile cards of all customers from the target segmentation, a snr.lookalike.score event is generated. In the details of the event, you can find the score_label parameter that describes the similarity of a customer to the customers in the source segmentation. The score_label parameter for this particular prediction takes two values: low or high. 1. Go to Prediction icon **Predictions > New prediction**. 2. As the type of prediction, select **Lookalikes**. 3. In the **Audience** section, click **Define**. 4. In the **Source segmentation** subsection, click **Choose segmentation**. 5. From the dropdown list, select the [source segmentation you created before.](/use-cases/probability-joining-loyalty-club#create-source-segmentation) 6. In the **Target segmentation** subsection, click **Choose segmentation**. 7. From the dropdown list, select the [target segmentation you created before.](/use-cases/probability-joining-loyalty-club#create-target-segmentation) 8. Confirm by clicking **Apply**. 9. In the **Settings** section, click Change. 10. Enable the Set up recurring prediction calculation option. 12. Select the 2-point scale. 13. Confirm by clicking **Apply.** 14. Click **Save & Calculate**.
AI Hub Lookalike prediction configuration comparing source and target segmentations to find customers most likely to join the loyalty club
Configuration of the prediction
## Create an email campaign --- In this part of the process, you create an email campaign, targeted to customers with the high propensity to join the loyalty program. This campaign will encourage them to become a member. 1. Go to Experience Hub icon **Experience Hub > Email campaign > Create new**. 2. In the **Audience** section, choose the **New audience**. 3. Define the conditions: 1. Choose event `snr.lookalike.score`. 2. As the parameter choose **modelId**. 3. As the operator, choose **Equal**. 4. In the text field, enter the ID of the prediction you created. 5. Click **+ where**. 6. From the dropdown list, select **source_label**. 7. As the operator, choose **Equal**. 8. In the text field, enter `high`.
The conditions for the audience of the email
The conditions for the audience of the email
4. Apply and save your changes. 3. Configure the **Content** section. 1. Choose the email account from which you want to send your message. 2. In the **Subject** field, enter your message subject. 2. Click **Create message** and choose an email template created as a part of prerequisites. 3. Apply changes. 4. In the **Schedule** section, specify the time when you want to send your communication. 4. You can optionally define **UTM & URL parameters**. If not, click **Skip step**. 4. Confirm by clicking **Apply**. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [aggregate configuration](https://app.synerise.com/analytics/aggregates/4538a92b-b5e7-338e-a7f0-a4c690b63272), - [target segmentation](https://app.synerise.com/analytics-v2/segmentations/978b1740-9d89-45f5-b39a-44f66541c923), - [source segmentation](https://app.synerise.com/analytics-v2/segmentations/c84d0d14-6361-4007-9325-ff2cb7f3d18a), - [prediction](https://app.synerise.com/ai-v2/predictions/lookalike/pogtpohudlin), - [email campaign](https://app.synerise.com/campaigns/create/5a0afcb8-bf8d-46a0-b7e5-a65fd4edd509). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`snr.lookalike.score`](/docs/assets/events/event-reference/predictions#snrlookalikescore) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Email campaigns](/docs/campaign/e-mail) - [Predictions](/docs/ai-hub/predictions) - [Segmentation](/docs/analytics/segmentations) # Price drop alert with split workflow and product intent prioritization This use case presents a different approach to price drop campaigns by separating the logic into two independent automations. Instead of processing all conditions and communication in a single workflow, the first automation is responsible for detecting price drops and generating enriched events, while the second handles communication based on these events. This approach improves performance, simplifies logic, and gives more control over campaign execution. Additionally, the campaign introduces product prioritization. Products are selected based on user intent in the following order: 1. Adding product to cart 2. Adding product to favorites 3. Visiting the product in the mobile app 4. Visiting the product on the website As a result, users receive communication about the most relevant discounted products and the copy of the email is prepared based on the type of activity of the customer (adding to cart, adding to favorites, and so on). The key advantages of this approach include: - **Separation of concerns**: The event generation workflow handles all data collection and price comparison logic, while the communication workflow only handles routing and sending. - **Snippet-based logic**: All product validation, price comparison, and exclusion logic is contained in a reusable snippet referenced in the Generate Event node. - **Built-in exclusion mechanism**: Products that have already been communicated to a customer are excluded from subsequent sends, ensuring the campaign spreads across multiple days and intent categories.
While this use case focuses on the **email** communication channel, the event generation workflow is designed to also serve as a foundation for other channels. The generated `results.priceDrop` event contains both email and push data, so you can build a companion mobile push workflow using the same event without modifying the detection logic. See the [What's next](#whats-next) section for details.
## Prerequisites --- - Implement a [tracking code](/docs/settings/tool/tracking_codes) on your website. - [Create an item catalog](/docs/ai-hub/recommendations-v2/item-feed-requirements) containing information on the actual price of products (including the `effectivePrice` and `availability` attributes). It is recommended to use a feed-based catalog, as it contains the most up-to-date product data including current prices and availability. - [Create an email template](/docs/campaign/e-mail/creating-email-templates) to be used in the price drop campaign. You can use a single template across all priority paths and dynamically change its content based on the interaction type. Alternatively, you can create separate templates for each journey (cart, favorites, visited) for more granular control and analytics. - Ensure user marketing consent attribute (email - e.g. `newsletter_agreement`) is available. - Integrate [transaction events](/developers/web/transactions-sdk). - [Create and set up your email account](/docs/campaign/e-mail/configuring-email-account). - Implement a [custom event](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent) `results.priceDrop` and register it in **Data Modeling Hub > Events** before use. The event must include the following parameters: - `eventdata` — containing product SKUs, counts, and exclusion data generated by the snippet. - `newsletterAgreement` — email marketing consent status. Optionally, you can add extra parameters (such as loyalty program membership) to support further personalization in your email templates. ## Process --- In this use case, you will go through the following steps: 1. [Create aggregates](#create-aggregates) required for product collection and exclusion logic. 2. [Create the snippet with price drop detection logic](#create-the-snippet-with-price-drop-detection-logic). 3. [Create the workflow for detecting price drops and generating events](#create-the-workflow-for-detecting-price-drops). 4. [Create the workflow for sending email communications based on product intent](#create-the-workflow-for-sending-email-communications). ## Create aggregates --- Several aggregates are needed to support the event generation logic. These aggregates collect product SKUs and prices from different interaction types, handle exclusions of already-purchased products, and feed into the snippet that runs inside the Generate Event node. The aggregates are organized into the following groups: - [Shared aggregates](#shared-aggregates) — purchase history, removal history, and global exclusion data. - [Favorites aggregates](#favorites-aggregates) — products added to favorites. - [Cart aggregates](#cart-aggregates) — products added to cart. - [Mobile app viewed aggregates](#mobile-app-viewed-aggregates) — products viewed in the mobile app. - [Desktop website viewed aggregates](#desktop-website-viewed-aggregates) — products visited on the website.
All aggregates in this use case use a default period of **30 days**. This value can be adjusted to match your business needs and the event retention configured in your workspace. Longer periods capture more product interactions but may include outdated price data; shorter periods keep the data fresh but may miss older interactions.
### Shared aggregates #### Aggregate collecting recently purchased product SKUs --- This aggregate collects SKUs of products the customer has purchased recently. It is used as a "Not in array" filter in other aggregates to exclude products the customer has already bought — there is no need to notify them about a price drop on something they already own. 1. Go to Decision Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Last 30 days purchased product SKUs`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **30**. 5. From the **Choose event** dropdown list, select the **Bought product** event. 6. As the event parameter, select **$sku**. 7. Click the **+ where** button: - From the **Choose parameter** dropdown list, select the **$sku** parameter. - From the **Choose operator** dropdown list, select **Is not empty**. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting recently purchased product SKUs
Configuration of the aggregate collecting recently purchased product SKUs
#### Aggregate collecting previous price drop event data (global exclusion) --- This aggregate analyzes `eventdata` from previous `results.priceDrop` events. The snippet parses the `excluded` field from this data to prevent sending the same products again in subsequent campaign runs. The key behavior here is that a product is only added to the exclusion list when it has been **actually communicated** to the customer. The fact that a `results.priceDrop` event was generated on a given day does not automatically mean the customer received a message — if no products had a price drop, the event will be empty and no exclusion occurs. This ensures that users are not blocked from future campaigns unnecessarily. The aggregate uses a period setting (default: 30 days) which lets you control how long a product remains excluded after being communicated. After this period expires, the product becomes eligible again. 1. Go to Decision Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Last price drop event data`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **100 000**. 5. From the **Choose event** dropdown list, select the **results.priceDrop** event. 6. As the event parameter, select **eventdata**. 7. Click the **+ where** button: - From the **Choose parameter** dropdown list, select the **eventdata** parameter. - From the **Choose operator** dropdown list, select **Is not empty**. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting previous price drop event data
Configuration of the aggregate collecting previous price drop event data
#### Aggregate collecting products removed from cart --- This aggregate collects SKUs of all products the customer has removed from their cart. It is used as an exclusion filter in the cart SKU aggregate to ensure that products intentionally removed from the cart are not included in the price drop communication. 1. Go to Decision Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Remove from cart all`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **100**. 5. From the **Choose event** dropdown list, select the `product.removeFromCart` event. 6. As the event parameter, select **$sku**. 7. Define the period to the last **30 days**. 8. Save the aggregate.
Configuration of the aggregate collecting products removed from cart
Configuration of the aggregate collecting products removed from cart
### Favorites aggregates #### Aggregate collecting favorite product SKUs --- This aggregate collects SKUs of products added to favorites that have not been purchased recently. 1. Go to Decision Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Favorite products with lower price - SKUs`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **1000**. 5. From the **Choose event** dropdown list, select the **product.addToFavorite** event. 6. As the event parameter, select **$sku**. 7. Click the **+ where** button and add the following conditions: - `$sku` **Is not empty** — ensures the SKU parameter exists. - `finalUnitPrice` **Is not empty** — ensures the price parameter exists. - `$sku` **Not in array** → select the aggregate **Last 30 days purchased product SKUs**. This excludes products that the customer has already bought. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting favorite product SKUs
Configuration of the aggregate collecting favorite product SKUs
#### Aggregate collecting favorite product prices --- This aggregate collects the prices (`finalUnitPrice`) recorded at the time when products were added to favorites. These prices are later compared with current catalog prices in the snippet to detect price drops. 1. Go to Decision Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Favorite products with lower price - prices`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **1000**. 5. From the **Choose event** dropdown list, select the **product.addToFavorite** event. 6. As the event parameter, select **finalUnitPrice**. 7. Click the **+ where** button and add the same conditions as in the SKU aggregate: - `$sku` **Is not empty**. - `finalUnitPrice` **Is not empty**. - `$sku` **Not in array** → select the aggregate **Last 30 days purchased product SKUs**. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting favorite product prices
Configuration of the aggregate collecting favorite product prices
It is critical that the conditions defined in the SKU and price aggregates for each interaction type are identical. The snippet pairs SKUs with prices by array index, so any mismatch in filtering conditions would cause incorrect price comparisons.
### Cart aggregates #### Aggregate collecting cart product SKUs --- This aggregate collects SKUs of products added to cart that have not been removed from cart or recently purchased. 1. Go to Decision Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Cart products with lower price - SKUs`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **1000**. 5. From the **Choose event** dropdown list, select the **product.addToCart** event. 6. As the event parameter, select **$sku**. 7. Click the **+ where** button and add the following conditions: - `$sku` **Is not empty** — ensures the SKU value exists. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting cart product SKUs
Configuration of the aggregate collecting cart product SKUs
#### Aggregate collecting cart product prices --- This aggregate collects the prices recorded at the time when products were added to cart. 1. Go to Decision Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Cart products with lower price - prices`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **1000**. 5. From the **Choose event** dropdown list, select the **product.addToCart** event. 6. As the event parameter, select **$finalUnitPrice**. 7. Click the **+ where** button and add the following conditions: - `$finalUnitPrice` **Is not empty** — ensures the price value exists. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting cart product prices
Configuration of the aggregate collecting cart product prices
### Mobile app viewed aggregates
The mobile app viewed aggregates use the **product.view** event and the `sku` parameter, while the desktop website viewed aggregates use the `page.visit` event and `product:retailer_part_no`. This difference reflects how product views are tracked on each platform. Make sure to use the correct event and parameter names for your implementation.
#### Aggregate collecting mobile app viewed product SKUs --- This aggregate collects SKUs of products viewed in the mobile app that have not been recently purchased. 1. Go to Decision Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Mobile app viewed products - SKUs`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **1000**. 5. From the **Choose event** dropdown list, select the **product.view** event. 6. As the event parameter, select **sku**. 7. Click the **+ where** button and add the following conditions: - `sku` **Is not empty** — ensures the SKU parameter exists. - `sku` **Not in array** → select the aggregate **Last 30 days purchased product SKUs**. This excludes products the customer has already bought. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting mobile app viewed product SKUs
Configuration of the aggregate collecting mobile app viewed product SKUs
#### Aggregate collecting mobile app viewed product prices --- This aggregate collects the prices (`finalUnitPrice`) recorded at the time when products were viewed in the mobile app. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Mobile app viewed products - prices`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **1000**. 5. From the **Choose event** dropdown list, select the **product.view** event. 6. As the event parameter, select **finalUnitPrice**. 7. Click the **+ where** button and add the following conditions: - `sku` **Is not empty**. - `sku` **Not in array** → select the aggregate **Last 30 days purchased product SKUs**. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting mobile app viewed product prices
Configuration of the aggregate collecting mobile app viewed product prices
### Desktop website viewed aggregates #### Aggregate collecting desktop website viewed product SKUs --- This aggregate collects `product:retailer_part_no` values of products visited on the website that have not been recently purchased. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Desktop website viewed products - SKUs`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **1000**. 5. From the **Choose event** dropdown list, select the `page.visit` event. 6. As the event parameter, select **product:retailer_part_no**. 7. Click the **+ where** button and add the following conditions: - `product:retailer_part_no` **Is not empty** — ensures the product ID exists. - `product:retailer_part_no` **Not in array** → select the aggregate **Last 30 days purchased product SKUs**. This excludes products the customer has already bought. - `product:price:amount` **Is not empty** — ensures the price parameter exists. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting desktop website viewed product SKUs
Configuration of the aggregate collecting desktop website viewed product SKUs
#### Aggregate collecting desktop website viewed product prices --- This aggregate collects the prices (`product:price:amount`) recorded at the time when products were visited on the website. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Desktop website viewed products - prices`. 4. Click **Analyze profiles by** and select **Last Multi** and size: **1000**. 5. From the **Choose event** dropdown list, select the `page.visit` event. 6. As the event parameter, select **product:price:amount**. 7. Click the **+ where** button and add the following conditions: - `product:retailer_part_no` **Is not empty**. - `product:retailer_part_no` **Not in array** → select the aggregate **Last 30 days purchased product SKUs**. - `product:price:amount` **Is not empty**. 8. Define the period to the last **30 days**. 9. Save the aggregate.
Configuration of the aggregate collecting desktop website viewed product prices
Configuration of the aggregate collecting desktop website viewed product prices
## Create the snippet with price drop detection logic --- The snippet is the core of this use case. It is stored in **Data Modeling Hub > Snippets** and referenced by its hash in the Generate Event node. - ### Create the snippet 1. Go to Automation Hub icon **Data Modeling Hub > Snippets > Add snippet**. 2. Enter the name of the snippet, for example `Price drop detection logic`. 3. Paste the following Jinjava code:
{%- set final_objects_for_alert=[] -%}
{%- set added_objects=[] -%}
{%- set last_add_fav_skus=[] -%}
{%- set last_add_fav_prices=[] -%}
{%- aggregate 1227553d-114a-3c19-b618-6c3afc9d7a32 -%}
{%- for items in aggregate_result -%}
{%- do last_add_fav_skus.append(items) -%}
{%- endfor -%}
{%- endaggregate -%}
{%- aggregate 1227553d-114a-3c19-b618-6c3afc9d7a32 -%}
{%- for price in aggregate_result -%}
{%- do last_add_fav_prices.append(price) -%}
{%- endfor -%}
{%- endaggregate -%}
{%- for added in last_add_fav_skus -%}
{%- do added_objects.append({'sku': added, 'price': last_add_fav_prices[loop.index0]}) -%}
{%- endfor -%}
{%- set final_price_alert_fav_skus=[] -%}
{%- for item in added_objects -%}
{%- catalogitemv2.(item.sku) allowEmpty=True -%}
{%- set object = catalog_result -%}
{%- if object.availability == 'true' -%}
{%- set _catalog_price = catalog_result.get('effectivePrice') -%}
{%- set catalog_price = _catalog_price | float -%}
{%- set item_price = item.price|float -%}
{%- set is_discounted = item_price > catalog_price -%}
{%- if is_discounted -%}
{%- do final_price_alert_fav_skus.append(item) -%}
{%- endif -%}
{%- endif -%}
{%- endcatalogitemv2 -%}
{%- endfor -%}
{%- set added_objects=[] -%}
{%- set last_add_fav_skus=[] -%}
{%- set last_add_fav_prices=[] -%}
{%- aggregate 34f469d8-f83d-32e5-b0e1-10f73b0a0179 -%}
{%- for items in aggregate_result -%}
{%- do last_add_fav_skus.append(items) -%}
{%- endfor -%}
{%- endaggregate -%}
{%- aggregate 4148b6aa-4488-39d1-81b8-a29ed5b23424 -%}
{%- for price in aggregate_result -%}
{%- do last_add_fav_prices.append(price) -%}
{%- endfor -%}
{%- endaggregate -%}
{%- for added in last_add_fav_skus -%}
{%- do added_objects.append({'sku': added, 'price': last_add_fav_prices[loop.index0]}) -%}
{%- endfor -%}
{%- set final_price_alert_cart_skus=[] -%}
{%- for item in added_objects -%}
{%- catalogitemv2.(item.sku) allowEmpty=True -%}
{%- set object = catalog_result -%}
{%- if object.availability == 'true' -%}
    {%- set _catalog_price = catalog_result.get('effectivePrice') -%}
    {%- set catalog_price = _catalog_price | float -%}
    {%- set item_price = item.price|float -%}
    {%- set is_discounted = item_price > catalog_price -%}
    {%- if is_discounted -%}
    {%- do final_price_alert_cart_skus.append(item) -%}
    {%- endif -%}
{%- endif -%}
{%- endcatalogitemv2 -%}
{%- endfor -%}
{%- set added_objects=[] -%}
{%- set last_add_fav_skus=[] -%}
{%- set last_add_fav_prices=[] -%}
{%- aggregate 51d1daac-8483-351f-ae01-ea0b5455fba0 -%}
{%- for items in aggregate_result -%}
{%- do last_add_fav_skus.append(items) -%}
{%- endfor -%}
{%- endaggregate -%}
{%- aggregate 51d1daac-8483-351f-ae01-ea0b5455fba0 -%}
{%- for price in aggregate_result -%}
{%- do last_add_fav_prices.append(price) -%}
{%- endfor -%}
{%- endaggregate -%}
{%- for added in last_add_fav_skus -%}
{%- do added_objects.append({'sku': added, 'price': last_add_fav_prices[loop.index0]}) -%}
{%- endfor -%}
{%- set final_price_alert_desktop_skus=[] -%}
{%- for item in added_objects -%}
{%- catalogitemv2.(item.sku) allowEmpty=True -%}
{%- set object = catalog_result -%}
{%- if object.availability == 'true' -%}
    {%- set _catalog_price = catalog_result.get('effectivePrice') -%}
    {%- set catalog_price = _catalog_price | float -%}
    {%- set item_price = item.price|float -%}
    {%- set is_discounted = item_price > catalog_price -%}
    {%- if is_discounted -%}
    {%- do final_price_alert_desktop_skus.append(item) -%}
    {%- endif -%}
{%- endif -%}
{%- endcatalogitemv2 -%}
{%- endfor -%}
{%- set added_objects=[] -%}
{%- set last_add_fav_skus=[] -%}
{%- set last_add_fav_prices=[] -%}
{%- aggregate adb929ff-f56c-37d6-b5d8-61d88449d2e1 -%}
{%- for items in aggregate_result -%}
{%- do last_add_fav_skus.append(items) -%}
{%- endfor -%}
{%- endaggregate -%}
{%- aggregate adb929ff-f56c-37d6-b5d8-61d88449d2e1 -%}
{%- for price in aggregate_result -%}
{%- do last_add_fav_prices.append(price) -%}
{%- endfor -%}
{%- endaggregate -%}
{%- for added in last_add_fav_skus -%}
{%- do added_objects.append({'sku': added, 'price': last_add_fav_prices[loop.index0]}) -%}
{%- endfor -%}
{%- set final_price_alert_mobile_skus=[] -%}
{%- for item in added_objects -%}
{%- catalogitemv2.(item.sku) allowEmpty=True -%}
{%- set object = catalog_result -%}
{%- if object.availability == 'true' -%}
    {%- set _catalog_price = catalog_result.get('effectivePrice') -%}
    {%- set catalog_price = _catalog_price | float -%}
    {%- set item_price = item.price|float -%}
    {%- set is_discounted = item_price > catalog_price -%}
    {%- if is_discounted -%}
    {%- do final_price_alert_mobile_skus.append(item) -%}
    {%- endif -%}
{%- endif -%}
{%- endcatalogitemv2 -%}
{%- endfor -%}
{%- set seen = [] -%}
{%- set excluded = [] -%}
{%- aggregate b5fc6392-65f1-32d3-9ed1-a41f209ea4c5 -%}
{%- for result in aggregate_result -%}
{%- set raw = result|string -%}
{%- set split1 = raw|split('excluded=[') -%}
{%- if split1|length > 1 -%}
    {%- set inside = split1[1]|split(']') -%}
    {%- for item in inside[0]|split(', ') -%}
    {%- set trimmed = item|trim -%}
    {%- if trimmed != '' and (trimmed in excluded == false) -%}
        {%- do excluded.append(trimmed) -%}
    {%- endif -%}
    {%- endfor -%}
{%- endif -%}
{%- endfor -%}
{%- endaggregate -%}
{%- set filtered_cart = [] -%}
{%- for item in final_price_alert_cart_skus -%}
{%- if item.sku != '' and (item.sku in excluded == false) and (item.sku in seen == false) -%}
{%- do filtered_cart.append(item.sku) -%}
{%- do seen.append(item.sku) -%}
{%- endif -%}
{%- endfor -%}
{%- set filtered_fav = [] -%}
{%- for item in final_price_alert_fav_skus -%}
{%- if item.sku != '' and (item.sku in excluded == false) and (item.sku in seen == false) -%}
{%- do filtered_fav.append(item.sku) -%}
{%- do seen.append(item.sku) -%}
{%- endif -%}
{%- endfor -%}
{%- set filtered_viewMobile = [] -%}
{%- for item in final_price_alert_mobile_skus -%}
{%- if item.sku != '' and (item.sku in excluded == false) and (item.sku in seen == false) -%}
{%- do filtered_viewMobile.append(item.sku) -%}
{%- do seen.append(item.sku) -%}
{%- endif -%}
{%- endfor -%}
{%- set filtered_viewWeb = [] -%}
{%- for item in final_price_alert_desktop_skus -%}
{%- if item.sku != '' and (item.sku in excluded == false) and (item.sku in seen == false) -%}
{%- do filtered_viewWeb.append(item.sku) -%}
{%- do seen.append(item.sku) -%}
{%- endif -%}
{%- endfor -%}
{%- set new_excluded = [] -%}
{%- if filtered_cart|length > 0 -%}
{%- set new_excluded = filtered_cart -%}
{%- elif filtered_fav|length > 0 -%}
{%- set new_excluded = filtered_fav -%}
{%- elif filtered_viewMobile|length > 0 -%}
{%- set new_excluded = filtered_viewMobile -%}
{%- elif filtered_viewWeb|length > 0 -%}
{%- set new_excluded = filtered_viewWeb -%}
{%- endif -%}
{%- set finalObj = {'emailCartSku': filtered_cart,'emailCartCount': filtered_cart|length,'emailFavSku': filtered_fav,'emailFavCount': filtered_fav|length,'emailViewMobileSku': filtered_viewMobile,'emailViewMobileCount': filtered_viewMobile|length,'emailViewWebSku': filtered_viewWeb,'emailViewWebCount': filtered_viewWeb|length,'excluded': new_excluded} -%}{{ finalObj }}
Before using this snippet, you must: - Go to config and replace boxes in the config with the actual aggregates you created in the previous steps. - Replace `YOUR_CATALOG_NAME` with the name of your item catalog (for example, `AI Feed - default`).
Configuration
Configuratione
4. Save the snippet for use in the Generate Event node. ### How the snippet works The snippet processes each interaction type in sequence using a repeating pattern. For each type, it: - **Loads two parallel arrays** from aggregates — SKUs and prices — for products the user interacted with. - **Builds product objects** combining SKU and price. - **Looks up each product in the catalog** using `catalogitemv2`. It checks two things: - Is the product still available (`availability == 'true'`)? - Is the current catalog price (`effectivePrice`) lower than the price recorded at the time of user interaction? Only products passing both checks qualify as price-dropped. After processing all four interaction types, the snippet enters the **global filtering and exclusion phase**: - **Loads previous exclusions** from the most recent `results.priceDrop` event's `eventdata` parameter. It parses the `excluded=[...]` field to get a list of SKUs that were already communicated. - **Filters each category** by removing: - Products from the previous exclusion list. - Products already present in a higher-priority category (via the `seen` list), so the same SKU never appears in two categories. - **Determines the new exclusion list**: Only products from the highest-priority non-empty category are added to `excluded`. This ensures the next campaign run skips these products and moves to the next priority level.
The snippet also generates single-SKU fields per category (e.g. `pushCartSku`, `pushFavSku`) which are not used in this email workflow but can be consumed by a [companion push workflow](#whats-next).
- **Prepares push variants**: For each category, takes only the last (most recent) product for push notifications (max 1 per category). These are included in the event data for use in a potential [mobile push workflow](#whats-next). ## Create the workflow for detecting price drops --- This workflow is responsible for selecting the target audience, running the snippet that detects price drops across all interaction types, and generating an enriched event that contains all the necessary data for the communication workflow. By using a snippet in the Generate Event node, this approach offloads logic from aggregates and email templates, resulting in better optimization and simpler template design. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Audience trigger node ---
The audience conditions described below are an example configuration. You should adjust the specific events, time ranges, and consent conditions to match your business requirements and campaign frequency.
1. Start the workflow with the **Audience** node. In the configuration of the node: 1. Set the **Repeat runs** option to **repeatable** and configure the desired interval (for example, once a day or once a week). 2. Select the time zone. 3. In the **Audience** section, choose **New audience**. 4. Click **Define conditions**. 5. Add the following conditions connected by the **OR** operator: - From the **Choose filter** dropdown list, select the `page.visit` event. - From the **Choose filter** dropdown list, select the `product.addToFavorite` event. - From the **Choose filter** dropdown list, select the `product.addToCart` event. - From the **Choose filter** dropdown list, select the `product.view` event. 6. Add an **AND** condition to ensure the user has not already received a price drop email recently: - From the **Choose filter** dropdown list, select the `message.send` event. - Change **Performed** to **Not performed**. - Click the **+ where** button, select the **diagramId** parameter, set **Equal** to the diagram ID of the [email communication workflow](#create-the-workflow-for-sending-email-communications). - Set the time range according to your desired sending frequency (for example, **last 7 days**). 7. Add an **AND** condition to ensure the user has marketing consent: - From the **Choose filter** dropdown list, select the **newsletter_agreement** attribute. - Set the operator to **Equal** and the value to `enabled`. 8. Confirm by clicking **Apply**.
The exclusion condition based on `message.send` with a specific `diagramId` ensures that only users who have **actually received** a price drop email are excluded from the next run. This is more precise than excluding based on the `results.priceDrop` event, because the event is generated for all qualifying users — even those for whom no products had a price drop. Using event-based exclusion would unnecessarily block those users from entering the campaign on subsequent days.
### Configure the Generate Event node --- This node generates a `results.priceDrop` event on each customer's profile. The event contains all the data needed by the communication workflow, including discounted product SKUs grouped by interaction type, product counts for each category, and the user's email consent status. 1. Add the **Generate Event** node. In the configuration of the node: 1. In the **Event name** field, enter `results.priceDrop`. 2. In the **Body** section, enter the following structure:
{
             "eventdata": "{% snippet %} SNIPPET_HASH {% endsnippet %}",
             "newsletterAgreement": "{{ customer.newsletter_agreement }}",
               }
Where: - `eventdata` — references the [snippet](#create-the-snippet-with-price-drop-detection-logic) created in the previous step. Replace `SNIPPET_HASH` with the actual snippet hash. - `newsletterAgreement` — captures the user's email consent status at the time of event generation. Optionally, you can add extra parameters to support further personalization in your email templates, such as loyalty program membership or customer tier. The `eventdata` parameter will be populated by the snippet. Below is an example of the generated output (the actual number of SKUs depends on each user's activity and which products have had a price drop): `emailCartSku=[SKU1,SKU2], emailCartCount=2, emailFavSku=[SKU3], emailFavCount=1, emailViewMobileSku=[SKU4], emailViewMobileCount=1, emailViewWebSku=[SKU5,SKU6,SKU7], emailViewWebCount=3, pushCartSku=[SKU1], pushCartCount=1, pushFavSku=[SKU3], pushFavCount=1, pushViewMobileSku=[SKU4], pushViewMobileCount=1, pushViewWebSku=[SKU5], pushViewWebCount=1, excluded=[SKU1,SKU2]` In this example, `emailCartSku` is the highest-priority non-empty category (the "winning" category), so the `excluded` list contains only the cart SKUs (`SKU1,SKU2`). Products from other categories (favorites, mobile viewed, web viewed) are not excluded yet and will be eligible for communication on subsequent days. The key fields in `eventdata` are: - `emailCartSku` / `emailCartCount` — SKUs and count of discounted cart products. - `emailFavSku` / `emailFavCount` — SKUs and count of discounted favorite products. - `emailViewMobileSku` / `emailViewMobileCount` — SKUs and count of discounted products viewed in the mobile app. - `emailViewWebSku` / `emailViewWebCount` — SKUs and count of discounted products viewed on the website. - `excluded` — list of product SKUs from the winning priority category, to be excluded from future sends. 3. Confirm by clicking **Apply**.
Configuration of the Generate Event node
Configuration of the Generate Event node
### Add the finishing node --- 1. Add the **End** node with **Finish other paths** enabled. 2. In the upper right corner, click **Save & Run**.
The workflow for generating price drop events
The workflow for generating price drop events
## Create the workflow for sending email communications --- This workflow listens for the `results.priceDrop` event generated by the first workflow and routes customers into different email communication paths based on product intent priority. It uses four parallel Profile Event trigger paths, each checking the `eventdata` parameter for the relevant product count: - **Priority 1: Cart** — Send Email. Triggers when the number of cart products with a price drop is greater than 0. - **Priority 2: Favorites** — Send Email. Triggers when cart count equals 0, but favorites count is greater than 0. - **Priority 3: Last seen in mobile app** — Send Email. Triggers when cart and favorites counts equal 0, but mobile app viewed count is greater than 0. - **Priority 4: Last seen on website** — Send Email. Triggers when cart, favorites, and mobile app counts all equal 0, but website viewed count is greater than 0. The prioritization ensures that on a given day, a user enters only one path — the highest-priority one with available products. On subsequent days, the exclusion mechanism removes already-communicated products, causing the user to fall through to the next priority level. **Example over multiple days:** - **Day 1**: User has 4 cart products with a price drop **and** 4 favorite products with a price drop → enters the Cart path (highest priority), receives email with cart products. These products are added to the exclusion list. The communication about favorite products is skipped due to priority and waits for the next opportunity. - **Day 2**: Cart products already excluded → system checks favorites. User has 4 favorite products, but 3 overlap with already-excluded cart products → receives email with 1 remaining favorite product. - **Day 3**: Cart and favorites exhausted → system checks mobile app viewed products → email sent with viewed products if any have a price drop. Using the same email template across all four paths with dynamic content is a recommended approach. You can pass additional parameters (such as the scenario name) to the template, which allows you to differentiate copy in the template itself and also track in analytics which scenario performs best. An additional benefit of using a single dynamic template is that when you need to make changes, you update it in one place instead of maintaining four separate templates. ### Working with event data in email templates --- All four email paths in this workflow use the `eventdata` parameter from the `results.priceDrop` event to dynamically populate product content. In each Send Email node, you can access the relevant SKU list from the event context using [event parameter reuse](/developers/inserts/automation). Since `eventdata` is a structured string, you need to parse it in the template to extract the SKU list for the appropriate interaction type. For example, for the cart path you would extract the `emailCartSku` field, for the favorites path the `emailFavSku` field, and so on. Once you have the SKU list, you can iterate over it, look up each product in the catalog, and display the product name, image, current price, and link. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Configure the Profile Event trigger for cart path (Priority 1) --- 1. As the first trigger path, add a **Profile Event** node and name it `prio 1: CART`. In the configuration of the node: 1. Enable **Action limit** and set it to **1 time per Workflow**. 2. From the **Choose event** dropdown menu, choose the `results.priceDrop` event. 3. Click the **+ where** button and add the following conditions: - `newsletterAgreement` **Equal** `enabled` - `eventdata` **Contain** `emailCartCount=` - `eventdata` **Not contain** `emailCartCount=0` 4. Confirm by clicking **Apply**.
Configuration of the Profile Event node for cart path
Configuration of the Profile Event node for cart path
The combination of **Contain** `emailCartCount=` and **Not contain** `emailCartCount=0` effectively checks that the cart product count exists and is greater than zero. This pattern is used consistently across all paths. The `newsletterAgreement` **Equal** `enabled` condition acts as a safety check to ensure that only users with valid email consent enter the path, even if the audience node has already filtered for consent. This prevents edge cases where consent might have changed between audience evaluation and event generation.
### Add Send Email for cart path --- 1. Add the **Send Email** node. 1. Select the email template prepared for the price drop campaign. 2. Confirm by clicking **Apply**. ### Configure the Profile Event trigger for favorites path (Priority 2) --- 1. Add a second **Profile Event** node and name it `prio 2: FAV`. In the configuration of the node: 1. Enable **Action limit** and set it to **1 time per Workflow**. 2. From the **Choose event** dropdown menu, choose the `results.priceDrop` event. 3. Click the **+ where** button and add the following conditions: - `newsletterAgreement` **Equal** `enabled` - `eventdata` **Contain** `emailCartCount=0` — ensures the cart path was not applicable (cart is empty). - `eventdata` **Contain** `emailFavCount=` - `eventdata` **Not contain** `emailFavCount=0` 4. Confirm by clicking **Apply**.
Configuration of the Profile Event node for favorites path
Configuration of the Profile Event node for favorites path
### Add Send Email for favorites path --- 1. Add the **Send Email** node. 1. Select the email template prepared for the price drop campaign. 2. Confirm by clicking **Apply**. ### Configure the Profile Event trigger for mobile app viewed path (Priority 3) --- 1. Add a third **Profile Event** node and name it `prio 3: LAST SEEN (APP)`. In the configuration of the node: 1. Enable **Action limit** and set it to **1 time per Workflow**. 2. From the **Choose event** dropdown menu, choose the `results.priceDrop` event. 3. Click the **+ where** button and add the following conditions: - `newsletterAgreement` **Equal** `enabled` - `eventdata` **Contain** `emailCartCount=0` — cart is empty. - `eventdata` **Contain** `emailFavCount=0` — favorites are empty. - `eventdata` **Contain** `emailViewMobileCount=` - `eventdata` **Not contain** `emailViewMobileCount=0` 4. Confirm by clicking **Apply**.
Configuration of the Profile Event node for mobile app viewed path
Configuration of the Profile Event node for mobile app viewed path
### Add Send Email for mobile app viewed path --- 1. Add the **Send Email** node. 1. Select the email template prepared for the price drop campaign. 2. Confirm by clicking **Apply**. ### Configure the Profile Event trigger for website viewed path (Priority 4) --- 1. Add a fourth **Profile Event** node and name it `prio 4: LAST SEEN (WEB)`. In the configuration of the node: 1. Enable **Action limit** and set it to **1 time per Workflow**. 2. From the **Choose event** dropdown menu, choose the `results.priceDrop` event. 3. Click the **+ where** button and add the following conditions: - `newsletterAgreement` **Equal** `enabled` - `eventdata` **Contain** `emailCartCount=0` — cart is empty. - `eventdata` **Contain** `emailFavCount=0` — favorites are empty. - `eventdata` **Contain** `emailViewMobileCount=0` — mobile app viewed is empty. - `eventdata` **Contain** `emailViewWebCount=` - `eventdata` **Not contain** `emailViewWebCount=0` 4. Confirm by clicking **Apply**. ### Add Send Email for website viewed path --- 1. Add the **Send Email** node. 1. Select the email template prepared for the price drop campaign. 2. Confirm by clicking **Apply**. ### Add the Merge Paths and finishing node --- 1. Connect all four paths to a **Merge Paths** node. This node combines separate paths into one and limits further processing, ensuring a customer only receives one email per workflow execution. 2. Add the **End** node. 3. In the upper right corner, click **Save & Run**.
The workflow for sending price drop email communications
The workflow for sending price drop email communications
## What's next --- A companion workflow for **mobile push notifications** can be built using the same `results.priceDrop` event. The key differences from the email workflow described above are: - **Event generation**: Add a `newsletterPush` parameter to the Generate Event body: `"newsletterPush": "{{ customer.receive_push_messages }}|{{ customer.snrs_has_mobile_push_devices }}"`. This captures push consent and device token status in the event so the push workflow can check them without querying the customer profile. - **Communication channel**: Replace Send Email nodes with **Send Mobile Push** nodes in all paths. - **Consent condition**: In each Profile Event trigger, change the consent check from `newsletterAgreement` **Equal** `enabled` to `newsletterPush` **Equal** `true|true`. The value `true|true` verifies two things: the first `true` confirms the user has granted push marketing consent (`receive_push_messages`), and the second `true` confirms they have an active mobile push device token (`snrs_has_mobile_push_devices`). Both conditions must be met for a push notification to be delivered. - **Product data**: The `results.priceDrop` event already contains push-specific SKUs in dedicated parameters (`pushCartSku`, `pushFavSku`, `pushViewMobileSku`, `pushViewWebSku`) — each limited to a single product — so you can reference them directly in your push notification template via [event parameter reuse](/developers/inserts/automation), just like in the email template. This means you only need to add one parameter to the event generation workflow — the snippet and all aggregates remain unchanged. ## 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: **Workflows:** - [Workflow for generating price drop events](https://app.synerise.com/automations/workflows/automation-diagram/b93d0800-b768-4849-83f2-88ba2e19cb24) - [Workflow for sending email communications](https://app.synerise.com/automations/workflows/automation-diagram/5226c9ad-cab7-4afd-9c26-6e61ed542b09) **Expressions:** - [Add to cart sku/$sku](https://app.synerise.com/analytics/expressions/0ffb560f-d1ce-4713-9e7e-0392ec0f32d6) - [Add to cart finalUnitPrice/$finalUnitPrice](https://app.synerise.com/analytics/expressions/f47ea9c9-a96e-4644-b787-5e80c1480d33) - [Remove from cart sku/$SKU](https://app.synerise.com/analytics/expressions/4a2244aa-33e5-49b6-a87b-b38c7fdb0e9b) **Shared aggregates:** - [Last 30 days purchased product SKUs](https://app.synerise.com/analytics-v2/aggregates/eba019a7-65cf-32b4-bc68-0b48d4cb55f7) - [Last price drop event data](https://app.synerise.com/analytics-v2/aggregates/b194da93-c703-3fd4-9802-da3be827478b) - [Remove from cart all](https://app.synerise.com/analytics-v2/aggregates/eba019a7-65cf-32b4-bc68-0b48d4cb55f7) **Favorites aggregates:** - [Favorite products with lower price - SKUs](https://app.synerise.com/analytics-v2/aggregates/1227553d-114a-3c19-b618-6c3afc9d7a32) - [Favorite products with lower price - prices](https://app.synerise.com/analytics-v2/aggregates/34f469d8-f83d-32e5-b0e1-10f73b0a0179) **Cart aggregates:** - [Cart products with lower price - SKUs](https://app.synerise.com/analytics-v2/aggregates/4148b6aa-4488-39d1-81b8-a29ed5b23424) - [Cart products with lower price - prices](https://app.synerise.com/analytics-v2/aggregates/150153c4-141e-3f09-967e-debdb84c20fc) **Mobile app viewed aggregates:** - [Mobile app viewed products - SKUs](https://app.synerise.com/analytics-v2/aggregates/2a4204cf-daeb-32e5-9115-25bcb0d00648) - [Mobile app viewed products - prices](https://app.synerise.com/analytics-v2/aggregates/b5fc6392-65f1-32d3-9ed1-a41f209ea4c5) **Desktop website viewed aggregates:** - [Desktop website viewed products - SKUs](https://app.synerise.com/analytics-v2/aggregates/51d1daac-8483-351f-ae01-ea0b5455fba0) - [Desktop website viewed products - prices](https://app.synerise.com/analytics-v2/aggregates/adb929ff-f56c-37d6-b5d8-61d88449d2e1) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 13 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~2), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~5), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~2), `results.priceDrop` (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Email campaigns](/docs/campaign/e-mail) - [Expressions](/docs/crm/expressions) - [Mobile push campaigns](/docs/campaign/Mobile) - [Reusing event context from preceding nodes](/developers/inserts/automation) - [Creating workflows](/docs/automation/creating-automation) - [Jinjava inserts](/developers/inserts/insert-usage) - [Snippets](/docs/assets/snippets) # Adding Gmail Promotions Annotation Gmail allows highlighting your messages in the “Promotions” tab with Gmail Promotions Annotation. Those annotations let you enhance the visibility of your emails and engage your recipients more effectively. With this feature, you can include a header, image, your company logo, the promotion's end date, and a variety of other details to make your emails stand out. This use case demonstrates how to integrate the Gmail Promotions Annotation feature into email communication sent from Synerise. It provides a predefined HTML insert, making it easier to customize the Promotions Annotation in the Config tab in the code editor.
Gmail Promotions Annotation
This feature is supported only for mailboxes associated with the gmail.com domain for individual users. This feature will work if the following conditions are met: - The recipient opens the message using the Gmail mobile app. - The message is delivered to the 'Promotions' tab. - Annotations will only appear for one-time emails; subsequent messages with the same subject will be grouped into a thread and may not display properly.
## Prerequisites --- - Configure a [sender account](/docs/campaign/e-mail/configuring-email-account). - The domain must have SPF, DKIM, and DMARC configured. - [Create an email etmplate](/docs/campaign/e-mail/creating-email-templates). ## Updating the template --- 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left pane, click **Templates** and search for the template you prepared as a part of prerequisites. **Result:** You are redirected to the code editor. 3. In the code editor, go to the **HTML** section and in the head section after the `` tag, add the code below:
<!--[if mso ]><style>sup, sub { font-size: 100% !important; } sup { mso-text-raise:10% } sub { mso-text-raise:-10% }</style> <![endif]-->
           <!-- Start Gmail Promo Tab annotations code -->
           <div itemscope itemtype="http://schema.org/Organization">
               <meta itemprop="name" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "Synerise Demo Shop", id: "promotion-tag__company-name", label: "Company name" !####" />
               <meta itemprop="logo" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "https://demoshop.synerise.com/media/athlete2/Demos/ca/logo-ca.png", label: "Company image", id: "promotion-tag__img-link" !####" />
           </div>

           <div itemscope itemtype="http://schema.org/EmailMessage">
               <meta itemprop="subjectLine" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "Free shipping", label: "Subject line", id: "promotion-tag__subject-line" !####" />
           </div>

           <div itemscope itemtype="http://schema.org/DiscountOffer">
               <meta itemprop="description" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "Free shiping", label: "Description", id: "promotion-tag__description" !####" />
               <meta itemprop="discountCode" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", id: "promotion-tag__code", label: "Code", defaultValue: "WELCOME20" !####" />
               <meta itemprop="availabilityStarts" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "2024-10-15T00:00:00+00:00", label: "Start date", id: "promotion-tag__start-date" !####" />
               <meta itemprop="availabilityEnds" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "2024-10-17T23:59:59+00:00", label: "End date", id: "promotion-tag__end-date" !####" />
           </div>

           <div itemscope itemtype="http://schema.org/PromotionCard">
               <meta itemprop="image" content="FILL BANNER IMG" />
           </div>
           <!-- End Gmail Promo Tab annotations code -->
This will add the following fields in the **Config** section:
The view of config form for adding Gmail Promotions Annotation
The config form for adding Gmail Promotions Annotation
### Edit the form in the Config tab The form in the Config tab is pre-filled with default values, which you can modify to suit your business needs. 1. In the **Company name** field, enter the name of your company. 2. In the **Company image** field, you can provide a link to an image. 3. In the **Subject line** field, you can type the subject you want to display. 4. In the **Description** field, you can type the text that displays with the deal badge. 5. In the **Code** field, you can type the discount or promotion code for the offer. 6. In the **Start date** field, you can type the date and time when the offer begins in [ISO 8601 format](https://support.google.com/merchants/answer/7055760). 7. In the **End date** field, you can type the end date and time of the promotion in [ISO 8601 format](https://support.google.com/merchants/answer/7055760). 8. If the template is ready, click **Save** in the upper right corner.
The view of the configured Gmail Promotions Annotation with corresponding fields from the config form
Configured Gmail Promotions Annotation with corresponding fields from the config form
## What's next --- Now you can use this template in emails you sent through the Experience Hub and Automation Hub. ## Check the use case set up on the Synerise Demo workspace --- You can check the [template configuration](https://app.synerise.com/campaigns/email/content-manager/template/153289) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Email campaigns](/docs/campaign/e-mail) - [Google's Guide](https://developers.google.com/gmail/promotab/overview) to the Gmail Promotions Annotation function # In-app abandoned cart message In-app messaging feature allows businesses to target customers who have abandoned their shopping carts, encouraging them to complete their purchases. The messaging can be personalized and triggered based on specific actions, such as how long the item has been in the cart or the customer's browsing history, increasing the chances of conversion. This can help boost revenue and improve the overall customer experience. This use case describes the process of creating a reminder that a customer did not complete a purchase and sending it through an in-app message. In this case, we assume that the customer added products to cart and hasn't finalized a purchase in the following hour. This use case provides you with an instruction how to use a ready-made in-app template that can be used 1:1 in a business scenario.
The in-app message view
## Prerequisites --- - [Implement Synerise SDK](/developers/mobile-sdk) in your mobile app. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Implement the `cart.status` event](/developers/web/cart), which stores the current status of the basket in the form of an event on the customer's card. Event has to be sent to Synerise, after every change in the cart status. - Collect [product.addToCart event](/docs/assets/events/event-definitions). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggregate) with abandoned products. 2. [Create an in-ap message](#create-an-in-app-message) with abandoned cart using the predefined template. ## Create an aggregate --- In this step, create an aggregate that will be used to display products in your in-app message. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 5. From the **Choose event** dropdown list, select the `cart.status` event. 6. As the event parameter, select **products**. 7. Set the period from which the aggregate will analyze the results to **Lifetime**. 12. Save the aggregate.
Decision Hub Last aggregate returning the products parameter of the last cart.status event over a customer's lifetime
Configuration of the aggregate
## Create an in-app message --- In this part of the process, you create an in-app campaign triggered by the `session.start` event for customers who haven't made a transaction within an hour from adding the product to cart. We will use a predefined template for the message about abandoned cart, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. In this case, the group will consist of the customers who abandoned their cart within an hour from adding the product to cart. 1. In the **Audience** section, click **Define**. 4. Click **New Audience** and then **Define conditions**. 5. Click **Add condition**, from the dropdown list, select the `product.addToCart` event. 7. Click the calendar in the right bottom of the page. 1. In the **Relative date range** section define the period from which the segmentation will return the customers. In this case, choose **Today**. 2. Click **Apply**. 8. Click **Add condition**, from the dropdown list, select the `product.addToCart` event. 9. Click **and then...**, from the dropdown list, select the `transaction.charge` event. 10. Change **Performed** to **Not performed**. 11. Click the calendar in the right bottom of the page. 1. In the **Relative date range** section define the period from which the segmentation will return the customers. In this case, choose **Today**. 2. Click **Apply**. 12. Click the clock next to the calendar. 1. Type `1` and from the dropdown list, select **Hours**.
The view of the In-app Audience configuration
In-app Audience configuration
9. Click **Apply**. 8. To save the audience, click **Apply**. ### Define content --- In this part of the process, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template. 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Abandoned cart** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add snippets](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. The fields in Config are split into two types: ones for dynamic content (related to Jinja) and ones for in-app appearance. The dynamic content fields must match the values in the catalog and the names of the attributes returned by the recommendations. The appearance fields only affect how the information presents itself in the in-app. 1. From the **Aggregate with products left in the cart** drop-down list, select the [aggregate you created in the previous step](#create-an-aggregate). You can find it by typing its name or ID in the search box. 2. In the **Header text** text box, type the header you want to display in the in-app message. 3. In the **Header description text** text box, type the header description you want to display in the in-app message. 4. In the **Name of the catalog with product information** field, change the default `Snrs-produktu-ogTag` value to the catalog name with product information. In our case, it's `store-1`. 5. In the **Name of the column with image link** field, change the default `og:image` value to the name of the column with image link in your catalog with product information. In our case, the name of the column with image link is `image`. 6. In the **Name of the column with title** field, change the default `og:title` value to the name of the column with the title in your catalog with product information. In our case, the name of the column with title is `name`. 7. In the **Name of the column with price** field, change the default `product:original_price:amount` value to the name of the column with original price in your catalog with product information. In our case, the name of the column with original price is `price`. 8. In the **Name of the column with product link** field, change the default `og:url` value to the name of the column with product link in your catalog with product information. In our case, the name of the column with product link is `productUrl`. 9. Define the colors for the following fields: **Wrapper background, Header background, Header text, Header description text, Close icon background** and **Close icon** to your needs. 10. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer.
Select a customer who has the `product.AddtoCart` event in their activity list in **Behavioral Data Hub > Profiles**.
3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the preview directly in the mobile app.
The view of the In-app preview
In-app preview
11. If the template is ready, in the upper right corner click **Save this template > Save as**. 12. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 13. To continue the process of configuring the in-app campaign, click **Next**. 14. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `session.start` event. 3. Click the **+ where** button and select `mobile`. 4. As the logical operator, select **Exists**. 5. Click **Apply**.
The view of in-app trigger event configuration
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the message to the customer a maximum of 1 time in period of 7 days.
You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general.
16. Click **Apply**.
The view of in-app schedule and display configuration
In-app schedule and display configuration
17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [Aggregate](https://app.synerise.com/analytics/aggregates/17d214c4-5644-33b1-b0c6-9fab96b26b3e) and [In-app message](https://app.synerise.com/communications/in-app/91c87167-7881-4c9d-a0a2-52d68f2dfd25) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`cart.status`](/docs/assets/events/event-reference/items#cartstatus) (~1), [`session.start`](/docs/assets/events/event-reference/web-and-app#sessionstart) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [In-app messages](/docs/campaign/in-app-messages) - [Snippets](/docs/assets/snippets) - [Mobile campaigns](/docs/campaign/Mobile) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) # ABX Test - Optimizing Discounts for Medium-Purchase-Probability Customers This ABX test is designed to help optimize discount offers for customers with low predicted purchase probability from specific category — a segment that requires more strategic effort to convert. Using our prediction model, customers are divided into three groups: - High probability to buy - Medium probability to buy - Low probability to buy Instead of offering discounts to everyone, the focus here is on the **medium-intent group**, where the real challenge lies. This segment is targeted with multiple variants of a campaign for specific product category (like electronics in our case) to determine which incentive, if any, drives the highest engagement and conversion: - 5% discount - 10% discount - 15% discount - No discount (control group) The results help you fine-tune your strategy by understanding which discount level justifies the cost of acquisition in this sensitive segment. This leads to smarter spending on incentives and a higher return on your promotional efforts. ## Prerequisites --- To implement this use case, perform the following steps in the given order: - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Prepare email templates](/docs/campaign/e-mail/creating-email-templates). - Create [voucher pools](/docs/assets/code-pools) with different discounts. In our example: 15%, 10% and 5% for `Electronics` category. ## Process --- 1. [Create a Propensity prediction](/use-cases/abx-optimize-coupon-strategy#create-a-propensity-prediction) that produces the 5-point score (results will be later grouped using 3-point score labels). 2. [Create a segmentation](/use-cases/abx-optimize-coupon-strategy#create-a-segmentation). 3. [Create a workflow](/use-cases/abx-optimize-coupon-strategy#create-a-workflow). ## Create a Propensity prediction --- In this part of the process, you will create a propensity prediction to purchase any product from the `electronics` category for the audience of recognized customers (assigned with the email attribute and with a page visit event within the last 30 days).
Synerise allows you to run the predictions also for anonymous visitors. If you need to prepare scenario for other segment - like anonymous visitors - you can define the conditions while preparing the segment.
### Select the model type 1. Go to AI Hub icon **AI Hub > (AI Predictions) Models > New prediction**. 2. On the pop-up, select the **Create from scratch** option. 3. Select **Propensity**. 4. Name your prediction. ### Select customers to be analyzed Select the audience for whom you want to prepare a prediction. 1. In the **Audience** section, click **Define**. 2. Click **Choose segmentation**. 3. On the dropdown list, click **Create new**. 4. In the **Segmentation name** field, enter a meaningful name of the segmentation. 5. Click **Next step**. 5. Click **Add condition**: 1. From the dropdown list, select the `email` attribute. 2. From the **Choose operator** dropdown list, select **String** and **Is not empty** (this operation will work on Recognized visitors only, as the email field in anonymous visitors has special handling policy). 6. Once again click **Add condition**: 1. From the dropdown list, select the `Visited page` event. 2. In the calendar in the bottom right corner, leave **Last 30 days**. 7. Save the segmentation by clicking **Create segmentation**. 8. Click **Apply**.
The view of propensity audience configuration
Propensity audience configuration
### Define the item In this section, you define the product category for which you want to calculate the prediction, in our case it's the `electronics` category. This is done by creating a filter that matches the product category in the catalog. 1. In the **Item selection** section, click **Define**. 2. Click **Choose item feed**. 3. Select the catalog that contains the items you want to make the prediction for. **Result**: The **Item filter** section appears. 4. Click **Define item filter**. 5. From the **Select value** dropdown list, select the `category` attribute. 6. As the logical operator, select **In**. 7. Click **Select value** and add `0` items. **Result**: An **Array values** pop-up appears. 8. Use the search field to add the desired product category. In our case:`root catalog> default category>electronics`. 9. Click **Add**. 10. Click **Apply**. 13. Click **Save**. 10. Save the item feed configuration by clicking **Apply**.
The view of propensity item filter configuration
Propensity item filter configuration
### Additional settings and saving Configure the [additional settings](/docs/ai-hub/predictions/propensity#additional-settings) (or leave them at default) and click **Save & Calculate**. In our case we choose the 5-point probability scale: very high, high, medium, low, very low. **Result:** After the calculation is complete a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction. Based on the `snr.propensity.score` event, you can create segmentations of customers with different propensity. ## Create a segmentation --- Based on the `snr.propensity.score` event, create a segmentation of customers with medium propensity to purchase any item from the product - `electronics` category. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 1. Click **Add condition**. 2. Select the `snr.propensity.score` event. 3. Click **+ where**. 4. As the event parameter, select `modelId` (available in the parameters of the `snr.propensity.score` event).
The wiev of properties of the snr.propenisty.score event
Properties of the snr.propenisty.score event
3. As the logical operator, select **Equal**. 4. In the text field, enter the value of the `modelId` parameter. 5. Click **+ and where**. 6. As the event parameter, select `score_label`. 7. As the logical operator, select **Equal**. 8. In the text field, enter `Medium`. 9. Set the date range according to your buisness needs. 5. Click **Save**.
For other scenarios using 5 point label scale you can group very low & low and very high & high propensity scores using `contain` operator accordingly. This way you can create 3 point label scale.
The view of segmentation configuration
Segmentation configuration
## Create a workflow --- As the final part of the process, create a workflow that sends an email with a voucher code to customers with the medium propensity to buy items from the electronics category. We will use the A/B/X tests to send the different vouchers to different groups of users. This way, we will be able to check the effectiveness of incentives of a different level. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Choose the segmentation of customers 1. As the first node of the workflow, add **Audience**. In the node settings: 1. In the **Define audience** section, select the [segmentation you created in the previous step](#create-a-segmentation), click **Apply** to confirm. 9. Confirm by clicking **Apply**. ### Add the ABx Test node --- 1. Add the **ABx Test** node. 2. Click **Add group** to create 4 groups of customers. By default, we have the group A and B with an equal 50/50 division - you can add another group here, and de-select the **Equal allocation** option if you want an unequal division. In our example, 4 groups are created. - **Group A**: 25% of the database - **Group B**: 25% of the database - **Group C**: 25% of the database - **Group D**: 25% of the database 3. Enable the **Generate a variant assignment event** option. As a result, Synerise will record which test variant a given customer was assigned to, which later allows you to analyze results and build segments based on that assignment. 4. To save your changes, click **Apply**.
`Screenshot presenting ABx Test node`
Screenshot presenting ABx Test node
### Add the Send Email node --- Add the **Send Email** node to 3 of the 4 groups in our workflow. 1. Add the **Send Email** node. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, type the **Subject** and from the **Template** dropdown, select [the template you created as part of the prerequsites](#prerequisites). In the email editor, click the Inserts button and from the dropdown list, select Pools. Find one of the [pools you created as a part of prerequisites](#prerequisites) and click it. Then copy its code and paste to the email template. 3. In the **UTM & URL parameters** section, you can define the UTM parameters added to the links included in the email. 4. In the **Additional parameters** section, you can optionally describe campaigns with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 2. Click **Apply**. 3. Repeat the all steps in the two following Send Email nodes. Change the voucher pool ID in the content of the email template. 4. Add the **End** node to the last group of customers. By doing this, you will exclude this audience segment from receiving any communications, allowing you to determine how many of them make purchases without any incentives. ### Add the finishing node and set capping --- 1. Add the **End** node after each **Send Email** node. 2. In the upper right corner, click **Set Capping** and define the limit of workflows. 3. In the upper right corner, click **Save & Run**.
`Screenshot presenting the final automation`
The final workflow
## What's next --- Once your ABX workflow is live, it’s important to go beyond campaign delivery and take a closer look at the actual effectiveness of each variant. To support this analysis, make sure you enabled the **Generate a variant assignment event** option in the ABx Test node when building the workflow. This guarantees that Synerise will generate an `automation.abTestVariantAssigned` event, for each customer who passes through this node. With these events in place, you can now build four segments representing the groups who received different incentives: - automation.abTestVariantAssigned → variantName = A (10% discount) - automation.abTestVariantAssigned → variantName = B (15% discount) - automation.abTestVariantAssigned → variantName = C (20% discount) - automation.abTestVariantAssigned → variantName = X (no discount – control group) 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. Click **Add condition**. 4. From the dropdown list, select the `automation.abTestVariantAssigned` event. 5. Add the following conditions to the event: - **diagramId** – This parameter allows you to differentiate between multiple ABX tests running in your environment. The ID is the part of the URL that comes after /automation-diagram/, for example: **ced9c208-8adb-4879-b9dd-55c7aab50872** in the URL `https://app.synerise.com/automations/workflows/automation-diagram/ced9c208-8adb-4879-b9dd-55c7aab50872`. - **variantName** – This is the actual test group the user was assigned to: A → 15% discount B → 10% discount C → 5% discount D → No discount 7. Using the date picker in the lower-right corner, set the time range based on your business needs. Confirm by clicking **Apply**. 6. Save the segmentation. 8. Create the next segmentation. Repeat the steps.
Decision Hub segmentation configuration for an ABX coupon discount strategy test
Segmentation configuration
Once you’ve created these segments, you can analyze your results. You can for example compare performance metrics such as: - Open Rate (OR) - Click-Through Rate (CTR) - Conversions (transaction.charge) etc. You can also take the analysis a step further by comparing test results across different predictive groups. For example, do users from the "Low probability" group respond better to incentives than those who were originally scored as "High probability"? This can reveal whether your discounting strategy should be personalized not only by behavior but also by predicted intent. This layered analysis will help you understand not just which discount works best overall, but which incentive works best for which type of customer — and whether offering anything at all is even necessary in certain segments. This scenario assumes using the entire audience for the campaign and analyzing the results. If we want to run an A/B test and, after a defined period, send out the discount value that brings the highest benefits, we need to reserve X% of the audience for that final send. The winning discount will be selected based on performance metrics, using a metric filter. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the following objects in the Synerise Demo workspace: - [target segmentation](https://app.synerise.com/analytics-v2/segmentations/f3e6db3b-d73d-4737-b50f-3b153b34e3df) - [prediction](https://app.synerise.com/ai-v2/predictions/roqlnshnmwob) - [final segmentation](https://app.synerise.com/analytics-v2/segmentations/8403ef59-5e32-41a1-8309-9a32eaf41f7d) - [workflow](https://app.synerise.com/automations/workflows/automation-diagram/ced9c208-8adb-4879-b9dd-55c7aab50872) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`automation.abTestVariantAssigned`](/docs/assets/events/event-reference/automation#automationabtestvariantassigned) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [ABx Test node](/docs/automation/conditions/abx-split-node) - [Automation Hub](/docs/automation) - [Predictions](/docs/ai-hub/predictions) # Rewarding customers in loyalty program for custom activities When building a loyalty program, you usually want improve customer engagement and experience, increase revenue and sales, and increase customer lifetime value. To achieve these goals, you need tools that make the whole process simple to build and attractive to the customer, so they want to feel as a part of your company. Synerise has your back. We ensure you have the best experience building loyalty scenarios, including the most flexible way to calculate and charge loyalty points. A flexible approach to collecting loyalty points allows them to be earned through interaction in the mobile app, website, and by interaction with external tools. If any machine, tool, or device can send us a custom event, we can assign points in the loyalty program without having to create advanced integrations. As an example, we consider the bottle machines of one of our clients. The company created this solution for customers to encourage them to use green solutions that help protect the environment. In this use case, we describe the process of adding points in the loyalty program for returning used bottles to the bottle machine. The bottle machine sends a custom event to Synerise, informing about the bottles' return, the number of bottles, and their description. Based on this information, Synerise assigns loyalty points for the activity to customers who have previously scanned their barcode from the app. All the collected parameters are used in the push notification sent to the customer when the bottles are returned to the bottle machine. ## Prerequisites --- - Integrate Synerise [mobile SDK](/developers/) in your mobile application. - Implement mobile pushes in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - Use [custom events](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent) to save data to customers' profiles when they perform an activity. In this particular use case: - The bottle machine reads the barcodes on the bottles. - A custom `client.returnBottles` event is sent from the machine to Synerise. - The custom event's parameters include: - the number of bottles (`productsCount`) - the customer's identifier (`custom_identify`)
The event name and parameters are examples. You can define your own names and parameters depending on your business needs.
- Create a mobile push template that will be used later in a [workflow](/use-cases/adding-points-for-custom-event#create-a-workflow). It should inform customers who use mobile app about points added for returned bottles. To do it, use `{{event.params.points}}` in code of your message. ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Create a workflow --- This use case is based on a workflow triggered by the `client.returnBottles` event. The workflow generates an event with the number of points rewarded to the specific customer for this activity and sends them a push notification with this information. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- At this stage, you should configure the conditions that trigger the workflow. Use the `client.returnBottles` event as a trigger. 1. As the first node of the workflow, add **Profile Event**. 2. From the **Choose event** dropdown menu, choose the `client.returnBottles` event. 2. Confirm by clicking **Apply**.
Automation Hub Profile Event node configured with the client.returnBottles custom event trigger
Configuration of the Profile Event node
### Define the Generate Event node --- At this stage, an event with information about the number of points added for returning bottles for specific customer will be generated. 1. As the second node of the workflow, add **Generate Event**. 2. In the **Event name**, enter the name of the event that will be generated on the customer's profile. In this case, it is `points.upcharge`. This event cause counting the points for customers.
While naming your custom event, follow the `context.action` pattern used for the default events in the application, such as `page.visit`, `product.buy`, and so on.
4. In the **Body** section, define the parameters of this event, and click **Apply**. **Example content of **Body** section:**
{
     "description": "Points for returning bottles",
     "displayHeader": "Eco - second life of your bottle",
     "points": "{{event.params.productsCount|multiply(10)|int}}"
   }
In the jinjava code presented above, `points` is the number of points added to the profile. This number is counted based on the `productsCount` from the `client.returnBottles` event, which stores the number of returned bottles. In our use case, the number of points is the number of bottles multiplied by 10.
The event body is an example. You can add more parameters or change the point calculation formula according to your business needs.
### Define the Profile Filter node --- As the next step, you should add the Profile Filter node, which checks if the customer agreed to receive notifications about the points status. 1. Add **Profile Filter** node. 2. In the settings of the node choose **Profiles > Attributes** and select the attribute that is assigned to customers who have agreed to receive push notifications. In our case it is `receive_push_messages`. 3. As the **Operator**, choose **Boolean - Is true**. 4. Click **Apply**.
Automation Hub Profile Filter node checking that receive_push_messages attribute is true for push notification consent
The Profile Filter node configuration
### Configure the Send Mobile Push node --- 1. To the **Matched** path, add a **Send Mobile Push** node. 2. In the settings of the node, choose the **Template type** of the mobile push and add the template you have prepared in the prerequisites. 2. Click **Apply**. ### Prepare the final settings --- 1. To the **Not matched** path and after **Send Mobile Push**, add **End** nodes. 2. Optionally, define **capping**. 3. Optionally, add titles to each node so the workflow will be more understandable to your colleagues. 4. Activate the workflow by clicking **Save & Run**.
Automation Hub workflow for adding loyalty points when a custom event occurs
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can also check the [workflow configuration](https://app.synerise.com/automations/automation-diagram/2e0ad164-e7c6-41a9-8e30-ae76bd44f0eb) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per profile that completes the flow: `client.returnBottles` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `points.upcharge` (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [API](/developers/api) - [Integration](/docs/automation/integration) - [Mobile campaigns](/docs/campaign/Mobile) # Promote discounted items to customers at risk of churn If your customers are at risk of churn, you can increase the probability of discounted items appearing in their recommendations. Thanks to this, they are more likely to make a purchase. This can be done by using **recommendation boosting** to promote discounted items. Boosting rules are built using the same editor as the filters, but unlike filtering, boosting does not entirely exclude items that do not meet the conditions - it only tells the AI model to assign more weight to the discount value parameter when calculating the final recommendation score (relevance to a particular customer) of an item. ## Prerequisites --- 1. **Recommended**: Become familiar with [creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) and [recommendation filters](/docs/ai-hub/recommendations-v2/recommendation-filters) (using the IQL query editor). This article does not explain every step of creating a recommendation in detail. 1. The item feed must contain information about discounts. In this example, the discount is defined as a percentage. 2. Predict churn for a group of customers. The [Predict churn](/use-cases/churn-prediction) use case includes detailed instructions. 3. Create a segmentation of customers for whom the `score-label` parameter in the `snr.prediction.score` event from the prediction was `high` or `very high`. This segment of customers will be needed to set up the boosting conditions. [Learn more about creating segmentations](/docs/analytics/segmentations/creating-segmentations). ## Creating the recommendation --- ### Choose source, type, and add slots 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. In the **Type & Items feed** section: 1. Select an item catalog. 2. Select a recommendation type.
Boosting can be used with all recommendation types.
3. Click **Apply**. 3. In the **Items** section, configure at least one slot and click **Apply**. ### Build the boosting rule in IQL query editor In this part of the process, you build the following rule: - If the customer is at risk of churn, filter the boosting to only apply to items that are discounted 10% or more. - If the customer is NOT at risk of churn, apply boosting to all items (so, effectively, no items are boosted). 1. In the **Boosting** section, click **Define**. 2. Click **Add rule**. 3. Click **Define rule** and select **IQL query**. **Result**: The IQL query editor opens. 4. Click **Select > Function**. 5. Click the added function and select **IF**. The IF function accepts three variables, from the left: the condition, the result if the condition evaluates to TRUE, and the result if the condition evaluates to FALSE. 6. Add the condition that customer must be at risk of churn: 1. Click the first **Select** node and select **Segmentation**. 2. To the right from **client.segmentations**, click the plus icon and select **Attribute**. 2. Click the **null** element that appeared. 4. From the **Property** drop-down list below the canvas, select **Segmentation**. 5. Click **Select value** and select the segmentation that includes customers at risk of churn. You can use the search field. 6. Click the plus icon between **client.segmentations** and the segmentation ID and select the **HAS** operator. 7. Add the `if TRUE` result: 1. Click the **Select** node and select **Attribute**. 2. Click the **null** element that appeared. 3. In the attribute selector below the canvas, click **Select value**. 4. Select the discount `special.price` attribute. You can use the search field. 5. To the right from the attribute node, click the plus icon and select **Number**. 6. Click the plus icon between the attribute and the number and select the **equal** operator. 7. In the input field enter `true`. 9. Click **Apply**. 10. In the **Promote/Demote** selector, select **Promote** (default value). 11. Use the slider to adjust how much you want the rule to affect the results.
Screenshot of the boosting strength slider
The boosting strength slider
12. Save the **Boosting** section settings by clicking **Apply**.
After applying the settings, you can use the **Preview** tab (available in the upper left part of the recommendation creator screen) to see how your rule changed the recommendation result. If necessary, you can return to the settings and adjust the boosting strength to meet your expectations.
Screenshot from the IQL editor: boosting rule for including items that are discounted 10% or more when the customer is at risk of churn
Boosting rule for including items that are discounted 10% or more when the customer is at risk of churn
### Additional settings and saving 1. Configure the **Additional settings** section and click **Apply**. 2. Save the recommendation. ## What's next --- You can use the ID of the recommendation and [inject it with a snippet](/docs/assets/snippets) in other types of communication, such as: - [dynamic content](/docs/campaign/dynamiccontent) - this way you can show the recommendations on your website. - [email](/docs/campaign/e-mail) - this way you can send out recommended items through emails. - mobile application - you can use [documents](/docs/assets/documents) to build your own mobile app and show the recommended items. - [mobile push](/docs/campaign/Mobile) - you can send recommendations through notifications in your mobile application. - [web push](/docs/campaign/Webpush) - this way you can send notifications to your customers through a web browser. - [SMS](/docs/campaign/SMS) - this way you can reach your customers with recommendations on their mobile. ## Check the use case set up on the Synerise Demo workspace --- You can find the analyses created in this use case in our Synerise Demo workspace at the following links: - [Propensity prediction](https://app.synerise.com/ai-v2/recommendations/W2JGxpllqirV) - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/9ec901b4-2ea0-47dc-9285-023d2000e8cf) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Recommendations](/docs/ai-hub/recommendations-v2) # Send a message encouraging replenishment on WhatsApp WhatsApp is a trusted platform by millions of users worldwide, making it a valuable channel for customer communication. It's a channel where you can get closer to your customers by forming personalized communication with them, building a stronger bond with your brand, and increasing loyalty. Thanks to Synerise's integration with WhatsApp, you have unlimited possibilities to customize your communication with customers. You can take advantage of all the insights you collect in Synerise and use them effectively to deliver the greatest value to your customers. This use case shows a scenario with a replenishment campaign. You will learn how to perform a simple integration with WhatsApp to send a personalized message to customers encouraging them to reorder a product from a specific category, additionally incentivizing the reorder by giving them a discount code for that purchase.
WhatsApp replenishment campaign
## Prerequisites --- - Make sure you meet all [prerequisites](/docs/automation/integration/whats-app/send-template-message#prerequisites) to work with the **Send Template Message** node. - Implement transaction events either through [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Create [item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) - Create a [voucher pool](/docs/assets/code-pools). The ID of this voucher pool will be used as a dynamic value during the message creation process, allowing discount codes to be assigned to each customer participating in this scenario. ## Process --- 1. [Create an aggregate](/use-cases/send-replenishment-message-on-whats-app#create-an-aggregate) which returns the SKU of the last purchased product from the specified category. 2. [Create a message template in the Meta portal](/use-cases/send-replenishment-message-on-whats-app#create-a-message-template-in-the-meta-portal) 3. [Create a workflow to send a message to customers on WhatsApp](/use-cases/send-replenishment-message-on-whats-app#create-a-workflow-to-send-message-to-customers-on-whatsapp) ## Create an aggregate --- In this part of the process, create an aggregate that returns the SKU of the last purchased product from the `Coffee` category. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown list, select the `product.buy` event. 4. As the event parameter, select **$sku**. 5. Next to the **$sku**, click **+where**. 6. From the dropdown list, select **$category**. 7. As the operator, choose **Equal**. 9. In the text field, enter the value of the category you want to use in replenishment campaign - in this use case, it will be `Coffee`. 8. Define the period analyzed in the aggregate. 9. Save the aggregate.
Decision Hub Last aggregate returning the SKU of the last Coffee category product.buy event
Configuration of the aggregate
## Create a message template in the Meta portal --- Create a message template in the Meta portal that you will use in the next part of the process. In the body of the message, mark places where the dynamic elements will be added. In addition, if you would like to add a CTA at the end of the message, you can add a button and define its copy. The page to which the customer will be redirected after clicking the button can be defined in Synerise. The example message used in this use case: `Hello {{1}}, it looks like you’re almost out of Coffee! Make an order for {{2}} now before it’s too late. Use the {{3}} code to get your 20% discount on your next purchase.` Where `{{1}}, {{2}}` and `{{3}}` are markers that will be replaced with the dynamic values. This step will be done in Synerise. The screen below shows an example of creating a template message in the Meta portal:
An example of body section configuration in Meta platform
An example of body section configuration in Meta platform
In the following screen, you can see how a button can be defined in the Meta portal:
An example of button section configuration in Meta platform
An example of button section configuration in Meta platform
## Create a workflow to send message to customers on WhatsApp --- The workflow will be triggered by the `product.buy` event from the selected product category. The delay is defined up to 30 days. If a customer does not make another purchase from the defined category after that period, we will send a WhatsApp message with the recommended products from the defined category. 1. In Synerise, go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node 3. As the trigger node, add **Profile Event**. In the configuration of the node, select the event that triggers the workflow. In this use case, it's a `product.buy` event. 4. Click **+ where** and choose **$category**. 5. As the logical operator, select **Equal**. 6. In the text field, enter `Coffee`. 4. Confirm by clicking **Apply**.
Automation Hub Profile Event node configured with product.buy event filtered by Coffee category
Configuration of the Profile Event node
### Configure the Delay node 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `30`. 2. From the dropdown list, choose **Day**. 2. Click **Apply**. ### Define the profile filter node As the next node, choose **Profile Filter** to check if customers have bought a product from the Coffee category during last 30 days. To do this: 1. Choose the `product.buy` event. 2. As the parameter, choose **$category**. 5. As the logical operator, select **Equal**. 6. In the text field, enter `Coffee`. 3. Set the time range to last 30 days. 4. Click **Apply**. 7. To the **Matched** path, add the **End** node.
Configuration of the Profile Filter node
Configuration of the Profile Filter node
### Define the Send Template Mesage node 8. To the **Not matched** path, add the WhatsApp **Send Template Message** node. 1. Click **Select connection**. 2. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/whats-app/send-template-message#create-a-connection). - If you selected an existing connection, proceed to defining the integration settings. 3. In the **Sender ID** field, enter the phone number ID from which the message will be sent. [You can find more information about phone number ID here](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started/add-a-phone-number). 4. In the **Receiver** field, enter the phone number of the customer who will receive this message. We recommend using the `{% customer phone %}` insert, which inserts the phone number of an individual customer who goes through this node. 5. In the **Message template** field, enter the name of the [message template](/use-cases/send-replenishment-message-on-whats-app#create-a-message-template-in-the-meta-portal) you created earlier in the Meta portal. 6. From the **Language code** dropdown list, select the language used in the message. 7. In the **Message components** field, insert the object that contains the dynamic values in the order defined in the message template. The example of object used in this use case:
The aggregate and voucher pool IDs are used as examples for the purpose of this use case.
[
     {
            "type": "body",
            "parameters": [
            {
                "type": "text",
                "text": "{% customer firstname %}"
            },
            {
                "type": "text",
                "text": "{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalog.store-1(item).name %}{% endfor %}{% endaggregate %}"
            },
            {
                "type": "text",
                "text": "{% voucher %} 8c3c8fd3-e7e9-487d-ba89-0b7824f65f33 {% endvoucher %}"
            }
        ]
    }, 
    { 
        "type": "button", 
        "parameters":
        "index": "0",
        "sub_type": "url", [
            {
                "type": "url",
                "text": "{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalogvar.store-1(item).url %}{{ catalog_result|replace('https://yourshop.com', '') }}{% endcatalogvar %}{% endfor %}{% endaggregate %}" 
            }
        ]
    },
    { 
        "type": "header",
        "parameters": [ 
            {
                 "type": "image",
                 "image": {
                      "link": "{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalogvar.store-1(item).image %}{{ catalog_result }}{% endcatalogvar %}{% endfor %}{% endaggregate %}"
                 }
             }
         ]
     }
   ]
9. Click **Apply**. The following table explains all the inserts used in the body, button and header sections shown above. | Section | Insert value | Insert explanation | |---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | body | `{% customer firstname %}` | The value of this insert is used as the value of `{{1}}`, so the name of a customer can be displayed in the message. | | body | `{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %} {% for item in aggregate_result %} {% catalog.store-1(item).name %} {% endfor %} {% endaggregate %}` | The value of this insert is used as the value of `{{2}}` to return a product that the customer bought the last time and did not purchase again within the estimated time period. | | body | `{% voucher %} 8c3c8fd3-e7e9-487d-ba89-0b7824f65f33 {% endvoucher %}` | The value of this insert is used as the value of `{{3}}`. In this example, we assign a voucher code from the voucher pool to an individual customer. | | button | `{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalogvar.store-1(item).url %}{{ catalog_result\|replace('https://yourshop.com', '') }}{% endcatalogvar %}{% endfor %}{% endaggregate %}` | The value of this insert is used to return product url. Here we specify the URL omitting the domain, because we define the domain in the Meta platform, as you can see in the screenshot with the [button creation](/use-cases/send-replenishment-message-on-whats-app#create-a-message-template-in-the-meta-portal). | | header | `{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalogvar.store-1(item).image %}{{ catalog_result }}{% endcatalogvar %}{% endfor %}{% endaggregate %}` | This value of insert is used to return the url to the product image in header. |
Automation Hub workflow for sending a replenishment WhatsApp message
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [aggregate](https://app.synerise.com/analytics/aggregates/c37acfe7-08a1-345c-a3e7-da795bb6a326) and the [workflow](https://app.synerise.com/automations/automation-diagram/998f1dc1-932d-4636-bb98-d1d823b00af6) directly in our Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1), [`whatsapp.sendTemplateMessage`](/docs/assets/events/event-reference/integration#whatsappsendtemplatemessage) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Recommendations](/docs/ai-hub/recommendations-v2) - [WhatsApp **Send Template Message** node](/docs/automation/integration/whats-app/send-template-message) # Identify top-converting search products Knowing which products convert best after being found through search is normally the result of stacking several analytical objects on top of each other: a report, built on a metric, built on an aggregate, and so on. Configuring each of these layers correctly means choosing, among other things, the right time range, the right event, and the right occurrence setting. With the System Agent, this same analysis can be requested in a single, plain-language prompt. The agent has access to the workspace's own behavioral data – events, aggregates, metrics, and reports – and builds the underlying logic itself, instead of requiring it to be assembled manually in the interface. In this use case, we use a single prompt to identify the products with the strongest post-search click-to-purchase performance over the last 30 days. The result can then be used as a benchmark for a more targeted analysis of what drives a specific product's search performance.
System Agent chat panel showing a question about top-converting search products and a ranked results table with search clicks, purchases, and click-to-purchase rate
## Prerequisites --- - [Prepare an item feed](/docs/ai-hub/item-feed/google-merchant-feed). - [Enable AI Search](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search#enabling-ai-search-for-the-feed) for the selected feed. - Implement the `item.search.click` event, which is required to measure AI Search performance. See [Introduction to AI Search](/docs/ai-hub/ai-search/introduction-to-ai-search). - The System Agent enabled and available for your workspace, with the **Workspace resources** access level selected in the [System Agent settings](/docs/settings/agentic-ai/system-agent). See [System Agent](/docs/ai-hub/synerise-system-agent). ## Process --- In this use case, you will go through the following steps: 1. [Ask the agent for the analysis](/use-cases/ai-agent-search-conversion#ask-the-agent-for-the-analysis) by describing it in plain language in the agent's chat panel. 2. [Review the results](/use-cases/ai-agent-search-conversion#review-the-results) returned by the agent. ## Ask the agent for the analysis --- In this part of the process, describe the analysis you need directly in the agent's chat panel. 1. Click **System Agent** in the top navigation bar, available from anywhere in the workspace. 2. In the chat panel, describe the analysis you need. For example: > Identify the 5 products with the highest post-search click-to-purchase rate based on units sold. Consider only transactions made in the last 30 days and include only cases where the purchase occurred within 24 hours of the product click that followed the search. In the results, give me the product SKU, name, search clicks, attributed purchased quantity, conversion and attributed revenue.
The more explicit the prompt is about the time range, the attribution window between a search click and a purchase, and what should count as a conversion, the more reproducible the result is, and the easier it is for other people on the team to understand exactly what the numbers mean.
3. Send the prompt.
System Agent chat panel showing the prompt
System Agent chat panel with the prompt
## Review the results ---
System Agent chat panel showing the resulting ranked table of top-converting search products
System Agent chat panel with the answer
The agent first confirms how it interpreted the request – which events it used, which attribution window it applied, and how it defined conversion – before returning a ranked table with the product SKU, name, search clicks, attributed purchased quantity, conversion rate, and attributed revenue for each of the top products. For example, the agent may report that it matched `item.search.click` events to `product.buy` events of the same SKU within a 24-hour window, limited to the last 30 days, and calculated conversion as attributed purchased quantity divided by search clicks. This makes the result auditable: anyone reviewing it can confirm that the agent used the exact logic requested in the prompt, without needing to re-check any configuration manually. The ranking separates two things that are easy to confuse: - **Volume** – how many search clicks a product receives. - **Efficiency** – how well those clicks translate into purchases within the defined window (conversion rate). In this ranking, Upshape - Kojiro Skate Shoes (SKU 834620) has the highest click-to-purchase rate at 29.00%, with 29 attributed units out of 100 search clicks. It is a good example of a smaller-volume, high-efficiency product: it received fewer search clicks than any other product in the top 5, but converted them at nearly 1.5 times the rate of the next-best result. A product with a high click volume but a low conversion rate may point to a search ranking, placement, or presentation issue. A product with a smaller number of clicks but a high conversion rate is a good candidate to use as a benchmark for understanding what is driving strong post-search performance. ## What's next --- The best-converting product identified here can be used as the starting point for a follow-up analysis that looks specifically at that product's search behavior – its average position in search results, click position, conversion rate, revenue attributed to search, and which query rules are contributing to its performance. ## Read more --- - [System Agent](/docs/ai-hub/synerise-system-agent) - [Introduction to AI Search](/docs/ai-hub/ai-search/introduction-to-ai-search) - [Previewing AI Search results](/docs/ai-hub/ai-search/previewing-search-engine-results) # Managing campaigns with priorities and weekly contact limit When multiple campaigns are running within a single week, a customer may qualify for more than the desired number of messages. Without proper control, this leads to over-communication and a poor customer experience. This use case describes how to orchestrate five weekly campaigns across three priority levels while enforcing a maximum of three messages per customer per week. The mechanism ensures that the highest-priority campaigns are always delivered first (as long as the weekly limit allows), and lower-priority campaigns only go out if the weekly contact limit has not yet been reached.
The example in this use case uses five campaigns and a limit of three messages per week, but both values are fully configurable. You can adjust the number of campaigns, priority levels, and the weekly cap to match your business needs. This use case focuses on the **mobile push** channel, but the same logic and architecture can be applied to other communication channels such as email, SMS, or web push.
The key principles of this approach are: - Each campaign has an assigned priority level (high, medium, or low). - Each campaign has a specific scheduled send date and time within the week. - The system runs cyclically (every hour) and checks whether the current moment matches a campaign's planned send time. - Before sending, the system verifies how many messages the customer has already received and how many higher-priority campaigns the customer still qualifies for. - Once the weekly limit is reached, all remaining campaigns are blocked for that customer. This approach separates the scheduling logic (when a campaign should go out) from the priority logic (which campaigns are most important), and combines both with a hard weekly cap. ## Prerequisites --- - Implement [tracking code](/docs/settings/tool/tracking_codes) on your website. - Implement [Synerise SDK in your mobile app](/developers/mobile-sdk). - Configure [mobile push](/docs/campaign/Mobile) as a communication channel. - Define the criteria used to qualify customers for each campaign. These can be based on behavioral events, customer attributes, segmentation rules, or any combination of conditions available in Synerise. The first step of this process involves [creating segmentations](#create-individual-campaign-segmentations) that define the audience for each campaign. - Create a mobile push template that will be used later in workflows. ## Process --- In this use case, you will go through the following steps: 1. [Create individual campaign segmentations](#create-individual-campaign-segmentations) — one per campaign, defining who qualifies. 2. [Create expressions](#create-expressions) — for current timestamp comparison and counting higher-priority campaign eligibility. 3. [Create workflows](#create-workflows) — one per priority group, running cyclically and sending mobile pushes when conditions are met. These must be created before aggregates so that you have the diagram IDs needed in the next step. 4. [Create aggregates for counting sent pushes](#create-aggregates-for-counting-sent-pushes) — to track how many messages each customer has already received per priority level and in total. 5. [Create priority-level segmentations with split audience](#create-priority-level-segmentations-with-split-audience) — one per priority group, combining campaign eligibility, send-time matching, and contact-limit checks. ## Create individual campaign segmentations --- Create five separate segmentations, one for each campaign planned for the week. Each segmentation defines the audience that qualifies for a given campaign. The conditions can be based on any criteria available in Synerise — behavioral events, customer attributes, transactional data, or other segmentation rules. In this example, the five campaigns and their priority assignments are: - **Campaign A** (high priority): customers who recently made a high-value purchase (for example, order total above 500) — targeting premium buyers with an exclusive loyalty offer - **Campaign B** (high priority): customers who abandoned their cart in the last 7 days — a recovery campaign with a time-limited discount - **Campaign C** (medium priority): customers who browsed a specific product category more than 3 times without purchasing — a nudge campaign with personalized recommendations - **Campaign D** (medium priority): customers who haven't made a purchase in the last 30 days but were active on the website — a re-engagement campaign - **Campaign E** (low priority): customers who signed up for the newsletter in the last 14 days — a welcome series follow-up The priority labels used throughout this use case are: **high** (priority 1), **medium** (priority 2), and **low** (priority 3).
The segmentation conditions and business scenarios presented here are only illustrative examples. In practice, they can be freely defined and adjusted based on user behavior, available data, and any additional parameters relevant to your setup. You can tailor these conditions to reflect your specific business logic, campaign goals, and communication strategy. The number of values returned by expressions (for example, 0, 1, or 2 for a two-campaign priority level) is specific to this example and depends on how many campaigns you assign to each priority level in your setup.
### Create Campaign A segmentation 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation, for example `Campaign A - high priority`. 3. Click **Add condition**. 4. From the dropdown list, select the `transaction.charge` event. 5. Click the **+ where** button, from the **Choose parameter** dropdown menu, choose `$totalAmount`. 6. From the **Choose operator** dropdown, choose **More than**. 7. In the next field, type the value `500`. 8. Using the date picker in the lower-right corner, set the time range to **Last 30 days**. Confirm by clicking **Apply**. 9. Save the segmentation.
Configuration of the Campaign A segmentation with the transaction.charge event and $totalAmount parameter
Configuration of the Campaign A segmentation
### Create Campaign B segmentation 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation, for example `Campaign B - high priority`. 3. Click **Add condition**. 4. Define the conditions that identify customers who qualify for this campaign (for example, customers who performed the `product.addToCart` event but did not complete a purchase within the last 7 days). 5. Using the date picker in the lower-right corner, set the appropriate time range. Confirm by clicking **Apply**. 6. Save the segmentation. ### Create Campaign C segmentation 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation, for example `Campaign C - medium priority`. 3. Click **Add condition**. 4. Define the conditions that identify customers who qualify for this campaign (for example, customers who visited a specific product category page more than 3 times without purchasing). 5. Using the date picker in the lower-right corner, set the appropriate time range. Confirm by clicking **Apply**. 6. Save the segmentation. ### Create Campaign D segmentation 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation, for example `Campaign D - medium priority`. 3. Click **Add condition**. 4. Define the conditions that identify customers who qualify for this campaign (for example, customers who were active on the website but haven't purchased in the last 30 days). 5. Using the date picker in the lower-right corner, set the appropriate time range. Confirm by clicking **Apply**. 6. Save the segmentation. ### Create Campaign E segmentation 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation, for example `Campaign E - low priority`. 3. Click **Add condition**. 4. Define the conditions that identify customers who qualify for this campaign (for example, customers who signed up for the newsletter in the last 14 days). 5. Using the date picker in the lower-right corner, set the appropriate time range. Confirm by clicking **Apply**. 6. Save the segmentation. ## Create expressions --- Expressions are central to this use case. They provide real-time computed values used inside segmentation conditions. You will create the following expressions: - **Current timestamp expression** — returns the current date and hour so the system can match it against each campaign's planned send time. - **High priority campaign count expression** — counts how many high priority campaigns the customer qualifies for (used in medium priority segmentations). - **Medium priority campaign count expression** — counts how many medium priority campaigns the customer qualifies for. - **Combined high + medium priority campaign count expression** — sums the two above expressions (used in low priority segmentations). ### Create the current timestamp expression --- This expression returns the current date and hour in the format `yyyy-mm-ddThh`, which allows the system to compare the current moment against each campaign's scheduled send time. The first 13 characters of the timestamp are used so that when the workflow runs every hour, it matches exactly the planned send hour. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name, for example `Now (yyyy-mm-dd hh)`. 3. Set the expression type to **Attribute**. 4. In the **Formula definition** section, build the formula using the `Regexp` function. 5. Then add function `Now`. 6. Add the `Constant` pattern to extract the first 13 characters of the current timestamp, adding it as the value: `^.{13}`. 7. Save the expression.
Configuration of the current timestamp expression with Regexp and Now functions
Configuration of the current timestamp expression
The regular expression pattern `^.{13}` extracts the first 13 characters of the current timestamp, which corresponds to the date and hour portion (for example, `2026-04-30T08`). This expression is shared across all segmentation conditions and ensures that each segment (group within a segmentation) only returns customers at the exact planned hour of a campaign's send time. Every segmentation references this same expression, which means that it acts as an alternative schedule — the segmentation only becomes active when the current timestamp matches the planned send date and hour.
### Create the high priority campaign count expression --- This expression calculates how many high priority campaigns the customer qualifies for. It checks whether the customer belongs to the Campaign A segmentation and the Campaign B segmentation, and sums the results. The output for this specific case is a number (0, 1, or 2) representing the potential number of high priority messages the customer may receive. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name, for example `How many high priority campaigns user qualifies for`. 3. Set the expression type to **Attribute**. 4. Build the formula to check membership in the [Campaign A](#create-campaign-a-segmentation) and [Campaign B](#create-campaign-b-segmentation) segmentations and return the sum. 5. Save the expression.
Configuration of the expression counting high priority campaign eligibility
Configuration of the high priority campaign count expression
### Create the medium priority campaign count expression --- This expression calculates how many medium priority campaigns the customer qualifies for. It checks whether the customer belongs to the Campaign C segmentation and the Campaign D segmentation, and sums the results. The output for this specific case is a number (0, 1, or 2) representing the potential number of medium priority messages the customer may receive. 1. Go to Behavioral Data Hub icon**Behavioral Data Hub > Expressions > New expression**. 2. Enter the name, for example `How many medium priority campaigns user qualifies for`. 3. Set the expression type to **Attribute**. 4. Build the formula to check membership in the [Campaign C](#create-campaign-c-segmentation) and [Campaign D](#create-campaign-d-segmentation) segmentations and return the sum. Build it in the same way as the [previous expression](#create-the-high-priority-campaign-count-expression), replacing the high priority segmentations with medium priority ones. 5. Save the expression.
Configuration of the expression counting medium priority campaign eligibility
Configuration of the medium priority campaign count expression
### Create the combined high and medium priority campaign count expression --- This expression calculates how many campaigns the customer qualifies for across both high and medium priority levels. It sums the results of the [high priority campaign count expression](#create-the-high-priority-campaign-count-expression) and the [medium priority campaign count expression](#create-the-medium-priority-campaign-count-expression). The output is used in low priority segmentations to determine the remaining contact slots. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name, for example `How many high + medium priority campaigns user qualifies for`. 3. Set the expression type to **Attribute**. 4. Build the formula as a sum of the two previously created expressions: the high priority campaign count expression and the medium priority campaign count expression, as presented on the screen below. 5. Save the expression.
Configuration of the expression counting high + medium priority campaign eligibility
Configuration of the combined high + medium priority campaign count expression
## Create workflows --- Create three workflows — one for each priority level. Each workflow uses the corresponding split audience segmentation (which you will create in a [later step](#create-priority-level-segmentations-with-split-audience)) and runs cyclically every hour. When the current hour matches a campaign's scheduled send time and all conditions are met, the mobile push is sent.
Workflows must be created **before** the [aggregates](#create-aggregates-for-counting-sent-pushes) because the aggregates need the diagram IDs of these workflows to correctly scope the push count. At this stage, create each workflow with its schedule and structure (Audience node, Send Mobile Push nodes, and End nodes). You can leave the split audience segmentation reference empty or use a placeholder — you will update it after creating the [priority-level segmentations with split audience](#create-priority-level-segmentations-with-split-audience) in a later step. After saving each workflow, note the **diagram ID** from the workflow URL (the part after `/automation-diagram/`). You will need these IDs in the next step when configuring the aggregates.
### Create the workflow for high priority campaigns --- 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow, for example `Split audience - high priority`. #### Define the Audience trigger node 1. Start the workflow with the **Audience** node. In the configuration: 1. Set the **Action limit** to `1` times per workflow. 2. In the **Schedule** section, select **Repeat runs**. 3. Select the timezone, for example `Europe/Warsaw (Central European Standard Time) UTC+01:00`. 4. Set the interval type to **Interval**. 5. Set the interval to `1 Hour`. 6. Set the **Begin at** date to the start of the campaign week. 7. In the **Audience** section, select **Split audience**. 8. Select the `Split audience - high priority` segmentation (you will create this segmentation in a [later step](#create-the-high-priority-split-audience-segmentation) — for now, you can leave this field empty or use a placeholder and update it later). 9. Map **Segment A** to **Path A** (Campaign A). 10. Map **Segment B** to **Path B** (Campaign B). 2. Click **Apply**. #### Configure Path A (Campaign A) 1. On Path A (Segment A), add the **Send Mobile Push** node. 2. Configure the mobile push message content for Campaign A according to your business needs. 3. Add the **End** node after the Send Mobile Push node. #### Configure Path B (Campaign B) 1. On Path B (Segment B), add the **Send Mobile Push** node. 2. Configure the mobile push message content for Campaign B. 3. Add the **End** node. 4. In the upper right corner, click **Save & Run**.
The complete high priority workflow with two paths for Campaign A and Campaign B
The complete high priority workflow configuration
### Create the workflow for medium priority campaigns --- 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name, for example `Split audience - medium priority`. 3. Configure the **Audience** node with the same settings as the high priority workflow: - Action limit: `1` - Repeat runs at an interval of `1 Hour` - Begin at: the start of the campaign week - Split audience using the `Split audience - medium priority` segmentation (to be created in a [later step](#create-the-medium-priority-split-audience-segmentation)) - Map Segment C → Path A, Segment D → Path B 4. On each path, add a **Send Mobile Push** node followed by an **End** node. 5. Click **Save & Run**.
The complete medium priority workflow with two paths for Campaign C and Campaign D
The complete medium priority workflow configuration
### Create the workflow for low priority campaigns --- 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name, for example `Split audience - low priority`. 3. Configure the **Audience** node with the same settings: - Action limit: `1` - Repeat runs at an interval of `1 Hour` - Begin at: the start of the campaign week - Select the `Split audience - low priority` segmentation (to be created in a [later step](#create-the-low-priority-split-audience-segmentation)) 4. Add a **Send Mobile Push** node followed by an **End** node. 5. Click **Save & Run**.
The complete low priority workflow with one active path for Campaign E
The complete low priority workflow configuration
The automation runs every hour and checks the segmentation conditions at each iteration. Since the `Now (yyyy-mm-dd hh)` expression is compared against the planned send timestamp, the segment will only return customers at the exact hour the campaign is scheduled. At all other hours, the segment will be empty and no messages will be sent.
## Create aggregates for counting sent pushes --- To enforce the weekly contact limit, you need aggregates that count how many push notifications have already been sent to each customer. You will create three aggregates — one scoped to the high priority workflow, one scoped to the medium priority workflow, and one that counts all pushes sent across all campaign workflows. Each aggregate is based on the `push.send` event and uses the `diagramId` parameter to scope the count to the relevant workflow. The `diagramId` is the unique identifier of a workflow and can be found in the URL when viewing the workflow in the Automation Hub (the part of the URL that comes after `/automation-diagram/`).
This step requires the diagram IDs of the workflows you created in the [previous step](#create-workflows). If you haven't noted them yet, open each workflow in the Automation Hub and copy the ID from the URL.
### Create the aggregate for high priority sent pushes --- This aggregate counts how many push notifications were sent to a customer from the high priority workflow. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Number of sent pushes - high priority`. 4. Click **Analyze profiles by** and select **Count**. 5. From the **Choose event** dropdown list, select the `push.send` event. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select **diagramId**. 8. From the **Choose operator** dropdown list, select **Equal**. 9. In the value field, enter the diagram ID of the high priority workflow (for example, `71526b66-51e1-47b8-9ecb-6cc61f821dec`). You can find this ID in the URL of the workflow in the Automation Hub. 10. Define the period to **Last 30 days**. 11. Save the aggregate.
Configuration of the aggregate counting sent pushes for the high priority workflow
Configuration of the aggregate counting sent pushes for the high priority workflow
The time range of **Last 30 days** is intentionally set broader than the actual campaign week to ensure coverage regardless of which day the aggregate is evaluated. Since the workflow and segmentations are designed to operate within a single week, the aggregate will in practice only count pushes sent during that week. A broader time range provides a safety margin without affecting the logic.
### Create the aggregate for medium priority sent pushes --- This aggregate counts how many push notifications were sent to a customer from the medium priority workflow. The configuration is identical to the high priority aggregate, but uses the diagram ID of the medium priority workflow. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Number of sent pushes - medium priority`. 4. Click **Analyze profiles by** and select **Count**. 5. From the **Choose event** dropdown list, select the `push.send` event. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select **diagramId**. 8. From the **Choose operator** dropdown list, select **Equal**. 9. In the value field, enter the diagram ID of the medium priority workflow. 10. Define the period to **Last 30 days**. 11. Save the aggregate. ### Create the aggregate for all sent pushes --- This aggregate counts how many push notifications were sent to a customer across all campaign workflows combined. Unlike the per-priority aggregates, this one uses the **In array** operator to match against the diagram IDs of all three priority workflows at once. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `Number of sent pushes - all`. 4. Click **Analyze profiles by** and select **Count**. 5. From the **Choose event** dropdown list, select the `push.send` event. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select **diagramId**. 8. From the **Choose operator** dropdown list, select **In array**. 9. In the value field, enter the diagram IDs of all three priority workflows (the high priority workflow ID, the medium priority workflow ID, and the low priority workflow ID). 10. Define the period to **Last 30 days**. 11. Save the aggregate.
Configuration of the aggregate counting all sent pushes across campaign workflows
Configuration of the aggregate counting all sent pushes across all campaign workflows
The `push.send` event is automatically generated by Synerise when a mobile push notification is sent through a workflow. The `diagramId` parameter identifies the specific workflow (diagram) that triggered the send.
## Create priority-level segmentations with split audience --- Create three segmentations — one per priority level — that combine campaign eligibility, scheduled send-time matching, and weekly contact-limit enforcement. Each segmentation uses the **split audience** feature to create separate segments (groups within a segmentation) for each campaign within the priority level.
Within a single priority level, only **one campaign can be scheduled per hour**. The split audience mechanism processes segments sequentially — if two campaigns within the same priority are scheduled for the same hour, only the first segment will be processed. For example, if Campaign A and Campaign B are both high priority, Campaign A could be scheduled for 10:00 and Campaign B no earlier than 11:00.
In the examples below, all campaigns are planned within a single week (Monday through Friday). The specific dates used here are illustrative — adjust them to match your actual campaign week.
Each split audience segmentation groups campaigns by priority level, not by campaign name. This means that the segments within each segmentation are labeled sequentially (Segment A, Segment B, etc.) and correspond to the campaigns assigned to that priority level. For example, in the high priority segmentation, Segment A corresponds to Campaign A and Segment B to Campaign B. In the medium priority segmentation, Segment A corresponds to Campaign C and Segment B to Campaign D. In the low priority segmentation, Segment A corresponds to Campaign E. The segment labels (A, B) are internal to each segmentation and reset for each priority level.
### Create the high priority split audience segmentation --- This segmentation contains two segments — one for Campaign A and one for Campaign B. Since high priority is the highest level, these campaigns are sent as long as the scheduled time matches and the weekly limit has not been exceeded. No checks against higher-priority campaigns are needed. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name, for example `Split audience - high priority`. #### Configure Segment A (Campaign A) 3. In the first segment, add the following conditions connected by the **AND** operator: 1. **Condition A** — Has property: `Campaign A - high priority` segmentation **Is true**. This checks if the customer qualifies for Campaign A. 2. **Condition B** — Has property: `Now (yyyy-mm-dd hh)` expression **Contain** the value representing Campaign A's planned send date and hour (for example, `2026-04-15T10`). This ensures the campaign only triggers at the exact scheduled hour. 3. **Condition C** — Has property: `Number of sent pushes - high priority` aggregate **Less than** `3`. This enforces the weekly contact limit within the high priority workflow. 4. **Condition D** — Has property: `Number of sent pushes - all` aggregate **Less than** `3`. This enforces the overall weekly contact limit. 4. Click **Apply**. #### Configure Segment B (Campaign B) 5. Click **Add segment** and add the following conditions connected by the **AND** operator: 1. **Condition A** — Has property: `Campaign B - high priority` segmentation **Is true**. 2. **Condition B** — Has property: `Now (yyyy-mm-dd hh)` expression **Contain** the value representing Campaign B's planned send date and hour (for example, `2026-04-16T10`). 3. **Condition C** — Has property: `Number of sent pushes - all` aggregate **Less than** `3`. 4. **Condition D** — Has property: `Number of sent pushes - high priority` aggregate **Less than** `3`. 6. Save the segmentation.
Configuration of segments in the high priority split audience segmentation
Configuration of segments in the high priority split audience segmentation
After saving this segmentation, go back to the [high priority workflow](#create-the-workflow-for-high-priority-campaigns) and update the Audience node to reference this segmentation. Do the same for the medium and low priority workflows after creating their respective segmentations.
### Create the medium priority split audience segmentation --- This segmentation contains two segments — one for Campaign C and one for Campaign D. In addition to the send-time and contact-limit checks, each segment includes a condition that verifies how many high priority campaigns the customer qualifies for. This prevents medium priority campaigns from consuming contact slots that should be reserved for higher-priority ones. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name, for example `Split audience - medium priority`. #### Configure Segment A (Campaign C) 3. In the first segment, add the following conditions connected by the **AND** operator: 1. **Condition A** — Has property: `Campaign C - medium priority` segmentation **Is true**. 2. **Condition B** — Has property: `Now (yyyy-mm-dd hh)` expression **Contain** the value representing Campaign C's planned send date and hour (for example, `2026-04-13T09`). 3. **Condition C** — Has property: `Number of sent pushes - all` aggregate **Less than** `3`. 4. **Condition D** — Has property: `How many high priority campaigns user qualifies for` expression **Less than** `3`. This ensures that the total number of potential high priority sends plus this send would not exceed the weekly limit. 5. **Condition E** — Has property: `Number of sent pushes - high priority` aggregate **Less than** `3`. 4. Click **Apply**. #### Configure Segment B (Campaign D) 5. Click **Add segment** and add the following conditions connected by the **AND** operator: 1. **Condition A** — Has property: `Campaign D - medium priority` segmentation **Is true**. 2. **Condition B** — Has property: `Now (yyyy-mm-dd hh)` expression **Contain** the value representing Campaign D's planned send date and hour (for example, `2026-04-13T14`). 3. **Condition C** — Has property: `Number of sent pushes - all` aggregate **Less than** `3`. 4. **Condition D** — Has property: `How many high priority campaigns user qualifies for` expression **Less than** `3`. 5. **Condition E** — Has property: `Number of sent pushes - high priority` aggregate **Less than** `3`. 6. Save the segmentation.
Configuration of segments in the medium priority split audience segmentation
Configuration of segments in the medium priority split audience segmentation
### Create the low priority split audience segmentation --- This segmentation contains one segment for Campaign E. It includes the broadest set of checks — verifying the weekly limit and counting how many campaigns the customer qualifies for across both high and medium priority levels. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name, for example `Split audience - low priority`. #### Configure Segment A (Campaign E) 3. In the first segment, add the following conditions connected by the **AND** operator: 1. **Condition A** — Has property: `Campaign E - low priority` segmentation **Is true**. 2. **Condition B** — Has property: `Now (yyyy-mm-dd hh)` expression **Contain** the value representing Campaign E's planned send date and hour (for example, `2026-04-14T10`). 3. **Condition C** — Has property: `Number of sent pushes - all` aggregate **Less than** `3`. 4. **Condition D** — Has property: `How many high + medium priority campaigns user qualifies for` expression **Less than** `3`. This ensures that the combined potential sends from higher priorities plus this send would not exceed the weekly limit. 4. Save the segmentation.
Configuration of the segment in the low priority split audience segmentation
Configuration of the segment in the low priority split audience segmentation
## How the priority logic works in practice --- Consider the following example scenario where high priority campaigns are scheduled **later** in the week than medium and low priority ones. This demonstrates how the slot reservation mechanism ensures that lower-priority campaigns do not consume contact slots that are reserved for higher-priority campaigns — regardless of chronological order. - A customer qualifies for all five campaigns: Campaign A (high priority), Campaign B (high priority), Campaign C (medium priority), Campaign D (medium priority), and Campaign E (low priority). - The weekly contact limit is 3 messages. - Campaign C is scheduled for Monday at 09:00, Campaign D for Monday at 14:00, Campaign E for Tuesday at 10:00, Campaign A for Wednesday at 10:00, and Campaign B for Thursday at 10:00. The system processes the campaigns as follows: 1. **Monday at 09:00 — Campaign C (medium priority)**. The medium priority workflow runs. The customer qualifies for Campaign C and the time matches. Before sending, the system checks the expressions: the customer qualifies for 2 high priority campaigns (A and B). This means 2 of the 3 weekly slots are reserved for high priority. Only 1 slot remains available for medium priority. Since no medium priority pushes have been sent yet, Campaign C is sent. Push count becomes 1. 2. **Monday at 14:00 — Campaign D (medium priority)**. The medium priority workflow runs again. The customer qualifies for Campaign D and the time matches. However, the system checks: the customer still qualifies for 2 high priority campaigns (A and B are not yet sent but are planned). Since 1 medium priority campaign was already sent and only 1 slot was available for this priority level (3 total minus 2 reserved for high), Campaign D is **blocked**. 3. **Tuesday at 10:00 — Campaign E (low priority)**. The low priority workflow runs. The customer qualifies for Campaign E and the time matches. The system checks how many campaigns the customer qualifies for across high and medium priority: 2 (high) + 2 (medium) = 4, but the weekly limit is 3. In practice, 1 push has already been sent and 2 slots are reserved for high priority. No remaining capacity exists for low priority. Campaign E is **blocked**. 4. **Wednesday at 10:00 — Campaign A (high priority)**. The high priority workflow runs. The customer qualifies for Campaign A, the time matches, and the overall push count is 1 (below 3). No additional reservation checks are needed at the highest priority level. Campaign A is sent. Push count becomes 2. 5. **Thursday at 10:00 — Campaign B (high priority)**. The high priority workflow runs again. The customer qualifies for Campaign B, the time matches, and the push count is 2 (below 3). Campaign B is sent. Push count becomes 3. **Result:** The customer received 3 messages — Campaign C (medium), Campaign A (high), and Campaign B (high). Despite Campaigns A and B being scheduled later in the week, their slots were reserved from the beginning. Campaign D (medium) and Campaign E (low) were correctly blocked because the remaining weekly capacity was already allocated to higher-priority campaigns. This mechanism ensures that high priority campaigns are always delivered as long as the weekly limit allows, medium priority campaigns are sent only when there is remaining capacity after accounting for higher-priority reservations, and low priority campaigns fill any leftover slots.
Keep in mind that segmentations are evaluated dynamically. A customer's eligibility for a given campaign may change during the week — for example, if a customer performs an action that adds them to a new segmentation, or if their behavior causes them to leave a segmentation they were previously in. This means that the slot reservation calculations (based on how many higher-priority campaigns the customer qualifies for) reflect the state at the moment of evaluation, not a fixed snapshot from the beginning of the week.
The expressions that count potential higher-priority campaign eligibility effectively **reserve contact slots** for higher-priority campaigns. This means that regardless of how campaigns are distributed across the week, lower-priority campaigns will not consume slots that could be needed by higher-priority ones — even if the higher-priority campaigns are scheduled later in the week. However, keep in mind that within a single priority level, if you have more campaigns than the weekly limit allows, only the first campaigns (in chronological order) will be sent. For example, if you assign 5 campaigns to high priority with a weekly limit of 3, only the first 3 scheduled campaigns will go out.
## 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: **Individual campaign segmentations:** - [Campaign A - high priority](https://app.synerise.com/analytics-v2/segmentations/70120506-a0f3-49bf-81b7-9741d5be3515) - [Campaign B - high priority](https://app.synerise.com/analytics-v2/segmentations/32e043c4-1c03-443d-8e2b-3e5556e95027) - [Campaign C - medium priority](https://app.synerise.com/analytics-v2/segmentations/962b7546-9ec9-45e3-955e-43e40c510a22) - [Campaign D - medium priority](https://app.synerise.com/analytics-v2/segmentations/af0a9237-8352-4d6c-9dca-960894be7801) - [Campaign E - low priority](https://app.synerise.com/analytics-v2/segmentations/2016e126-55d0-4f7d-a19d-76b433d9d824) **Priority-level split audience segmentations:** - [Split audience - high priority](https://app.synerise.com/analytics-v2/segmentations/cb7ecafa-64e5-4e98-b675-85094de41aba) - [Split audience - medium priority](https://app.synerise.com/analytics-v2/segmentations/ad2871e1-5d93-4168-a45e-0d43b1f11d9d) - [Split audience - low priority](https://app.synerise.com/analytics-v2/segmentations/7e46627b-ef8e-45bb-8674-f5f823824983) **Aggregates:** - [Number of sent pushes - high priority](https://app.synerise.com/analytics-v2/aggregates/df5bc4aa-971b-3a55-bd95-3c6c21adfc25) - [Number of sent pushes - medium priority](https://app.synerise.com/analytics-v2/aggregates/0bb96bcd-1906-3603-b1aa-6f3891b7279c) - [Number of sent pushes - all](https://app.synerise.com/analytics-v2/aggregates/1f9250a1-83e3-3ee2-8439-6d7b4846c7e8) **Expressions:** - [Now (yyyy-mm-dd hh)](https://app.synerise.com/analytics/expressions/363d0fc1-bf57-481e-ad02-7715fd7ba81c) - [High priority campaign count](https://app.synerise.com/analytics/expressions/794299b1-8e4c-496c-94fa-4a188f970fcf) - [Medium priority campaign count](https://app.synerise.com/analytics/expressions/971bb8bd-15ce-457b-b2e4-8647b745cfc9) - [High + medium priority campaign count](https://app.synerise.com/analytics/expressions/3b79df31-920d-4977-96c8-592a2b3cc068) **Workflows:** - [Workflow for high priority](https://app.synerise.com/automations/workflows/automation-diagram/76e67c89-5300-4a9e-b371-df64edf274f4) - [Workflow for medium priority](https://app.synerise.com/automations/workflows/automation-diagram/eafba479-ec37-47e7-9763-40efe1a5f767) - [Workflow for low priority](https://app.synerise.com/automations/workflows/automation-diagram/84b6be35-4775-4ef1-a75c-20942d62635a) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 21 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~3), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~6), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~3), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~3), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~3), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~3). ## Read more --- - [Segmentations](/docs/analytics/segmentations) - [Expressions](/docs/crm/expressions) - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Creating workflows](/docs/automation/creating-automation) - [Mobile push campaigns](/docs/campaign/Mobile) - [Branching logic in workflows](/docs/automation) # AI-Powered Store Locator for Finding Nearest Shops Customers are looking for solutions that maximize their benefits and allow them to meet their needs promptly. A widespread behavior among customers is to check store locations on the store page, which enables them to find a store in the most convenient location. Therefore, it is beneficial to have a solution prepared to satisfy this need. This use case describes configuring an AI search to return information about a company's store locations.
Example of store location Search Engine
## Prerequisites --- - Prepare `.CSV` file with main information regarding a store location. The file should contain required columns - **itemId** and **category** and other custom values like postal code, street address, city, and so on. You can find the requirements for the `.CSV` file format [here](/docs/assets/catalogs/creating-catalogs#requirements).
Click to see a sample CSV file

category,city,itemId,lat,lon,postalCode,state,streetAddress,streetName,streetNumber,title STORE,Washington,497,38.897,-77.0251,20073,District of Columbia,3960 Killdeer Terrace,Hanson,8,Nienow and Sons STORE,Brooklyn,69,40.6924,-73.9666,11205,New York,7720 Mockingbird Circle,Bultman,39231,Baumbach-Glover STORE,Los Angeles,742,33.9754,-118.417,90094,California,85774 Stone Corner Street,Washington,652,Grimes LLC STORE,Little Rock,197,34.6725,-92.3529,72209,Arkansas,97498 Bunting Road,Boyd,712,Frami Inc STORE,Salem,622,44.8685,-123.0438,97306,Oregon,40 Dorton Court,Esch,79,Roberts and Sons STORE,Brea,550,33.9187,-117.8892,92822,California,92 Di Loreto Street,Golden Leaf,16877,Hermann-Bergnaum STORE,Sacramento,966,38.3774,-121.4444,94207,California,7250 Green Ridge Center,Kensington,6,Jacobson-Cronin STORE,Baton Rouge,492,30.3795,-91.1671,70820,Louisiana,3351 Grim Lane,Del Mar,5638,Bahringer Inc STORE,Dallas,710,32.7673,-96.7776,75387,Texas,0 Talisman Junction,Glendale,480,"Rippin, Wiza and Borer"

## Process --- 1. Import `.CSV` file to a [catalog](/use-cases/ai-search-store-location#create-a-catalog). 2. [Configure AI Engine](/use-cases/ai-search-store-location#configure-ai-engine). 3. Create and configure [search index](/use-cases/ai-search-store-location#create-an-ai-search-index). ## Create a catalog --- In the first part of the process, import the `.CSV` file into the catalog.
Import CSV
Import CSV
1. Go to Data Modeling Hub icon **Data Modeling Hub > Catalogs > New Catalog**. **Result**: A pop-up opens. 2. Enter the name of the catalog. 3. Confirm it by clicking **Apply**. **Result**: A catalog appears on the list. Its position on the list is defined by alphabetic order (the list is arranged from Z-A). 4. Click the catalog on the list. 5. On the upper right corner, click **Import CSV** button. **Result**: A pop-up opens. 6. Click **Upload file** button. **Result**: A pop-up opens. 7. Select the file to be uploaded. Confirm with **OK**. 8. In the **Order key** field, type the name of the column whose values are treated as the key. In our case, the `itemId` value will function as the key. 9. Confirm by clicking **Import**. **Result**: Imported records are available in the catalog.
Example of a catalog
Example of a catalog
## Configure AI Engine --- In this part of the process, create and configure feed for AI engine based on the catalog created [earlier](/use-cases/ai-search-store-location#create-a-catalog).
A product feed uploaded to a catalog
A catalog configured for AI engine
1. Go to **Settings > AI engine configuration**. 2. Click **Add feed**. **Result**: A pop-up appears. 3. Select the product feed you want to use. In this case select **Catalog**. 4. On the pop-up, select the type of catalog: **Data catalog**. 5. From the dropdown list, select a catalog created in the [previous step](/use-cases/ai-search-store-location#create-a-catalog). 6. Confirm by clicking **Apply**. 7. On the list of feeds, click the feed created earlier. 8. In the **Applied search engines** tab, click **Show**. 9. Switch the **Search engines** toggle on. 10. Confirm by clicking **Apply**. 11. Click **Save**.
Launching Search Engine
Launching Search Engine
## Create an AI Search index --- In this part of the process, create an index of AI search that facilitates searching for a store by city, postal code, street address, and street name. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Click **Add index**. **Result**: The index creation screen opens. 3. In the **Index name** field, type the meaningful name of the index. 1. From the **Choose catalog** dropdown list, select an [item catalog](/use-cases/ai-search-store-location#configure-ai-engine) to use as the source for the search results.
Remember that the value of an item attribute in the item catalog cannot be longer than 1000 characters. It applies both for creating a new index and updating it.
2. From the **Choose search engine language** dropdown, select the language of your search engine. 4. Click **Next step**.
Example of basic index settings
Example of basic index settings
5. Define response and searchable attributes. More detailed information about these attributes can be found [here](/docs/ai-hub/ai-search/define-attributes/?helpCenterAi=define#response-attributes). In this case, `city`, `postal code`, `street address`, and `street name` are selected a searchable attributes, so the customer will be able to search for stores using them. 6. Click **Next step**. **Result**: The Filters & Facets screen opens. 7. Skip this step by clicking **Next step**. **Result**: The Ranking screen opens. 8. Click **Complete**. 7. The Ranking screen opens. Click **Complete**. 8. Wait until the index is ready. Refresh the page until you receive information in the upper right corner of the screen that the index is ready.
Your index is ready
Your index is ready
9. Check the results by clicking **Preview**. 10. In the search field, enter the name of the store or store location. **Result**: A list with the defined search results appears. ## What's next --- Once AI search is configured, it can be implemented in any channel, such for example a website using [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content).
We recommend enriching the integration with a store location map. This can be achieved using public tools such as **Azure Maps**. You can find extensive documentation for Azure Maps [here](https://docs.microsoft.com/en-gb/azure/azure-maps/) or use this [quick demo application](https://docs.microsoft.com/en-gb/azure/azure-maps/quick-demo-map-app). The `.CSV` file to be used in this case must contain the longitude and latitude to create the map.
## Check the use case set up on the Synerise Demo workspace --- You can also check the [AI search configuration](https://app.synerise.com/ai-v2/search/indices/cbc43b41c46dea9f6d187e9f32b3dc7f1729689355/settings) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AI engine configuration](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search#selecting-attributes-for-preview) - [AI search](/docs/ai-hub/ai-search/introduction-to-ai-search) - [Catalogs](/docs/assets/catalogs) - [Dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content) # Check distribution of sources of traffic on a website In this scenario, you will create a segmentation that allows you to understand the distribution of traffic to your website, in this example - mobile vs desktop visits. This scenario assumes the default setup, in which a `page.visit` event has a **source** parameter that equals `WEB_DESKTOP` or `MOBILEWEB` depending on the client device. ## Prerequisites --- - Add a [tracking code](/developers/web/installation-and-configuration) to your website. ## Create segmentation --- Create a segmentation that organizes customers by sources from which they visited the website. 1. Go to **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful name of the segmentation. 3. Add three segments by clicking **Add segment**. 4. Name the segments as follows: `Mobile and Desktop`, `Mobile`, and `Desktop`. 5. Define the conditions for each segment:
Mobile and Desktop
  1. Click Performed event....
  2. From the dropdown list, select page.visit.
  3. As the event parameter, select source.
  4. As the logical operator, select EQUAL.
  5. In the text field, enter `WEB_DESKTOP`.
  6. Click Performed event....
  7. From the dropdown list, select page.visit.
  8. As the event parameter, select source.
  9. As the logical operator, select EQUAL.
  10. In the text field, enter `MOBILEWEB`.
  11. Join the two conditions with the `And` logical operator.
Mobile
  1. Click Performed event....
  2. From the dropdown list, select page.visit.
  3. As the event parameter, select source.
  4. As the logical operator, select EQUAL.
  5. In the text field, enter `MOBILEWEB`.
Desktop
  1. Click Performed event....
  2. From the dropdown list, select page.visit.
  3. As the event parameter, select source.
  4. As the logical operator, select EQUAL.
  5. In the text field, enter `WEB_DESKTOP`.
11. Save your segmentation.
Conditions of the segmentation
Conditions of the segmentation
### Preview segmentation 1. Switch the **Multi-match** option on. 2. Click **Show preview**. You receive the number of customers in each segment and the percentage of each segment in relation to the whole population in the segmentation. Additionally: - You can change the chart type - pie chart and column chart - You can also export the information to CSV/XLSX (data) or JPEG/PNG/PDF (chart)
Preview of the segmentation
Preview of the segmentation
## Check the use case set up on the Synerise Demo workspace --- You can check the [segmentation configuration](https://app.synerise.com/analytics-v2/segmentations/e02acab7-a40f-4004-8a1d-703491d704d7) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Segmentation](/docs/analytics/segmentations) # Labeling Best-Selling Products Automatically in Synerise Catalog Automating the extraction of sales data and updating product catalogs with accurate information is vital for businesses aiming to streamline operations and improve customer experiences. In this specific scenario, the objective is to achieve precisely that by utilizing automation to identify best-selling products in the Synerise catalog and label them on the website. Implementing this scenario offers several key advantages. Firstly, it enables the efficient transmission of sales data for frequently purchased products within a specific category directly to the catalog. By eliminating manual data extraction, this automated approach reduces human errors and saves valuable time and resources. The goal of this use case is to - using automation - send the sales for a particular product category (in this instance: smartphones) and upload it to the Synerise catalog through automation. The data corresponds to the best-selling items from the last 30 days. The process involves generating a JSON report via an API, manipulating the response using Jinja, and sending a request to the Synerise catalog to add the sales data with sequential numbers. Additionally, a dynamic content script is utilized to verify if the Stock Keeping Unit (SKU) exists in the top 100 product catalog and apply a "Bestseller" label to the corresponding elements on a webpage daily, based on the most recent data. ## Prerequisites --- - Create a catalog, that consists of two columns: `no` (number) and `sku`. This catalog will serve as the foundation for importing data automatically. The objective is to import data of the top 100 bestselling products in the `smartphones` category from the last 30 days. - Create a [Workspace API key](/docs/settings/tool/api) that has the following permissions: `ANALYTICS_BACKEND_REPORT_READ` and `CATALOGS_ITEM_BATCH_CATALOG_CREATE` - In order for the bestseller label to be added to an element, the SKU (Stock Keeping Unit) needs to be included as an attribute called `data-sku.` On the webpage, there should be an element, preferably an `` tag, with the `data-sku` attribute whose value corresponds to the SKU from the list of bestsellers in the catalog. ## Process --- In this use case, you will go through the following steps: 1. [Create a metric](/use-cases/bestsellers-in-catalog#create-a-metric) that calculates the number of purchases within the `smartphones` category over the last 30 days. 2. [Create a report](/use-cases/bestsellers-in-catalog#create-a-report) that presents the top 100 bestselling products based on the metric created in the previous step. 3. [Retrieve request body of the report](/use-cases/bestsellers-in-catalog#retrieve-request-body-of-the-report) and use it in the next step during creating a workflow (in the Outgoing Integration node). 3. [Create a workflow](/use-cases/bestsellers-in-catalog#create-a-workflow) that facilitates the transmission of transaction data to the catalog, ensuring accurate and up-to-date information. 2. [Create a dynamic content campaign](/use-cases/bestsellers-in-catalog#create-a-dynamic-content-campaign) that adds labels to the bestselling products, enhancing their visibility and recognition. ## Create a metric --- To create a metric that counts the number of frequently purchased products in a specific category (in this case: `smartphones`) within the last 30 days, follow the steps below: 1. Go to Behavioral Data Hub icon **Decision Hub > Metrics > New mertic**. 2. Enter a name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the aggregator, set **Count**. 5. As the occurrence type, set **All**. 6. From the **Choose event*** dropdown list, select **product.buy** event. 7. Click on the **Where** button. Result: The **Choose parameter** button will appear. 8. Click the **Choose parameter** button. Result: A pop-up window will appear. 9. Choose the `category` parameter. 12. Click the **Choose parameter** button. 13. From the dropdown, select **Contain**. 14. In the text field, enter the name of the chosen category. In our case `smartphones`. 15. To specify the analyzed period, click on the **calendar** icon. 15. Choose the last 30 days. 16. Confirm your selection by clicking the **Apply** button. 17. Save the metric.
Metric
Metric
## Create a report --- To create a report that presents the top 100 bestselling products from the last 30 days, follow the steps below: 1. Go to Behavioral Data Hub icon **Decision Hub > Report > New report**. 2. Enter a name of the report. 3. Select the metric you created in [the previous part](/use-cases/bestsellers-in-catalog#create-a-metric) of the process. 4. From the **Range** dropdown list, choose **100 top** to display the most frequently bought products in the report preview. 5. In the **Dimension** section, select the parameter from the **product.buy** event and as the parameter, select **$sku** to display the SKU of each product. 6. For the date range, select the time period you want to analyze. In this case, choose 30 days.
Make sure to select the same date range as you previously selected for the metric.
7. Save the report. 8. Click on **Preview** to view the results.
The configuration of the report
The configuration of the report
## Retrieve request body of the report --- Download the request body of the report you created. You will use it in the next step during creating a workflow (in the Outgoing Integration node). 1. Go to the [report](/use-cases/bestsellers-in-catalog#create-a-report) created in the previous step. 2. Right-click and choose the option **Inspect**. 3. In the Developer Tools window that opens, navigate to the **Network** tab. 4. Click on the **Preview** tab within your report. 5. In the **Network** section locate the **Preview** element related to your report. 6. Click on the element to display its details. 7. Within the details, find the **Payload** section. 7. Click on the **Payload** element and select the option to copy the object. 6. Paste the copied object into the body of your request.
Download the request body
Request body - download
## Create a workflow --- In this part of the process, create a workflow that updated the catalog with 100 bestselling items during last 30 days. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter a name of the workflow. ### Define the trigger node --- Set up the repetitive launch of the trigger to 9:00 A.M on a daily basis.
In the triggering node, the audience is not a priority - you may include only yourself as audience, as an outcome, the workflow related events will be generated on the profile card. This node is necessary to: facilitate repetitive launching, using the customer-related nodes (such as Event Filter) and using customer context.
1. Start the workflow with the **Audience** node. 2. In the configuration of the node, set the **Run trigger** option to **repeatable**. 3. Set the interval to `1 per day`. 4. Choose the day and time when the process starts. Select 9 A.M. 5. Select the appropriate time zone. 6. Click **Apply**.
Trigger node
Audience node
### Configure the Outgoing Integration node You will use the Outgoing Integration node to make a request to preview the report with 100 bestselling items in the last 30 days you created in the previous part of the process. 1. Add **Outgoing Integration**. In the configuration of the node: 1. Choose **Custom webhook**. 2. Name the webhook. In our case `bestsellersMobileReport`. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `report.mobilebestsellers` 2. As **Display name**, enter `Mobile bestsellers report generated` 3. Select the **POST method**. 4. In the **Endpoint** field, enter `https://api.synerise.com/analytics/analytics/v4/reports/preview` 4. Leave the **content-type** at the default value: `application / json`. 5. In the body of the request, paste the code you have retrieved in [the previous step](#retrieve-request-body-of-the-report). Below, you can find an example code:
Check the example code
{ "analysis": { "title": "bestsellers [\"mobiles_tablets > mobiles\"] 30D", "description": "", "filter": { "matching": true, "expressions": [], "expression": { "name": "", "type": "EMPTY" } }, "reportMetrics": [ { "metricId": "8e03bdb3-408a-4a3b-bc96-4e5392a08735", "dateFilter": { "type": "RELATIVE", "duration": { "type": "DAYS", "value": 30 }, "offset": { "type": "DAYS", "value": 0 } }, "comparison": { "dateFilter": { "type": "ABSOLUTE" } }, "action": { "id": 71248, "name": "product.buy" }, "format": { "dataFormat": "numeric", "useSeparator": true, "compactNumbers": false, "fixedLength": 1 }, "grouping": { "type": "TOP", "top": 100 }, "groups": [ { "title": "$sku", "type": "EVENT", "format": { "dataFormat": "numeric", "useSeparator": true, "compactNumbers": false, "fixedLength": 1 }, "attribute": { "type": "PARAM", "param": "$sku", "id": "parameters:551610043" } } ], "eventName": "product.buy" } ] }, "allowNull": true }
9. In the **Authorization** section, select **By API key**. 10. Select the API key you created as a part of [prerequisites](#prerequisites). 11. Confirm the settings by clicking **Apply**.
Outgoing Integration
Outgoing Integration
### Configure the Event Filter node Configure the Event Filter node that will wait for a webhook response with the report preview of the top 100 bestsellers. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Check** field, from the dropdown menu choose **without limits**. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose the `report.mobilebestsellers` event. 4. Click **+ where** button and select the **name** parameter from the list. 5. From the **Choose operator** dropdown list, select **Equal (String)**. 6. In the text field, enter `bestsellersMobileReport`. 2. Confirm your settings by clicking **Apply**.
Event Filter node
Event Filter node
### Configure the Outgoing Integration node Use the Outgoing Integration node to make a request to update a catalog you created as a part of prerequisites. As a result of the update, the `sku` column will be updated with the SKU of bestselling items in the last 30 days. The configuration of this workflow ensures overwriting the catalog with 100 bestselling items on a daily basis - the list will always have 100 and won't be extended due to updates. The `no` column contains the ordinal numbers occupied by the items in the report and the values in this column are treated as keys. 1. Add **Outgoing Integration**. In the configuration of the node: 1. Choose **Custom webhook**. 2. Name the webhook. In our case `bestsellersMobileCatalogue`. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `report.updatebestsellercatalogue` 2. As **Display name**, enter `Bestseller catalogue updated` 3. Select **POST method**. 4. In the **Endpoint** field, enter `https://api.synerise.com/catalogs/bags/{YOUR_CATALOG_ID}/items/batch`. Change the `{YOUR_CATALOG_ID}` for the ID of your catalog, created in the prerequisites (you can copy it from the URL which is available when you open the catalog). 4. Leave the **content-type** at the default value: `application / json`. 5. In the body of the request, use the following code:
Check the example code
{% set id = 0 %} {% set batch = [] %} {% for entry in event.params['body.data[0].values[0]'] %} {% set id = id|add(1) %} {% set item = {"itemKey":id|string,"value":{"no":id|string,"sku":entry.name[0], "transactions":entry.value}} %} {% do batch.append(item) %} {% endfor %} {{batch|tojson}}
9. In the **Authorization** section, select **By API key**. 10. Select the API key you created as a part of [prerequisites](#prerequisites). 11. Confirm the settings by clicking **Apply**.
Outgoing Integration
Outgoing Integration
### Prepare the final settings --- To finalize the settings of your workflow, follow these steps: 1. Add the **End** node. This node marks the end of the automation process. 2. Optionally, you can define capping for the workflow if desired. Capping allows you to set limits on how many times the workflow can be triggered within a specific time frame. 3. Add titles to each node to make the workflow more understandable to your colleagues and the code in the automation. Titles can provide descriptive information about the purpose of each node. 4. Once you have configured all the nodes and made any desired optional settings, activate the workflow by clicking **Save & Run**. **Result:** The actual catalog will be generated with the list of the top 100 bestsellers from the last 30 days, including the column with sequential numbers. This catalog reflects the updated and accurate information of the bestselling products, ensuring efficient and streamlined operations for your business.
Final catalog with subsequential numbers
Final catalog with subsequential numbers
The order of rows in the catalog is presented in the alphabetical order.
Automation
Automation
## Create a dynamic content campaign --- During this part of the process, create a dynamic content to assign the "Bestseller" label to the items from the catalog displayed on a webpage. In the settings of the dynamic content, use Jinjava (you can find it in the procedure below) to retrieve data from the catalog. Verify the presence of each SKU in the catalog and designate the corresponding elements on the webpage as "Bestsellers." Additionally, you can assign a position value ranging from 1 to 100 for each record and cross-check the SKUs against the existing catalog to identify the top 100 best-selling products. 1. Go to Experience Hub icon **Experience Hub > Dynamic Content > Create new**. 2. Enter the name of the campaign. 1. Choose the **Insert Object** type. 2. Select your **Audience**. You can either target your communication to everyone or choose a specific user segment. For this example, we will target the communication to every visitor to the website. 3. In the **Content** section, click **Simple message**, then in the CSS selector field, specify the location where you want to insert the content. In our case, it is **After (in div)** `.snrs-modal-wrapper` 4. In the **Content** tab section, click **Create message**. 5. In the **JavaScript** tab, paste the following code:
Check the JavaScript code
{% set positions = range(1,101) %} {% set bestsellersMobileList = [] %} {% for position in positions %} {% catalogitem.bestsellersMobile(position) %} {% do bestsellersMobileList.append(catalog_result.sku) %} {% endcatalogitem %} {% endfor %} var bestsellersMobileSKUs = {{bestsellersMobileList|tojson}}; var bestsellersMobileHTML = `

Bestseller

`; let bestsellersMobileURL = location.href; document.body.addEventListener('click', () => { requestAnimationFrame(() => { setTimeout(() => { bestsellersMobileURL !== location.href && showBestsellersMobile(); bestsellersMobileURL = location.href; }, 1000) }); }, true); function showBestsellersMobile() { var elements = document.querySelectorAll("a[data-sku]"); for (var i = 0; i < elements.length; i++) { if (bestsellersMobileSKUs.includes(elements[i].getAttribute("data-sku"))) { elements[i].insertAdjacentHTML('afterend', bestsellersMobileHTML); elements[i].addEventListener("click", function() { SR.event.trackCustomEvent( "dynamicContent.click", { "eventLabel": "Dynamic content click", "campaignName": "Label", "sku": this.getAttribute("data-sku"), "title": this.getAttribute("title"), "category": this.getAttribute("data-category") }, "Dynamic content click" ); }); } } } showBestsellersMobile();
7. In **Display Settings**, specify where the dynamic content should be displayed: **Always**, **On landing**, or on **All pages**. 6. Skip the **UTM&URL parameters** section. 8. In the **Schedule** section, click **Define**. Select the period when the dynamic content will be active. 9. To initiate your dynamic content campaign, click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check the configuration of: - [metric](https://app.synerise.com/analytics/metrics/ee61ac48-5d48-4d4a-b2ab-a1106915d7b7), - [report](https://app.synerise.com/analytics/reports/55a37627-ba32-463e-b6c1-d15d53243f5c), - [workflow](https://app.synerise.com/automations/automation-diagram/fb814748-b7df-4ee8-9911-347ef8cc964d), - [dynamic content](https://app.synerise.com/campaigns/create/f302f1d1-6196-4ef5-8e72-5e2303d81668), If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `report.mobilebestsellers` (~1), `report.updatebestsellercatalogue` (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Dynamic content](/docs/campaign/dynamiccontent) - [Event context from preceding nodes](/developers/inserts/automation) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) # Cross-sell recommendations with category tabs based on last purchased product This use case presents cross-sell recommendations based on the customer's most recently purchased product. The section displays the last purchased item (or items) together with complementary product recommendations from different categories. Recommended products are grouped into categories and presented as tabs. This allows users to browse complementary items by switching between category views instead of scrolling through a single list. The goal is to make post-purchase recommendations easier to explore while maintaining contextual relevance to the last transaction. The setup is based on three elements: - an aggregate identifying the most recently purchased product, - a product catalog to retrieve product attributes and display information, - cross-sell recommendation models generating complementary items for each purchased product.
Quantity in stock
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) on your website or application. - Implement [transaction events](/developers/web/transactions-sdk) with product details. - Configure the [AI recommendation engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) with a cross-sell model enabled. - Maintain an updated product [catalog/feed](/docs/ai-hub/recommendations-v2/item-feed-requirements). To display purchased products and recommendations correctly: - Remember to have **category** attribute in the catalog. - Verify that the product catalog contains identifiers consistent with transaction events. - Confirm that product attributes such as name, image, price, and category are available. - Make sure the feed is regularly updated. This enables proper rendering of both the purchased product and recommended items. ## Process --- 1. Create [an aggregate](/use-cases/cross-sell-with-tabs#create-an-aggregate). 2. Create [cross sell recommendation](/use-cases/cross-sell-with-tabs#create-cross-sell-recommendation). 3. Create [dynamic content campaign](/use-cases/cross-sell-with-tabs#create-dynamic-content-campaign). ## Create an aggregate --- In the first part of the process, identify the most recently seen product for each customer, creating an aggregate. This aggregate will be used later as context for recommendations. 1. Go to **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. Select **Profile aggregate**. 3. Enter a name, for example `Last seend products`. 4. Set **Analyze profiles by** to **Last Multi**. 5. Set up the size as **3 items**. 5. Select the **page.visit** event. 6. As the event parameter, select the product identifier (for example `product:reatiler_part_no`). 7. Click **+ and where** and choose the parameter which cointains product identifier (for example `product:reatiler_part_no`). 8. As the operator set up Boolean: **is true.** 7. Set the date range to **Lifetime**. 8. Save the aggregate.
Quantity in stock
## Create cross sell recommendation --- Next, configure a recommendation model that returns cross-sell products. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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 an item feed. 5. In the **Type** section, choose the **Cross-sell** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot - here it will be from 8 to 20 items. 3. Define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters). 4. In our case, in the **Static filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **category**. 6. As an operator, choose **is defined**. 4. Confirm by clicking **Apply**.
Quantity in stock
7. In the **Slots and items ordering** section, click **Define**. 2. Choose the option **Arrange items ignoring slots and their order**. 4. Confirm by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors and settings in the **Additional settings** sections. 9. In the **Additional settings** section, choose **Exclude already bought products**. If your company sells replenishable products, you can set exclusion for specific number of days, for example, exclude products bought not later than 30 days ago. 9. In the right upper corner, click **Save**. 10. Copy the recommendation ID from its URL to use it in [dynamic content campaign](#create-dynamic-content-campaign). ## Create dynamic content campaign --- In this part of the process create the dynamic content witha carousel with tabs, presenting cross-sell products from each category, which might be bought with the one of the 3 last seen products by the customer. 1. Go to **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Insert Object** type. 4. In the **Audience** section, select **Everyone**. ### Define content 1. In the **Content** section click **Create message** and choose the code editor. 2. You can use this basic code presented below to define the basic assumptions and dependencies in JavaScript so that dynamic content works correctly. You can use a basic HTML code, but **remember to replace the ID of [the aggregate from the previous step](#create-an-aggregate) as well as the ID of the [AI recommendation](#create-cross-sell-recommendation).** You can style this campaign according to your own business needs. HTML section details: - Get last boght products - Get recommendations for each of the last bought products - For each last bought product: get info about product from catalog - Group products for each recommendation by categories (lowest level) - Build tabs - the first is active by default - Display recommended products - Add styles controlling the tabs
Check the HTML code
<!-- 1. Get last boght products --> {% set lastBoughtProducts = []%} {% aggregate 245aa662-d642-352e-acef-18198604ac13 %} {%- for item in aggregate_result -%} {% do lastBoughtProducts.append(item)%} {%- endfor -%} {% endaggregate %} <!-- 2. Get recommendations for each of the last bpugt products --> {% set productsWithCrossSell = [] %} {%- for p in lastBoughtProducts -%} {% set itemContext = []%} {% do itemContext.append(p)%} {% recommendations3 campaignId=VR6SOFcDEbAg itemsIds=itemContext %} {% set prodObj = { "id": p, "crossSell": recommended_products3 }%} {%do productsWithCrossSell.append(prodObj)%} {% endrecommendations3 %} {%- endfor -%} <div class="cross-sell-wrapper unique-identifier"> <div class="left-carousel-wrapper"> <!-- 3. For each last bought product: get info about product from catalog --> <div class="snrs-left-carousel-header">Last bought</div> <div class="left-carousel my-main-carousel"> {% for product in productsWithCrossSell %} {% set key = product.id %} {% catalogitemv2.store-1(key) allowEmpty=true %} {% set object = catalog_result %} {% set name = object.name %} {% set img = object.image %} <div class="carousel-item" data-product-id="{{ product.id }}"> <img src="{{img}}""> <!-- <p class="snrs-prod-title">{{name}}</p> --> </div> {% endcatalogitemv2 %} {% endfor %} </div> </div> <div class="right-tabs-wrapper"> <!-- 4. Group products form each reco by categories (lowest level) --> {% for product in productsWithCrossSell %} {% set prodCategories = [] %} {% set categoryGroups = [] %} {% for p in product.crossSell %} {% set category = p.category|split(">")|last %} {% if prodCategories is not containing category %} {% do prodCategories.append(category) %} {% endif %} {% endfor %} {% for category in prodCategories %} {% set prodsArray = [] %} {% for p in product.crossSell %} {% set cat = p.category|split(">")|last %} {% if category == cat %} {# {% do prodsArray.append(p.itemId) %}#} {% do prodsArray.append(p) %} {% endif %} {% endfor %} {% set categoryWithProds = { "category": category, "products": prodsArray } %} {% do categoryGroups.append(categoryWithProds) %} {% endfor %} <!-- 5. Build tabs - the first is active by default --> <div class="product-tabs" data-product-id="{{ product.id }}"> {% set rangeMax = categoryGroups|length + 1%} {% for i in range(1, rangeMax) %} <input type="radio" name="tab-{{ product.id }}" id="tab-{{ product.id }}-{{ i }}" {% if i == 1 %}checked{% endif %}> {% endfor %} <div class="tab-labels"> {% for catGroup in categoryGroups %} {% set i = loop.index %} <label for="tab-{{ product.id }}-{{ i }}" class="tab-label">{{ catGroup.category }}</label> {% endfor %} </div> <!-- 6. Display reco products --> <div class="tab-contents"> {% for catGroup in categoryGroups %} {% set i = loop.index %} <div class="tab-content"> <div class="products-carousel"> {#{% for itemId in catGroup.products %} <div class="cross-sell-item"> Produkt ID: {{ itemId }} </div> {% endfor %}#} {% for p in catGroup.products %} <a href="{{p.productUrl}}" class="cross-sell-item"> <img src="{{p.image}}"> <p class="snrs-prod-title">{{p.name}}</p> <p class="snrs-prod-price">${{p.price}}</p> </a> {% endfor %} </div> </div> {% endfor %} </div> </div> <!-- 7. Styles controlling the tabs --> <style> {% for product in productsWithCrossSell %} {% set prodCategories = [] %} {% for p in product.crossSell %} {% set category = p.category|split(">")|last %} {% if prodCategories is not containing category %} {% do prodCategories.append(category) %} {% endif %} {% endfor %} {% set rangeMax = categoryGroups|length + 1%} {% for i in range(1, rangeMax) %} #tab-{{ product.id }}-{{ i }}:checked ~ .tab-labels .tab-label:nth-of-type({{ i }}), #tab-{{ product.id }}-{{ i }}:checked ~ .tab-contents .tab-content:nth-of-type({{ i }}) { display: block; } {% endfor %} {% endfor %} </style> {% endfor %} </div> </div> {% endfor %}
JS section details: - Add carousel library - Build carousel for products based on the aggregate result - Sync tabs with carousels - Init recomendation carousels
Check the JS code
(function(){ 'use strict'; // 1. Add carousel library var tns=function(){function e(){for(var e,t,n,i=arguments[0]||{},a=1,r=arguments.length;a<r;a++)if(null!==(e=arguments[a]))for(t in e)n=e[t],i!==n&&void 0!==n&&(i[t]=n);return i}function t(e){return["true","false"].indexOf(e)>=0?JSON.parse(e):e}function n(e,t,n){return n&&localStorage.setItem(e,t),t}function i(){var e=window.tnsId;return window.tnsId=e?e+1:1,"tns"+window.tnsId}function a(){var e=document,t=e.body;return t||(t=e.createElement("body"),t.fake=!0),t}function r(e){var t="";return e.fake&&(t=P.style.overflow,e.style.background="",e.style.overflow=P.style.overflow="hidden",P.appendChild(e)),t}function o(e,t){e.fake&&(e.remove(),P.style.overflow=t,P.offsetHeight)}function s(e){var t=document.createElement("style");return e&&t.setAttribute("media",e),document.querySelector("head").appendChild(t),t.sheet?t.sheet:t.styleSheet}function l(e,t,n,i){"insertRule"in e?e.insertRule(t+"{"+n+"}",i):e.addRule(t,n,i)}function c(e){return("insertRule"in e?e.cssRules:e.rules).length}function u(e,t){return Math.atan2(e,t)*(180/Math.PI)}function f(e,t){var n=!1,i=Math.abs(90-Math.abs(e));return i>=90-t?n="horizontal":i<=t&&(n="vertical"),n}function d(e,t){return e.className.indexOf(t)>=0}function v(e,t){d(e,t)||(e.className+=" "+t)}function h(e,t){d(e,t)&&(e.className=e.className.replace(t,""))}function p(e,t){return e.hasAttribute(t)}function m(e,t){return e.getAttribute(t)}function y(e){return void 0!==e.item}function g(e,t){if(e=y(e)||e instanceof Array?e:[e],"[object Object]"===Object.prototype.toString.call(t))for(var n=e.length;n--;)for(var i in t)e[n].setAttribute(i,t[i])}function b(e,t){e=y(e)||e instanceof Array?e:[e],t=t instanceof Array?t:[t];for(var n=t.length,i=e.length;i--;)for(var a=n;a--;)e[i].removeAttribute(t[a])}function x(e){e.style.cssText=""}function T(e){p(e,"hidden")||g(e,{hidden:""})}function E(e){p(e,"hidden")&&b(e,"hidden")}function C(e){return e.offsetWidth>0&&e.offsetHeight>0}function w(e){return"boolean"==typeof e.complete?e.complete:"number"==typeof e.naturalWidth?0!==e.naturalWidth:void 0}function N(e){for(var t=document.createElement("fakeelement"),n=(e.length,0);n<e.length;n++){var i=e[n];if(void 0!==t.style[i])return i}return!1}function O(e,t){var n=!1;return/^Webkit/.test(e)?n="webkit"+t+"End":/^O/.test(e)?n="o"+t+"End":e&&(n=t.toLowerCase()+"end"),n}function D(e,t){for(var n in t){var i=("touchstart"===n||"touchmove"===n)&&W;e.addEventListener(n,t[n],i)}}function k(e,t){for(var n in t){var i=["touchstart","touchmove"].indexOf(n)>=0&&W;e.removeEventListener(n,t[n],i)}}function A(){return{topics:{},on:function(e,t){this.topics[e]=this.topics[e]||[],this.topics[e].push(t)},off:function(e,t){if(this.topics[e])for(var n=0;n<this.topics[e].length;n++)if(this.topics[e][n]===t){this.topics[e].splice(n,1);break}},emit:function(e,t){this.topics[e]&&this.topics[e].forEach(function(e){e(t)})}}}function M(e,t,n,i,a,r,o){function s(){r-=l,u+=f,e.style[t]=n+u+c+i,r>0?setTimeout(s,l):o()}var l=Math.min(r,10),c=a.indexOf("%")>=0?"%":"px",a=a.replace(c,""),u=Number(e.style[t].replace(n,"").replace(i,"").replace(c,"")),f=(a-u)/r*l;setTimeout(s,l)}Object.keys||(Object.keys=function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}),function(){"use strict";"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)})}();var P=document.documentElement,I=!1;try{var S=Object.defineProperty({},"passive",{get:function(){I=!0}});window.addEventListener("test",null,S)}catch(e){}var W=!!I&&{passive:!0},H=navigator.userAgent,L=!0,z={};try{z=localStorage,z.tnsApp&&z.tnsApp!==H&&["tC","tSP","tMQ","tTf","tTDu","tTDe","tADu","tADe","tTE","tAE"].forEach(function(e){z.removeItem(e)}),z.tnsApp=H}catch(e){L=!1}localStorage||(z={});var B=document,R=window,j={ENTER:13,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},q=t(z.tC)||n("tC",function(){var e=document,t=a(),n=r(t),i=e.createElement("div"),s=!1;t.appendChild(i);try{for(var l,c=["calc(10px)","-moz-calc(10px)","-webkit-calc(10px)"],u=0;u<3;u++)if(l=c[u],i.style.width=l,10===i.offsetWidth){s=l.replace("(10px)","");break}}catch(e){}return t.fake?o(t,n):i.remove(),s}(),L),G=t(z.tSP)||n("tSP",function(){var e,t,n=document,i=a(),s=r(i),l=n.createElement("div"),c=n.createElement("div");return l.style.cssText="width: 10px",c.style.cssText="float: left; width: 5.5px; height: 10px;",e=c.cloneNode(!0),l.appendChild(c),l.appendChild(e),i.appendChild(l),t=c.offsetTop!==e.offsetTop,i.fake?o(i,s):l.remove(),t}(),L),F=t(z.tMQ)||n("tMQ",function(){var e,t=document,n=a(),i=r(n),s=t.createElement("div"),l=t.createElement("style"),c="@media all and (min-width:1px){.tns-mq-test{position:absolute}}";return l.type="text/css",s.className="tns-mq-test",n.appendChild(l),n.appendChild(s),l.styleSheet?l.styleSheet.cssText=c:l.appendChild(t.createTextNode(c)),e=window.getComputedStyle?window.getComputedStyle(s).position:s.currentStyle.position,n.fake?o(n,i):s.remove(),"absolute"===e}(),L),U=t(z.tTf)||n("tTf",N(["transform","WebkitTransform","MozTransform","msTransform","OTransform"]),L),X=t(z.tTDu)||n("tTDu",N(["transitionDuration","WebkitTransitionDuration","MozTransitionDuration","OTransitionDuration"]),L),V=t(z.tTDe)||n("tTDe",N(["transitionDelay","WebkitTransitionDelay","MozTransitionDelay","OTransitionDelay"]),L),Y=t(z.tADu)||n("tADu",N(["animationDuration","WebkitAnimationDuration","MozAnimationDuration","OAnimationDuration"]),L),K=t(z.tADe)||n("tADe",N(["animationDelay","WebkitAnimationDelay","MozAnimationDelay","OAnimationDelay"]),L),Q=t(z.tTE)||n("tTE",O(X,"Transition"),L),J=t(z.tAE)||n("tAE",O(Y,"Animation"),L);F||(G=!1);var Z=function(t){function n(){return R.innerWidth||B.documentElement.clientWidth||B.body.clientWidth}function a(e){var t;do{t=e.clientWidth,e=e.parentNode}while(!t);return t}function r(e){var n=t[e];return!n&&gt&&yt.indexOf(e)>=0&&gt.forEach(function(t){mt[t][e]&&(n=!0)}),n}function o(e,n){n=n?n:xt;var i,a={slideBy:"page",edgePadding:!1,autoHeight:!0};if(!tt&&e in a)i=a[e];else if("items"===e&&o("fixedWidth"))i=Math.floor(pt/(o("fixedWidth")+o("gutter")));else if("autoHeight"===e&&"outer"===kt)i=!0;else if(i=t[e],gt&&yt.indexOf(e)>=0)for(var r=0,s=gt.length;r<s;r++){var l=gt[r];if(!(n>=l))break;e in mt[l]&&(i=mt[l][e])}return"slideBy"===e&&"page"===i&&(i=o("items")),i}function y(e){return q?q+"("+100*e+"% / "+qt+")":100*e/qt+"%"}function N(e,t,n){var i="";if(e){var a=e;t&&(a+=t),i=n?"margin: 0px "+(pt%(n+t)+t)/2+"px":lt?"margin: 0 "+e+"px 0 "+a+"px;":"padding: "+a+"px 0 "+e+"px 0;"}else if(t&&!n){var r="-"+t+"px",o=lt?r+" 0 0":"0 "+r+" 0";i="margin: 0 "+o+";"}return i}function O(e,t,n){return e?(e+t)*qt+"px":q?q+"("+100*qt+"% / "+n+")":100*qt/n+"%"}function P(e,t,n){var i="";if(lt){if(i="width:",e)i+=e+t+"px";else{var a=tt?qt:n;i+=q?q+"(100% / "+a+")":100/a+"%"}i+=ln+";"}return i}function I(e){var t="";if(e!==!1){t=(lt?"padding-":"margin-")+(lt?"right":"bottom")+": "+e+"px;"}return t}function S(e){e=e||R.event,clearTimeout(Ct),Ct=setTimeout(function(){if(st){var t=n();xt!==t&&(xt=t,W(),"outer"===kt&&en.emit("outerResized",Qe(e)))}},100)}function W(){var e=bt,t=Kt,n=Ot,i=sn;if(pt=a(ct),ot=a(ut),gt&&H(),e!==bt||Pt){var r=It,s=Lt,u=Pt,f=Mt,d=At,v=rn;if(Ot=o("items"),Dt=o("slideBy"),rn=o("disable"),sn=!!rn||!!on&&ht<=Ot,Ot!==n&&(Zt=qt-Ot,si()),rn!==v&&$(rn),sn!==i&&(sn&&(Kt=tt?jt:0),L()),e!==bt&&(St=o("speed"),Mt=o("edgePadding"),At=o("gutter"),Pt=o("fixedWidth"),rn||Pt===u||pe(),(Lt=o("autoHeight"))!==s&&(Lt||(ut.style.height=""))),It=!sn&&o("arrowKeys"),It!==r&&(It?D(B,vn):k(B,vn)),mn){var h=Dn,p=kn;Dn=!sn&&o("controls"),kn=o("controlsText"),Dn!==h&&(Dn?E(An):T(An)),kn!==p&&(Cn.innerHTML=kn[0],wn.innerHTML=kn[1])}if(yn){var m=Pn;Pn=!sn&&o("nav"),Pn!==m&&(Pn?(E(In),Ke()):T(In))}if(xn){var y=ti;ti=!sn&&o("touch"),ti!==y&&tt&&(ti?D(ft,hn):k(ft,hn))}if(Tn){var g=ri;ri=!sn&&o("mouseDrag"),ri!==g&&tt&&(ri?D(ft,pn):k(ft,pn))}if(bn){var b=Un,x=Kn,C=Jn,w=Yn;if(sn?Un=Kn=Jn=!1:(Un=o("autoplay"),Un?(Kn=o("autoplayHoverPause"),Jn=o("autoplayResetOnVisibility")):Kn=Jn=!1),Yn=o("autoplayText"),Xn=o("autoplayTimeout"),Un!==b&&(Un?(Qn&&E(Qn),jn||Gn||De()):(Qn&&T(Qn),jn&&ke())),Kn!==x&&(Kn?D(ft,fn):k(ft,fn)),Jn!==C&&(Jn?D(B,dn):k(B,dn)),Qn&&Yn!==w){var A=Un?1:0,M=Qn.innerHTML,S=M.length-w[A].length;M.substring(S)===w[A]&&(Qn.innerHTML=M.substring(0,S)+Yn[A])}}if(!F){if(sn||Mt===f&&At===d||(ut.style.cssText=N(Mt,At,Pt)),tt&&lt&&(Pt!==u||At!==d||Ot!==n)&&(ft.style.width=O(Pt,At,Ot)),lt&&(Ot!==n||At!==d||Pt!=u)){var W=P(Pt,At,Ot)+I(At);zt.removeRule(c(zt)-1),l(zt,"#"+an+" > .tns-item",W,c(zt))}Pt||Kt!==t||ye(0)}Kt!==t&&(en.emit("indexChanged",Qe()),ye(0),Qt=Kt),Ot!==n&&(ne(),se(),ee(),navigator.msMaxTouchPoints&&re())}lt||rn||(ae(),Ve(),pe()),z(!0),ee()}function H(){bt=0,gt.forEach(function(e,t){xt>=e&&(bt=t+1)})}function L(){var e="tns-transparent";if(sn){if(!Nt){if(Mt&&(ut.style.margin="0px"),jt)for(var t=jt;t--;)tt&&v(vt[t],e),v(vt[qt-t-1],e);Nt=!0}}else if(Nt){if(Mt&&!Pt&&F&&(ut.style.margin=""),jt)for(var t=jt;t--;)tt&&h(vt[t],e),h(vt[qt-t-1],e);Nt=!1}}function z(e){Pt&&Mt&&(sn||pt<=Pt+At?"0px"!==ut.style.margin&&(ut.style.margin="0px"):e&&(ut.style.cssText=N(Mt,At,Pt)))}function $(e){var t=vt.length;if(e){if(zt.disabled=!0,ft.className=ft.className.replace(nn.substring(1),""),x(ft),Ht)for(var n=jt;n--;)tt&&T(vt[n]),T(vt[t-n-1]);if(lt&&tt||x(ut),!tt)for(var i=Kt,a=Kt+ht;i<a;i++){var r=vt[i];x(r),h(r,nt),h(r,rt)}}else{if(zt.disabled=!1,ft.className+=nn,lt||ae(),pe(),Ht)for(var n=jt;n--;)tt&&E(vt[n]),E(vt[t-n-1]);if(!tt)for(var i=Kt,a=Kt+ht;i<a;i++){var r=vt[i],o=i<Kt+Ot?nt:rt;r.style.left=100*(i-Kt)/Ot+"%",v(r,o)}}}function _(){if(Bt&&!rn){var e=Kt,t=Kt+Ot;for(Mt&&(e-=1,t+=1);e<t;e++)[].forEach.call(vt[e].querySelectorAll(".tns-lazy-img"),function(e){var t={};t[Q]=function(e){e.stopPropagation()},D(e,t),d(e,"loaded")||(e.src=m(e,"data-src"),v(e,"loaded"))})}}function ee(){if(Lt&&!rn){for(var e=[],t=Kt,n=Kt+Ot;t<n;t++)[].forEach.call(vt[t].querySelectorAll("img"),function(t){e.push(t)});0===e.length?ie():te(e)}}function te(e){e.forEach(function(t,n){w(t)&&e.splice(n,1)}),0===e.length?ie():setTimeout(function(){te(e)},16)}function ne(){_(),oe(),de(),Ke(),le()}function ie(){for(var e,t=[],n=Kt,i=Kt+Ot;n<i;n++)t.push(vt[n].offsetHeight);e=Math.max.apply(null,t),ut.style.height!==e&&(X&&ve(St),ut.style.height=e+"px")}function ae(){Et=[0];for(var e,t=vt[0].getBoundingClientRect().top,n=1;n<qt;n++)e=vt[n].getBoundingClientRect().top,Et.push(e-t)}function re(){ct.style.msScrollSnapPointsX="snapInterval(0%, "+100/Ot+"%)"}function oe(){for(var e=Kt+Math.min(ht,Ot),t=qt;t--;){var n=vt[t];t>=Kt&&t<e?p(n,"tabindex")&&(g(n,{"aria-hidden":"false"}),b(n,["tabindex"]),v(n,En)):(p(n,"tabindex")||g(n,{"aria-hidden":"true",tabindex:"-1"}),d(n,En)&&h(n,En))}}function se(){if(!tt){for(var e=Kt+Math.min(ht,Ot),t=qt;t--;){var n=vt[t];t>=Kt&&t<e?(v(n,"tns-moving"),n.style.left=100*(t-Kt)/Ot+"%",v(n,nt),h(n,rt)):n.style.left&&(n.style.left="",v(n,rt),h(n,nt)),h(n,it)}setTimeout(function(){[].forEach.call(vt,function(e){h(e,"tns-moving")})},300)}}function le(){if(Pn&&(Ln=Hn!==-1?Hn:Kt%ht,Hn=-1,Ln!==zn)){var e=Mn[zn],t=Mn[Ln];g(e,{tabindex:"-1","aria-selected":"false"}),g(t,{tabindex:"0","aria-selected":"true"}),h(e,Bn),v(t,Bn)}}function ce(e){return"button"===e.nodeName.toLowerCase()}function ue(e){return"true"===e.getAttribute("aria-disabled")}function fe(e,t,n){e?t.disabled=n:t.setAttribute("aria-disabled",n.toString())}function de(){if(Dn&&!Wt&&!Ht){var e=Nn?Cn.disabled:ue(Cn),t=On?wn.disabled:ue(wn),n=Kt===Jt,i=!Wt&&Kt===Zt;n&&!e&&fe(Nn,Cn,!0),!n&&e&&fe(Nn,Cn,!1),i&&!t&&fe(On,wn,!0),!i&&t&&fe(On,wn,!1)}}function ve(e,t){e=e?e/1e3+"s":"",t=t||ft,t.style[X]=e,tt||(t.style[Y]=e),lt||(ut.style[X]=e)}function he(){var e;if(lt)if(Pt)e=-(Pt+At)*Kt+"px";else{var t=U?qt:Ot;e=100*-Kt/t+"%"}else e=-Et[Kt]+"px";return e}function pe(e){e||(e=he()),ft.style[Ut]=Xt+e+Vt}function me(e,t,n,i){for(var a=e,r=e+Ot;a<r;a++){var o=vt[a];i||(o.style.left=100*(a-Kt)/Ot+"%"),X&&ve(St,o),at&&V&&(o.style[V]=o.style[K]=at*(a-e)/1e3+"s"),h(o,t),v(o,n),i&&Rt.push(o)}}function ye(e,t){isNaN(e)&&(e=St),jn&&!C(ft)&&(e=0),X&&ve(e),li(e,t)}function ge(e,t){Ft&&si(),(Kt!==Qt||t)&&(en.emit("indexChanged",Qe()),en.emit("transitionStart",Qe()),jn&&e&&["click","keydown"].indexOf(e.type)>=0&&ke(),$t=!0,ye())}function be(e){return e.toLowerCase().replace(/-/g,"")}function xe(e){if(tt||$t){if(en.emit("transitionEnd",Qe(e)),!tt&&Rt.length>0)for(var t=0;t<Ot;t++){var n=Rt[t];n.style.left="",X&&ve(0,n),at&&V&&(n.style[V]=n.style[K]=""),h(n,it),v(n,rt)}if(!e||!tt&&e.target.parentNode===ft||e.target===ft&&be(e.propertyName)===be(Ut)){if(!Ft){var i=Kt;si(),Kt!==i&&(en.emit("indexChanged",Qe()),X&&ve(0),pe())}ee(),"inner"===kt&&en.emit("innerLoaded",Qe()),$t=!1,zn=Ln,Qt=Kt}}}function Te(e,t){if(!sn)if("prev"===e)Ee(t,-1);else if("next"===e)Ee(t,1);else if(!$t){var n=Kt%ht,i=0;if(n<0&&(n+=ht),"first"===e)i=-n;else if("last"===e)i=ht-Ot-n;else if("number"!=typeof e&&(e=parseInt(e)),!isNaN(e)){var a=e%ht;a<0&&(a+=ht),i=a-n}Kt+=i,Kt%ht!=Qt%ht&&ge(t)}}function Ee(e,t){if(!$t){var n;if(!t){e=e||R.event;for(var i=e.target||e.srcElement;i!==An&&[Cn,wn].indexOf(i)<0;)i=i.parentNode;var a=[Cn,wn].indexOf(i);a>=0&&(n=!0,t=0===a?-1:1)}if(Wt){if(Kt===Jt&&t===-1)return void Te("last",e);if(Kt===Zt&&1===t)return void Te(0,e)}t&&(Kt+=Dt*t,ge(n||e&&"keydown"===e.type?e:null))}}function Ce(e){if(!$t){e=e||R.event;for(var t,n=e.target||e.srcElement;n!==In&&!p(n,"data-nav");)n=n.parentNode;p(n,"data-nav")&&(t=Hn=[].indexOf.call(Mn,n),Te(t,e))}}function we(){Rn=setInterval(function(){Ee(null,Vn)},Xn),jn=!0}function Ne(){clearInterval(Rn),jn=!1}function Oe(e,t){g(Qn,{"data-action":e}),Qn.innerHTML=Zn[0]+e+Zn[1]+t}function De(){we(),Qn&&Oe("stop",Yn[1])}function ke(){Ne(),Qn&&Oe("start",Yn[0])}function Ae(){Un&&!jn&&(De(),Gn=!1)}function Me(){jn&&(ke(),Gn=!0)}function Pe(){jn?(ke(),Gn=!0):(De(),Gn=!1)}function Ie(){B.hidden?jn&&(Ne(),Fn=!0):Fn&&(we(),Fn=!1)}function Se(){jn&&(Ne(),qn=!0)}function We(){qn&&(we(),qn=!1)}function He(e){switch(e=e||R.event,e.keyCode){case j.LEFT:Ee(e,-1);break;case j.RIGHT:Ee(e,1)}}function Le(e){switch(e=e||R.event,e.keyCode){case j.LEFT:case j.UP:case j.PAGEUP:Cn.disabled||Ee(e,-1);break;case j.RIGHT:case j.DOWN:case j.PAGEDOWN:wn.disabled||Ee(e,1);break;case j.HOME:Te(0,e);break;case j.END:Te(ht-1,e)}}function ze(e){e.focus()}function Be(e){function n(e){return t.navContainer?e:Sn[e]}var i=B.activeElement;if(p(i,"data-nav")){e=e||R.event;var a=e.keyCode,r=[].indexOf.call(Mn,i),o=Sn.length,s=Sn.indexOf(r);switch(t.navContainer&&(o=ht,s=r),a){case j.LEFT:case j.PAGEUP:s>0&&ze(Mn[n(s-1)]);break;case j.UP:case j.HOME:s>0&&ze(Mn[n(0)]);break;case j.RIGHT:case j.PAGEDOWN:s<o-1&&ze(Mn[n(s+1)]);break;case j.DOWN:case j.END:s<o-1&&ze(Mn[n(o-1)]);break;case j.ENTER:case j.SPACE:Hn=r,Te(r,e)}}}function Re(){ye(0,ft.scrollLeft()),Qt=Kt}function je(e){return e.target||e.srcElement}function qe(e){return e.type.indexOf("touch")>=0}function Ge(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Fe(e){if(ai=0,wt=!1,ni=ii=null,!$t){e=e||R.event;var t;qe(e)?(t=e.changedTouches[0],en.emit("touchStart",Qe(e))):(t=e,Ge(e),en.emit("dragStart",Qe(e))),ni=parseInt(t.clientX),ii=parseInt(t.clientY),$n=parseFloat(ft.style[Ut].replace(Xt,"").replace(Vt,""))}}function Ue(e){if(!$t&&null!==ni){e=e||R.event;var n;if(qe(e)?n=e.changedTouches[0]:(n=e,Ge(e)),_n=parseInt(n.clientX)-ni,ei=parseInt(n.clientY)-ii,0===ai&&(ai=f(u(ei,_n),15)===t.axis),ai){qe(e)?en.emit("touchMove",Qe(e)):(oi||(oi=!0),en.emit("dragMove",Qe(e))),wt||(wt=!0);var i=$n;if(lt)if(Pt)i+=_n,i+="px";else{var a=U?_n*Ot*100/(ot*qt):100*_n/ot;i+=a,i+="%"}else i+=ei,i+="px";U&&ve(0),ft.style[Ut]=Xt+i+Vt}}}function Xe(e){if(!$t&&wt){e=e||R.event;var t;qe(e)?(t=e.changedTouches[0],en.emit("touchEnd",Qe(e))):(t=e,en.emit("dragEnd",Qe(e))),_n=parseInt(t.clientX)-ni,ei=parseInt(t.clientY)-ii;var n=Boolean(lt?_n:ei);if(ai=0,wt=!1,ni=ii=null,lt){var i=-_n*Ot/ot;i=_n>0?Math.floor(i):Math.ceil(i),Kt+=i}else{var a=-($n+ei);if(a<=0)Kt=Jt;else if(a>=Et[Et.length-1])Kt=Zt;else{var r=0;do{r++,Kt=ei<0?r+1:r}while(r<qt&&a>=Et[r+1])}}if(ge(e,n),oi){oi=!1;var o=je(e);D(o,{click:function e(t){Ge(t),k(o,{click:e})}})}}}function Ve(){ut.style.height=Et[Kt+Ot]-Et[Kt]+"px"}function Ye(){Sn=[];for(var e=Kt%ht%Ot;e<ht;)!Ht&&e+Ot>ht&&(e=ht-Ot),Sn.push(e),e+=Ot;(Ht&&Sn.length*Ot<ht||!Ht&&Sn[0]>0)&&Sn.unshift(0)}function Ke(){Pn&&!gn&&(Ye(),Sn!==Wn&&([].forEach.call(Mn,function(e,t){Sn.indexOf(t)<0?T(e):E(e)}),Wn=Sn))}function Qe(e){return{container:ft,slideItems:vt,navContainer:In,navItems:Mn,controlsContainer:An,hasControls:mn,prevButton:Cn,nextButton:wn,items:Ot,slideBy:Dt,cloneCount:jt,slideCount:ht,slideCountNew:qt,index:Kt,indexCached:Qt,navCurrentIndex:Ln,navCurrentIndexCached:zn,visibleNavIndexes:Sn,visibleNavIndexesCached:Wn,event:e||{}}}t=e({container:B.querySelector(".slider"),mode:"carousel",axis:"horizontal",items:1,gutter:0,edgePadding:0,fixedWidth:!1,slideBy:1,controls:!0,controlsText:["prev","next"],controlsContainer:!1,nav:!0,navContainer:!1,navAsThumbnails:!1,arrowKeys:!1,speed:300,autoplay:!1,autoplayTimeout:5e3,autoplayDirection:"forward",autoplayText:["start","stop"],autoplayHoverPause:!1,autoplayButton:!1,autoplayButtonOutput:!0,autoplayResetOnVisibility:!0,loop:!0,rewind:!1,autoHeight:!1,responsive:!1,lazyload:!1,touch:!0,mouseDrag:!1,nested:!1,freezable:!0,onInit:!1},t||{}),["container","controlsContainer","navContainer","autoplayButton"].forEach(function(e){"string"==typeof t[e]&&(t[e]=B.querySelector(t[e]))});var Je=R.console&&"function"==typeof R.console.warn;if(!t.container||!t.container.nodeName)return void(Je&&console.warn("Can't find container element."));if(t.container.children.length<2)return void(Je&&console.warn("Slides less than 2."));if(t.responsive){var Ze={},$e=t.responsive;for(var _e in $e){var et=$e[_e];Ze[_e]="number"==typeof et?{items:et}:et}t.responsive=Ze,Ze=null,0 in t.responsive&&(t=e(t,t.responsive[0]),delete t.responsive[0])}var tt="carousel"===t.mode;if(!tt){t.axis="horizontal",t.rewind=!1,t.loop=!0,t.edgePadding=!1;var nt="tns-fadeIn",it="tns-fadeOut",at=!1,rt=t.animateNormal||"tns-normal";Q&&J&&(nt=t.animateIn||nt,it=t.animateOut||it,at=t.animateDelay||at)}var ot,st,lt="horizontal"===t.axis,ct=B.createElement("div"),ut=B.createElement("div"),ft=t.container,dt=ft.parentNode,vt=ft.children,ht=vt.length,pt=a(dt),mt=t.responsive,yt=[],gt=!1,bt=0,xt=n();if(mt){gt=Object.keys(mt).map(function(e){return parseInt(e)}).sort(function(e,t){return e-t}),gt.forEach(function(e){yt=yt.concat(Object.keys(mt[e]))});var Tt=[];yt.forEach(function(e){Tt.indexOf(e)<0&&Tt.push(e)}),yt=Tt,H()}var Et,Ct,wt,Nt,Ot=o("items"),Dt="page"===o("slideBy")?Ot:o("slideBy"),kt=t.nested,At=o("gutter"),Mt=o("edgePadding"),Pt=o("fixedWidth"),It=o("arrowKeys"),St=o("speed"),Wt=t.rewind,Ht=!Wt&&t.loop,Lt=o("autoHeight"),zt=s(),Bt=t.lazyload,Rt=[],jt=Ht?2*ht:0,qt=tt?ht+2*jt:ht+jt,Gt=!(!Pt||Ht||Mt),Ft=!tt||!Ht,Ut=lt?"left":"top",Xt="",Vt="",Yt=o("startIndex"),Kt=Yt?function(e){return e%=ht,e<0&&(e+=ht),e=Math.min(e,qt-Ot)}(Yt):tt?jt:0,Qt=Kt,Jt=0,Zt=qt-Ot,$t=!1,_t=t.onInit,en=new A,tn=ft.id,nn=" tns-slider tns-"+t.mode,an=ft.id||i(),rn=o("disable"),on=t.freezable,sn=!!rn||!!on&&ht<=Ot,ln="inner"===kt?" !important":"",cn={click:Ee,keydown:Le},un={click:Ce,keydown:Be},fn={mouseover:Se,mouseout:We},dn={visibilitychange:Ie},vn={keydown:He},hn={touchstart:Fe,touchmove:Ue,touchend:Xe,touchcancel:Xe},pn={mousedown:Fe,mousemove:Ue,mouseup:Xe,mouseleave:Xe},mn=r("controls"),yn=r("nav"),gn=t.navAsThumbnails,bn=r("autoplay"),xn=r("touch"),Tn=r("mouseDrag"),En="tns-slide-active";if(mn)var Cn,wn,Nn,On,Dn=o("controls"),kn=o("controlsText"),An=t.controlsContainer;if(yn)var Mn,Pn=o("nav"),In=t.navContainer,Sn=[],Wn=Sn,Hn=-1,Ln=Kt%ht,zn=Ln,Bn="tns-nav-active";if(bn)var Rn,jn,qn,Gn,Fn,Un=o("autoplay"),Xn=o("autoplayTimeout"),Vn="forward"===t.autoplayDirection?1:-1,Yn=o("autoplayText"),Kn=o("autoplayHoverPause"),Qn=t.autoplayButton,Jn=o("autoplayResetOnVisibility"),Zn=["<span class='tns-visually-hidden'>"," animation</span>"];if(xn)var $n,_n,ei,ti=o("touch"),ni=null,ii=null,ai=0;if(Tn)var ri=o("mouseDrag"),oi=!1;sn&&(Dn=Pn=ti=ri=It=Un=Kn=Jn=!1),U&&(Ut=U,Xt="translate",Xt+=lt?"X(":"Y(",Vt=")"),function(){ct.appendChild(ut),dt.insertBefore(ct,ft),ut.appendChild(ft),ot=a(ut);var e="tns-outer",n="tns-inner",i=r("gutter");if(tt?lt&&(r("edgePadding")||i&&!t.fixedWidth)?e+=" tns-ovh":n+=" tns-ovh":i&&(e+=" tns-ovh"),ct.className=e,ut.className=n,ut.id=an+"-iw",Lt&&(ut.className+=" tns-ah",ut.style[X]=St/1e3+"s"),""===ft.id&&(ft.id=an),nn+=G?" tns-subpixel":" tns-no-subpixel",nn+=q?" tns-calc":" tns-no-calc",tt&&(nn+=" tns-"+t.axis),ft.className+=nn,tt&&Q){var s={};s[Q]=xe,D(ft,s)}e=n=null;for(var u=0;u<ht;u++){var f=vt[u];f.id||(f.id=an+"-item"+u),v(f,"tns-item"),!tt&&rt&&v(f,rt),g(f,{"aria-hidden":"true",tabindex:"-1"})}if(Ht||Mt){for(var d=B.createDocumentFragment(),p=B.createDocumentFragment(),m=jt;m--;){var x=m%ht,E=vt[x].cloneNode(!0);if(b(E,"id"),p.insertBefore(E,p.firstChild),tt){var C=vt[ht-1-x].cloneNode(!0);b(C,"id"),d.appendChild(C)}}ft.insertBefore(d,ft.firstChild),ft.appendChild(p),vt=ft.children}for(var w=Kt,k=Kt+Math.min(ht,Ot);w<k;w++){var f=vt[w];g(f,{"aria-hidden":"false"}),b(f,["tabindex"]),v(f,En),tt||(f.style.left=100*(w-Kt)/Ot+"%",v(f,nt),h(f,rt))}if(tt&&lt&&(G?(l(zt,"#"+an+" > .tns-item","font-size:"+R.getComputedStyle(vt[0]).fontSize+";",c(zt)),l(zt,"#"+an,"font-size:0;",c(zt))):[].forEach.call(vt,function(e,t){e.style.marginLeft=y(t)})),F){var A=N(t.edgePadding,t.gutter,t.fixedWidth);l(zt,"#"+an+"-iw",A,c(zt)),tt&&lt&&(A="width:"+O(t.fixedWidth,t.gutter,t.items),l(zt,"#"+an,A,c(zt))),(lt||t.gutter)&&(A=P(t.fixedWidth,t.gutter,t.items)+I(t.gutter),l(zt,"#"+an+" > .tns-item",A,c(zt)))}else if(ut.style.cssText=N(Mt,At,Pt),tt&&lt&&(ft.style.width=O(Pt,At,Ot)),lt||At){var A=P(Pt,At,Ot)+I(At);l(zt,"#"+an+" > .tns-item",A,c(zt))}if(lt||rn||(ae(),Ve()),mt&&F&&gt.forEach(function(e){var t=mt[e],n="",i="",a="",s="",l=o("items",e),c=o("fixedWidth",e),u=o("edgePadding",e),f=o("gutter",e);("edgePadding"in t||"gutter"in t)&&(i="#"+an+"-iw{"+N(u,f,c)+"}"),tt&&lt&&("fixedWidth"in t||"gutter"in t||"items"in t)&&(a="#"+an+"{width:"+O(c,f,l)+"}"),("fixedWidth"in t||r("fixedWidth")&&"gutter"in t||!tt&&"items"in t)&&(s+=P(c,f,l)),"gutter"in t&&(s+=I(f)),s.length>0&&(s="#"+an+" > .tns-item{"+s+"}"),n=i+a+s,n.length>0&&zt.insertRule("@media (min-width: "+e/16+"em) {"+n+"}",zt.cssRules.length)}),tt&&!rn&&pe(),navigator.msMaxTouchPoints&&(v(ct,"ms-touch"),D(ct,{scroll:Re}),re()),yn){var M=tt?jt:0;if(In)g(In,{"aria-label":"Carousel Pagination"}),Mn=In.children,[].forEach.call(Mn,function(e,t){g(e,{"data-nav":t,tabindex:"-1","aria-selected":"false","aria-controls":vt[M+t].id})});else{for(var H="",j=gn?"":" hidden",w=0;w<ht;w++)H+='<button data-nav="'+w+'" tabindex="-1" aria-selected="false" aria-controls="'+vt[M+w].id+j+'" type="button"></button>';H='<div class="tns-nav" aria-label="Carousel Pagination">'+H+"</div>",ct.insertAdjacentHTML("afterbegin",H),In=ct.querySelector(".tns-nav"),Mn=In.children}if(Ke(),X){var U=X.substring(0,X.length-18).toLowerCase(),A="transition: all "+St/1e3+"s";U&&(A="-"+U+"-"+A),l(zt,"[aria-controls^="+an+"-item]",A,c(zt))}g(Mn[Ln],{tabindex:"0","aria-selected":"true"}),v(Mn[Ln],Bn),D(In,un),Pn||T(In)}if(bn){var V=Un?"stop":"start";Qn?g(Qn,{"data-action":V}):t.autoplayButtonOutput&&(ut.insertAdjacentHTML("beforebegin",'<button data-action="'+V+'" type="button">'+Zn[0]+V+Zn[1]+Yn[0]+"</button>"),Qn=ct.querySelector("[data-action]")),Qn&&D(Qn,{click:Pe}),Un?(De(),Kn&&D(ft,fn),Jn&&D(ft,dn)):Qn&&T(Qn)}mn&&(An?(Cn=An.children[0],wn=An.children[1],g(An,{"aria-label":"Carousel Navigation",tabindex:"0"}),g(Cn,{"data-controls":"prev"}),g(wn,{"data-controls":"next"}),g(An.children,{"aria-controls":an,tabindex:"-1"})):(ct.insertAdjacentHTML("afterbegin",'<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button data-controls="prev" tabindex="-1" aria-controls="'+an+'" type="button">'+kn[0]+'</button><button data-controls="next" tabindex="-1" aria-controls="'+an+'" type="button">'+kn[1]+"</button></div>"),An=ct.querySelector(".tns-controls"),Cn=An.children[0],wn=An.children[1]),Nn=ce(Cn),On=ce(wn),de(),D(An,cn),Dn||T(An)),ti&&D(ft,hn),ri&&D(ft,pn),It&&D(B,vn),"inner"===kt?en.on("outerResized",function(){W(),en.emit("innerLoaded",Qe())}):(D(R,{resize:S}),"outer"===kt&&en.on("innerLoaded",ee)),_(),ee(),L(),z(),en.on("indexChanged",ne),"function"==typeof _t&&_t(Qe()),"inner"===kt&&en.emit("innerLoaded",Qe()),rn&&$(!0),st=!0}();var si=function(){return Ht?function(){var e=Jt,t=Zt;if(tt)if(e+=Dt,t-=Dt,Mt)e+=1,t-=1;else if(Pt){var n=At?At:0;pt%(Pt+n)>n&&(t-=1)}if(Kt>t)for(;Kt>=e+ht;)Kt-=ht;else if(Kt<e)for(;Kt<=t-ht;)Kt+=ht}:function(){Kt=Math.max(Jt,Math.min(Zt,Kt))}}(),li=function(){return tt?function(e,t){t||(t=he()),Gt&&Kt===Zt&&(t=-((Pt+At)*qt-ot)+"px"),X||!e?(pe(t),e&&C(ft)||xe()):M(ft,Ut,Xt,Vt,t,St,xe),lt||Ve()}:function(e){Rt=[];var t={};t[Q]=t[J]=xe,k(vt[Qt],t),D(vt[Kt],t),me(Qt,nt,it,!0),me(Kt,rt,nt),Q&&J&&e||xe()}}();return{getInfo:Qe,events:en,goTo:Te,play:Ae,pause:Me,isOn:st,rebuild:function(){return Z(t)},destroy:function(){if(k(R,{resize:S}),k(B,vn),zt.disabled=!0,Ht)for(var e=jt;e--;)tt&&vt[0].remove(),vt[vt.length-1].remove();var n=["tns-item",En];tt||(n=n.concat("tns-normal",nt));for(var i=ht;i--;){var a=vt[i];a.id.indexOf(an+"-item")>=0&&(a.id=""),n.forEach(function(e){h(a,e)})}if(b(vt,["style","aria-hidden","tabindex"]),vt=an=ht=qt=jt=null,Dn&&(k(An,cn),t.controlsContainer&&(b(An,["aria-label","tabindex"]),b(An.children,["aria-controls","aria-disabled","tabindex"])),An=Cn=wn=null),Pn&&(k(In,un),t.navContainer&&(b(In,["aria-label"]),b(Mn,["aria-selected","aria-controls","tabindex"])),In=Mn=null),Un&&(clearInterval(Rn),Qn&&k(Qn,{click:Pe}),k(ft,fn),k(ft,dn),t.autoplayButton&&b(Qn,["data-action"])),ft.id=tn||"",ft.className=ft.className.replace(nn,""),x(ft),tt&&Q){var r={};r[Q]=xe,k(ft,r)}k(ft,hn),k(ft,pn),dt.insertBefore(ft,ct),ct.remove(),ct=ut=ft=Kt=Qt=Ot=Dt=Ln=zn=mn=Sn=Wn=this.getInfo=this.events=this.goTo=this.play=this.pause=this.destroy=null,this.isOn=st=!1}}};return Z}(); // 2. Build carousel for products from aggregate const sliderMain = tns({ container: '.unique-identifier .my-main-carousel', items: 1, slideBy: 1, controls: true, nav: false, gutter: 10 }); // 3. Synch tabs with carousels function updateTabs(info) { let index, activeSlide; // Update slider for more than 1 product if (info && info.slideItems && info.slideItems.length) { index = info.index; activeSlide = info.slideItems[index]; } else { // Fallback for single product activeSlide = document.querySelector('.unique-identifier .glider-slide[data-product-id]'); } if (activeSlide) { const productId = activeSlide.getAttribute('data-product-id'); const productTabsAll = document.querySelectorAll('.unique-identifier .product-tabs'); const productTabsEl = document.querySelector(`.unique-identifier .product-tabs[data-product-id="${productId}"]`); productTabsAll.forEach(tab => tab.style.display = "none"); if (productTabsEl) { productTabsEl.style.display = "flex"; } } } updateTabs(sliderMain?.getInfo?.()); if (sliderMain?.events?.on) { sliderMain.events.on('indexChanged', updateTabs); } // 4. Init recomendation carousels document.querySelectorAll('.unique-identifier .products-carousel').forEach((carousel, index) => { tns({ container: carousel, items: 3, slideBy: 1, controls: true, center: false, nav: false, gutter: 10, loop: false, responsive: { 0: { items: 2 }, 768: { items: 4 } } }); }); })()
### Schedule the message and configure display settings --- As the final part of the process, you need to set the schedule, display settings configuration, capping, priority of the message among other in-app messages. 1. In the **Schedule** section: 1. Click **Define**. 2. Choose **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Define**. 2. Define the **Delay display** as **0** and **Priority index** as **1**. 5. Click **Apply**. 3. Optionally, you can define the UTM parameters in the **UTM & URL parameters** section. Otherwise, click **Skip step**. 4. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- In our Synerise Demo workspace you can check the configuration of the: - [Aggregate](https://app.synerise.com/analytics-v2/aggregates/245aa662-d642-352e-acef-18198604ac13) - [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/VR6SOFcDEbAg) - [Dynamic content](https://app.synerise.com/campaigns/dynamic-content/preview/281259da-85a4-43fc-8e1c-c025652656b0) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~3), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dynamic content](/docs/campaign/dynamiccontent) - [Recommendations](/docs/ai-hub/recommendations-v2) # Enriching the product page with data from the catalog In Synerise, we can use dynamic content campaigns in many different ways: to display a recommendation, pop-up, or use it as a tag manager that embeds various scripts on the website. One of the ways that we can also use dynamic content is enriching information about the product on the product page, for example, adding information about the low stock of the product, or displaying a label that the product is new / discounted or soon will be unavailable. We can use any information about the product that we collect in a product catalog to later display it on the product page in any way. In this use case, we will show you how to enrich your product pages with information collected in the product catalog about quantity in stock and the "Super Offer" label.
Quantity in stock
## Prerequisites --- - Implement [Synerise tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Implement [OG Tags](/developers/web/og-tags) on your website. - Create [a product catalog](/use-cases/import-product-feed-to-catalog). In your product catalog add the following columns as custom attributes: - a column with information about quantity in stock for every product - a column in which you include information if a specific product has the "Super Offer" label - adjust the name to your business needs.
Example CSV file imported to the catalog
Example of a product catalog with necessary information about stock availability and "supper offer" label
## Create a dynamic content campaign --- In this part of the process, you will create the dynamic content campaign which will display stock data on your product pages and assign the "super offer" label to the specific products. ### Create a dynamic content message --- 1. Go to Experience Hub icon **Experience Hub > Dynamic Content > Create new**. 2. Enter the name of the campaign. 3. Choose the **Insert Object** type. 4. In the **Audience** section, select the **Everyone** tab. 4. In the **Content** section, select **Simple message**, and in the CSS selector field, enter where you want to insert the content. 5. Click **Create message** and choose **Code editor**. 6. In the HTML section add the following code, which allows you to extract an item from the catalog and then obtain the values of particular columns for the product on the website.
{% set additionalParamSku = metric_additional_params[ "product:retailer_part_no" ] %} 
    {% catalogitem.catalog-name(additionalParamSku) %} 
    {% set object = catalog_result %} 
    {{ object.get("superOffer") }} 
    {{ object.get("quantityInStock") }} 
    {% endcatalogitem %}
Where: - `superOffer` is the column name from your catalog in which you can find the information if the specific product has the "Super Offer" label. - `quantityInStock` is the column name from your catalog in which you can find the information how many products are in the stock currently. - `metric_additional_params ["product:retailer_part_no"]` is the ID of the product on the website, extracted from [OG tags](/developers/inserts/dynamic-content#accessing-meta-properties). - `catalog-name` is the name of the product catalog.
Both column names are exemplary and based on the specific product catalog.
Check the example campaign code used in this particular use case below.
{% set additionalParamSku = metric_additional_params[ "product:retailer_part_no" ] %}
 {% catalogitem.additional-info(additionalParamSku) %}
 {% set object = catalog_result %}
 <div class ="short-description">
 <h3>Quantity In Stock</h3>
 {{ object.get ("quantityInStock") }}
 </div>

 {% set ifOffer = object.get ("superOffer") %}
 {% if ifOffer == 'true' %}
 <div class="short-decription">
 <h3 style="color: red">Super Offer</h3>
  </div>
 {% endif %}
 {% endcatalogitem %}
This is an example implementation and this code should be adapted to your business needs, taking into account the appropriate label layout and stock info. You should add the appropriate CSS styles and HTML code as well as JS code if needed.
### Set up the schedule and display settings --- 6. In the **Schedule** section, set the display time to **Display immediately** and save your changes. 7. In the **Display settings** section, choose **On landing** and add additional delay if it is necessary. 8. In the **UTM & URL parameters** section, click **Skip step**. 9. Click **Activate** and start your dynamic content campaign. **Result:** Quantity in stock section with the number of available products in stock is visible on every product page. If a specific product has the Super Offer label, the label is also visible on a product page. ## Check the video Watch the video with this use case to see how to prepare it step by step.
Enriching the product page with data from the catalog.mp4
## Check the use case set up on the Synerise Demo workspace --- You can check the [dynamic content campaign](https://app.synerise.com/campaigns/create/81379aba-331b-4898-8da0-6e22eb6f5738) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1). ## Read more --- - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic content inserts](/developers/inserts/dynamic-content) - [Jinjava inserts](/developers/inserts) # Exit pop-up with a survey Anonymous online surveys can give you the honest and accurate feedback you need, straight from your customers. Customer surveys can have an enormous impact on your organization and let you change your communication, offer and personalize your website. You can target your exit pop up based on different capabilities, for example: - time on page (you can display it only if your visitor has spent specific amount of time on your website), - URL (you can display it only to a visitor who has visited specific pages), - device (mobile/desktop), - location (language). Using those options, you can precisely describe who will see your survey. It allows you to personalize the content by combining targeting options and be sure that you will have answers only from visitors who can be your target. ## Examples of use - Book industry **Challenge** A client from the book industry implemented a survey on the website that was displayed to the visitors in the moment of leaving the website. The exit pop up includes a survey with multiple choice. The purpose of the survey is to get information about why the customer wants to leave the website to improve the customer journey.
Screenshot presenting exit pop up with survey
Exit pop up with a survey
Remember to properly analyze your results. Customer surveys can have a huge impact on your organization and let you change your communication, offer and personalize you website. ## Prerequisites --- To implement this use case, perform the following steps in the given order: - [Implement a tracking code](/docs/settings/tool/tracking_codes). - [Create tracking forms](/developers/web/tracking-form-data). - [Create dynamic content](/docs/campaign/dynamiccontent). ## Process --- To display an exit pop up with a survey on your website, perform the steps in the following order: 1. [Prepare dynamic content](/use-cases/exit-popup-with-survey#prepare-dynamic-content). 2. [Set up a dynamic content](/use-cases/exit-popup-with-survey#set-up-a-dynamic-content). 3. [Analyze results](/use-cases/exit-popup-with-survey#analyze-results). ## Prepare dynamic content ---
In our example we will use two variants of Dynamic content: - **Variant A** is useful if you want to let a visitor to the website choose only **1 answer**. - **Variant B** is usefull if you want to let a visitor to the website choose only **several answers**.
1. Go to **Dynamic content** > **Templates** > **New template**. 2. Create one of separate templates for Variant A or Variant B that contain **script** with your survey which will send data to Synerise. - **Variant A** - In this variant of the survey, only **1 answer** can be selected, which will be stored in the parameter answer. In this case, we use the attribute: **answer --> Prices**.
Check the Jinjava code
<form action="" method="post" data-synerise="exit.survey "> <p>Why do you leave?</p> <div> <input type="radio" data-synerise="answer" id="stock" value="stock" name="answer"> <label for="stock">I didn’t find what I was looking for </label> </div> <div> <input type="radio" data-synerise="answer" id="prices" value="prices" name="answer"> <label for="prices">It was too expensive </label> </div> <div> <input type="radio" id="ux" data-synerise="answer" value="ux" name="answer"> <label for="ux">The website is not user friendly </label> </div> <input type="submit" value="Save"> </form>
- **Variant B** - In this variant of the survey, a user can choose **several answers**, and you want to store each answer in a separate attribute. In this case, we can use the following attributes: stock, prices and UX.
Check the Jinjava code
<form action="" method="post" data-synerise="exit.survey "> <p>Why do you leave?</p> <div> <input type="radio" data-synerise="stock" id="stock" value="yes" name="stock"> <label for="stock">I didn’t find what I was looking for </label> </div> <div> <input type="radio" data-synerise="prices" id="prices" value="yes" name="prices"> <label for="prices">It was too expensive </label> </div> <div> <input type="radio" id="ux" data-synerise="ux" value="yes" name="ux"> <label for="ux">The website is not user friendly </label> </div> <input type="submit" value="Save"> </form>
If you want to postpone the event on the customer's card after the pop up is displayed, use the **dynamicContent.show** event.
## Set up a dynamic content --- Create a dynamic content communication and use the previously prepared templates. 1. Choose **Web Layer** type. 2. Select your **Audience** depending on your needs. You can target your communication to everyone or select segment of users. In our example we target dynamic content to users, who didn’t make transaction in last 30 days. 1. In the **Audience** section, choose **New audience** tab. 2. Click **Define conditions**. 3. From the dropdown list, select **Transaction** event. 4. As the time range, select last 30 days.
Screenshot presenting contacts filter with open calander
Contacts filter
3. In the **Content** section, click **Create message > From template** and find the folders in which you prepared template. 4. **Schedule** when the communication has to be active. 5. In the **Display settings** section define:- Trigger: On exit. - Page targeting: **All pages** (in our example, you can include or exclude any subpage). - Frequency: **1 time in 30 days** (in our example, you can define a different capping). - Stop display: **Never** - Devices: **Desktop**
Screenshot presenting exit popup with survey
Settings of the dynamic content
6. Skip **UTM** section 7. In the upper right corner, click **Activate**. ## Analyze results --- Check how to analyze results of your surveys.
Below, you can see 2 variants of results, separate for Variant A and Variant B of surveys.
### Analyze the Variant A results In **Variant A**, the visitors to the website can choose only **1 answer**, which will be stored in the **answer** parameter. 1. Go to **Decision Hub > Metrics > New metric**. 2. Select the **simple metric** type. 3. Leave the following settings to default: - Type: Events - Aggregator: Count - Occurence type: All 4. From the dropdown list, select event which refers to filling out the survey. In this use case, it is **exit.survey**. 5. Select the **Lifetime** period and save metrics.
Screenshot presenting site with simple metric options
A simple metric for the exit pop up with survey
6. Go to **Decision Hub > Reports > New report**. 7. From the **Choose metric** dropdown list, select the metric you prepared in the previous step. In this case, it's **exit popup survey**. 8. In the **Range** section, select **Top 3** (or more, it depends on how many answers your survey contains). 9. In the **Dimension** section, from the dropdown list, select the event that refers to submitting a survey and the attribute that contains the answer. 10. In the time range settings, select **Lifetime**.
Screenshot presenting raport conditions for exit popup variant A
Settings of the report on the survey on the exit pop up?
11. To see the results, click **Preview**. The report shows the most frequently chosen answer. ### Analyze the Variant B results In **Variant B**, the visitors to the website can choose several answers and each answer is stored in a separate attribute. 1. Go to **Decision Hub > Segmentation > New segmentation**. 2. From the **Choose filter** dropdown list, select an event that refers to submitting the survey. In this case it's **exit.survey**. 3. Click the **+ where** button to select the event parameter that contains an answer. In this case, it's **prices**. 4. From the **Choose operator** dropdown list, select **Equals**. In the text field, type **yes** (applies only to this use case, it can be different for you). 5. In the time range settings, select **Lifetime**. 6. Duplicate this subsegment as many times to match the number of answers in the survey. In each duplicated subsegment, change the answer parameter. 7. Switch the **Multi-match** toggle on because a visitor could have chosen several answers.
Screenshot presenting segmentation for variant B of exit popup
egmentation of customers who filled out the survey on the exit pop up?
8. To see the results, click **Preview**. To save the analysis, click **Save**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - **Ver. 1**: - [Metric](https://app.synerise.com/analytics/metrics/3a39e002-22a8-46b7-bbce-b69cb87aa058) - [Report](https://app.synerise.com/analytics/reports/101b66cb-0e89-4adc-ab48-a1180990249f) - **Ver. 2**: - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/3582d609-f51e-4dc3-81aa-e03e8eb36e6c) - [Dynamic content campaign](https://app.synerise.com/campaigns/create/75fa7763-4943-4af8-8e70-9b649484f3dc) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), `exit.survey` (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Track forms](/developers/web/tracking-form-data) - [Tracking code](/docs/settings/tool/tracking_codes) # Send RFM score to Google Analytics You can power your Google Analytics data with information collected in Synerise. You can do it by sending an event to Google Analytics with the data extracted from Synerise such as the customer attributes, customer activities, results of analyses, predictions, and so on. In this particular use case, we use Automation Hub to send each visitor's result of an [RFM analysis](/use-cases/rfm-analysis) to Google Analytics. The workflow is triggered every week for visitors from the last 7 days and sends the RFM analysis results of each customer to Google Analytics as an `rfm.score` event. The event contains two parameters: - `score` contains numeric information about the customer's score, - `rfmSegmentName` contains the name of the RFM segment the customer belongs to. ## Prerequisites --- - Get the measurement ID associated with a stream in your Google Analytics panel. Navigate to **Admin > Data Streams > {stream name} > Measurement ID**. - Create an API secret in your Google Analytics panel. To create a new secret, navigate to **Admin > Data Streams > {stream name} > Measurement Protocol > Create**. - Implement [Synerise JS SDK](/developers/web/installation-and-configuration) on your website. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Enable saving Google Analytics ID in profiles](/docs/automation/integration/google-analytics/send-events-to-ga#getting-the-customer-id-from-google-analytics). - [Create an RFM analysis](/use-cases/rfm-analysis). - [Establish a connection between Synerise and Google Analytics](/docs/automation/integration/google-analytics/send-events-to-ga#create-a-connection). ## Process --- In this use case, you will go through the following steps: 1. [Create an expression that returns the name of the RFM segment a customer belongs to](/use-cases/google-analytics-integration#create-an-expression-that-returns-rfm-segment-name). 2. [Create a workflow that sends events to Google Analytics](#create-a-workflow). ## Create an expression that returns RFM segment name --- In this part of the process, you will create an expression that retrieves a segment name from an [RFM segmentation to which a customer belongs](/use-cases/rfm-analysis#create-a-rfm-segmentation). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the **Expression for** at default (**Attribute**). 4. Click the **Select** node. 5. From the dropdown list, select **Profile**. 6. Click the **unnamed** node. 7. On the bottom of the page, click **Choose attribute**. 8. From the dropdown list, select **Segmentations**. 9. Find [the RFM segmentation](/use-cases/rfm-analysis#create-a-rfm-segmentation) and select it.
The configuration of the expression that returns RFM segment name
The configuration of the expression that returns RFM segment name
10. Save the expression. ## Create a workflow --- Create a workflow that is triggered for the customers who visited your website during the last 7 days. The system will send an `rfm.score` event with the score a customer received in the RFM analysis and with the name of the segment they belong to. The RFM result will be saved in Google Analytics for each customer, using the customer's Google Analytics ID saved as a profile attribute in Synerise. This workflow will be triggered once a week, for the group of customers who were active on the website during the last 7 days. 1. In Synerise, go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the audience of the workflow The workflow is triggered for customers who visited a website during the last 7 days. Define the conditions in the following way: 3. As the first node, add **Audience**. In the configuration of the node: 1. Set the **Run trigger** option to **repeatable**. 2. Set the interval to 1 week. 3. In the **Begin at** field, select the first launch of the trigger. 4. From the **Timezone** dropdown list, select the time zone consistent with the time zone selected for your workspace. 5. In the **Define audience** section, click the **New audience** tab. 6. From the **Choose filter** dropdown list, select **page.visit**. 7. In the right bottom corner, set the date to **Last 7 days**. 4. Confirm by clicking **Apply**. ### Configure the Google Analytics node In this step, you will configure the settings of the Google Analytics integration in the **Send Event** node. This includes: - Selecting the connection (for authorization purposes) - Defining the customer identifier - you will use an insert that retrieves the value of the `cid` attribute that stores the Google Analytics ID - Defining the event and event parameters to be sent to Google Analytics You can find the detailed instructions for each action below.
If you want to learn more about **Send Event** node, click [here](/docs/automation/integration/google-analytics/send-events-to-ga).
4. On the **Audience** node, click **THEN**. 5. From the node list, select **Google Analytics > Send Event**. 6. In the configuration of the node: 1. Select the connection. If you haven’t established a connection yet, see [Create a connection](/docs/automation/integration/google-analytics/send-events-to-ga#create-a-connection). 2. In the **Customer ID** field, enter `{{ customer['cid'] }}` This way, you will retrieve the value of the `cid` attribute. 3. In the **Event name** field, enter `rfm.score` 4. In the **Event parameters** field, enter the parameters of the event in the form of the JSON object. The object uses the `{% expression %}` insert to refer to the value of the RFM-related expressions. For example:
{
           "score": "{% expression %} rfm-score-expression {% endexpression %}",
           "rfmSegmentName": "{% expression %} rfm-segment-name-expression {% endexpression %}"
       }
- Replace `rfm-score-expression` with the ID of [the expression that calculates the RFM score](/use-cases/rfm-analysis#create-an-expression). - Replace `rfm-segment-name-expression` with ID of the expression you created in [this part of the process](/use-cases/google-analytics-integration#create-an-expression-that-returns-rfm-segment-name). 7. Confirm by clicking **Apply**.
The configuration of the Send Event node
The configuration of the Send Event node
### Add the finishing node 8. On the **Send Event**, click **THEN**. 9. Add the **End** node.
Final configuration of workflow
Final configuration of the workflow
9. Activate the workflow by clicking **Save & Run**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of: - [The expression that retrieves the name of the RFM segment](https://app.synerise.com/analytics/expressions/6b15f344-94b1-49c3-85f3-e375bae7af7d) - [The expression that calculates RFM](https://app.synerise.com/analytics/expressions/70716383-93cf-479c-99f0-15ad4c826472) - [The workflow that sends events to Google Analytics with RFM results](https://app.synerise.com/automations/automation-diagram/d2b5a05c-aaae-431b-88b5-e1f285a39e09) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `googleAnalytics.sendEvent` (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Dynamic content](/docs/campaign/dynamiccontent) - [Integration](/docs/automation/integration) - [Send Event node](/docs/automation/integration/google-analytics/send-events-to-ga) # Create a Purchase Report Based on Product Categories While creating a purchase analysis of specific products, we often want to group them according to specific rules, for example, by their category. However, the product category is not always added to the parameters of the transaction event. In this case, you can use Decision Hub, which creates the necessary parameter on the fly without changing the integration. In this use case, you'll learn how to create category parameters on the fly using Synerise Decision Hub and how to create a report that shows how many purchases were made for products in the defined categories. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Prepare a list of product SKUs that you would like to group into specific product categories. ## Process --- - [Create an expression](/use-cases/group_products_by_category#group-sold-products-by-their-category-with-sku) that groups sold products into categories based on their SKU. - [Create a metric](/use-cases/group_products_by_category#create-a-metric) that returns the number of products purchased within the defined category. - [Create a report](/use-cases/group_products_by_category#create-a-report) that shows the metric result broken down into defined groups (product categories). ## Group sold products by their category with SKU ---
In our case, event expression is be based on the products SKU. Hovewer, it is only the example of the configuration of the expression. Depending on your business needs and parameters used in the product events, you can create any conditions that can be based for example on fragment from the product name, url, and any other conditions.
In this part of the process, you will create an event expression for the **product.buy** event. The formula of this expression will assign a product with a given SKU to a specific product category.
Groups of these SKUs have a repeating string in the middle (for example, one SKU has ZZ**XXXX**YY and another has AA**XXXX**BB)
If the SKU is included in the group corresponding to the regular expression conditions (constant with the value “.*XXXX.*”), then the expression assigns it to the product group (for example, constant with the value `Laptop`). The next groups of products will be added in the same way. If the product doesn't meet the expression conditions, it will be assigned to the `other` category. 1. Go to <Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression. 3. Set the Expression for option to **Event**. 4. From the dropdown list, select **product.buy**. 5. Build the expression as shown in the screenshot below:
Expression configuration
Expression configuration
## Create a metric --- Create a metric to receive the number of purchased products of the groups defined in the previous step. 1. Go to Behavioral Data Hub icon **Decision Hub > Metrics > New mertic**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the aggregator, set **Count**. 5. As the occurrence type, set **All**. 6. From the Choose event dropdown list, select **product.buy** event. 7. Click **Where** button. Result: The Choose parameter button appears. 8. Click the **Choose parameter** button. Result: A pop-up appears. 9. On the pop-up, click the **three-dot** button Result: A dropdown shows. 10. From the dropdown, select **Expressions**. 11. In the list of expressions, find the event expression you have created [earlier](/use-cases/group_products_by_category#group-sold-products-by-their-category-with-sku). 12. Click the **Choose parameter** button. 13. From the dropdown, select **Not equal**. 14. In the text field, enter `other`. 15. To select a specific time range, click the **calendar** icon. 16. Confirm your choice with the **Apply** button. 17. Save metrics.
Metrics configuration
Metrics configuration
## Create a report --- In this part of the process, create a report based on the metric and expression you prepared before. The result of the report is a table with the number of purchased products in each category over a specified time period. 1. Go to Behavioral Data Hub icon **Decision Hub > Reports > New report**. 2. Enter the name of the report. 3. Select metric you created in [this part](/use-cases/group_products_by_category#create-a-metric) of the process. 4. From the **Range** dropdown list, select the number of top (the most frequently bought group of products) to be shown in the preview of the report.
The selected number of product groups in the range must be greater than the number of product groups defined in the expression - for the report to pull them all in.
5. In the Dimension section, select the expression created in [this step](/use-cases/group_products_by_category#group-sold-products-by-their-category-with-sku). 6. In the date range, select the time that will be analyzed. 7. Save the report. 8. Click **Preview** to see the results.
Report configuration
Report configuration
Preview the results of the report:
Report preview
Report preview
The sold products presented in the report are grouped according to predefined categories. You can use this data to compare whether sales of a particular product group have increased during the period of interest. If there has been a noticeable increase in product group sales, there is likely to be a fraud. In this case, you can implement an alert system using email alert/sms alert nodes or outgoing integration. You can take inspiration from the following [use case](/use-cases/slack-integration), which describes the process of creating a workflow that sends alert messages based on the results of metrics to a Slack channel. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Expression](https://app.synerise.com/analytics/expressions/b6b60b91-9333-42db-9a87-9343a87d87fd) - [Metric](https://app.synerise.com/analytics/metrics/9399b940-b639-4bba-a83f-2d320827cf6e) - [Report](https://app.synerise.com/analytics/reports/9d2f7346-368d-4099-8e9f-dd749641a374) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) # Quick and easy transaction import to Synerise There are various methods available to import transactional data into Synerise. One of them is to send live data via API, collect it directly from the website, or set up cyclic data exchange processes between Synerise and external solutions. Another possible method is a simple import, which can be done through an intuitive wizard to guide you in importing data that meets all Synerise requirements. In this use case, we will walk you through the process of importing transactions to Synerise using a local `.csv` file. This straightforward method ensures a smooth and efficient import of your transactional data, allowing you to leverage it for robust analytics and impactful business decisions. ## Prerequisites --- Make sure you meet all [prerequisites](/docs/assets/imports/importing-transactional-data#requirements) for starting to work with Imports. You will also find valuable [tips](/docs/assets/imports/importing-transactional-data#tips-for-preparing-a-csv-file) for preparing the CSV file.
In this case, we will use data from a sample file, which can be downloaded during the [Select the file for import](/use-cases/import-transactional-data#select-the-file-for-import) step, using the **Get Sample File** button.
## Select the file for import --- In this part of the process, you will upload a file from your device. 1. Go to **Data Modeling Hub > Imports > New import**. 2. As the data type for import, select **Transactions**. 3. As the import method, to import a single `.csv` file to Synerise, select **Import a local file**. 4. Upload the `.csv` file by using the **+ Upload file or drag one here** field. 5. Optionally, you can customize the file metacharacters by clicking the arrow down icon next to **Customize file markup**. 1. From the **Delimiter** dropdown, select the character that marks the end of a column. 2. From the **Quotation mark** dropdown list, select the characters that contain the text. 3. From the **Escape character** dropdown lists, select the character which changes the default interpretation of a character or a string followed by the escape character. 6. You can preview the data output by clicking **Preview data**.
File download view
File download view
7. Click the **Next** button to upload the file. 8. When the file is uploaded click **Next** to proceed. ## Mapping the columns with parameters in Synerise --- In this part of the process, you will connect the columns from the file with their counterparts (the existing parameters) in Synerise. This way, you will point which parameters in Synerise will contain the event information from the imported file. Note that the revenue information is mandatory. If you have not previously included this information in the file, you can enable automatic calculation of the revenue (which is the multiplication of the item quantity by its price) in this part of the process by enabling the **Calculate revenue** option. In the **Product unit price** field, from the dropdown list select the name of the column that contains the price of a single piece of an item. The revenue will be calculated by multiplying price by item quantity. You can also exclude parameters from the import. During the mapping process, you can’t add new columns to the imported file. 1. Next to the file column name, from the dropdown list, select the corresponding parameter in Synerise. Perform this step for all columns in your file if needed.
In our case, we do not need to map the parameters, because the uploaded file meets all the requirements from the prerequisites.
Mapping the columns with parameters
Mapping the columns with parameters
2. To proceed to the summary of the import, click **Next** and **Continue**. **Result:** The summary of the import is displayed. 3. After checking the import summary, to start the import, click **Run import**. **Result:** The import results in `transaction.charge` and `product.buy` events generated on the profile cards of customers indicated in the imported file. Once you initiate the import process, you can conveniently monitor its progress. If data was added in the wrong format, all relevant details of these irregularities are available in the job list. Each stage of the import process is accompanied by its status and information on the level of success achieved. This allows you to easily identify any issues and take appropriate actions to fix them. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Imports](/docs/assets/imports/introduction-to-imports) - [Transactional data structure](https://hub.synerise.com/api-reference/profile-management#operation/ClientCompletedTransaction) # Secret sale --- Personalized offers are more effective than intrusive advertising. When you offer something that is tailored to your target group, it is more likely to be successful. In fact, there are many ways that companies can use **personalized offers to increase their sales**. One of the most popular ways is through personalized discount for a given segment of users who might be interested in such a product. You should use appropriate group of recipients and personalize discount based on their behavior, products they visited etc. This method is often used to reach out to potential customers and get them interested in **specific offer**. ## Example of use - Retail industry (jewelry) **Challenge** For one of our customers we prepared a special temporary campaign that worked for the needs of the internal marketing strategy. For a given segment of users, the client offered a reduction in the prices of products from 5 collections if the product chosen by the user had the right weight of stones. In this case it was one carat. We segregated the appropriate group of recipients who might be interested in such a product (they visited products from these collections). Then, we displayed a message to them **when they clicked on the dropdown menu with the weight of the stone**. The message was visible only to logged-in users. Also, in order to check how the campaign worked, we collected information on the size of the stones that were added on the product card and what was finally placed in the basket. ![Screenshot presenting secret sale](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/secret-sale.png) ## Requirements --- - Tracker key - Sending data about the carats based on custom events ## How to do it --- 1. Create dynamic content that contains code that will display messages.
(function()
   {if (document.querySelector('.account-link')){ // collecting information about whether the user is logged in 
   document.querySelectorAll(".current")[1].addEventListener("click", function () { // condition that the campaign should be displayed after clicking the dropdown with a mass of stone 
   document.querySelector('.sale').style.display='block'; // event that is sent when the campaign is displayed 
   SR.event.trackCustomEvent('sale', {
   action: "rings_show"
   }, 'Secret sale');
   });
   } 
   }());
2. Apply appropriate settings that will allow messages to be displayed on selected collections. 3. Attach custom events to measure campaign results. 4. Create analytics that will allow you to check campaign performance. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), `sale` (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - Read more about [custom events](/developers/web/event-tracking#declarative-tracking-custom-events) - Read more about [dynamic content campaigns](/docs/campaign/dynamiccontent) # Product-recipe matching for enhanced culinary experience Today's customers are fans of convenience and are looking for quick and efficient solutions to meet their needs. When it comes to food, customers usually purchase products with a specific dish in mind or look for inspiration to create a delicious meal. By matching products with recipes and vice versa, businesses can inspire customers to purchase the products needed for their next culinary adventure while also providing them with creative recipe ideas. This approach not only increases the average order value, but it also enhances the overall shopping and cooking experience. By seamlessly integrating shopping and recipe discovery, businesses can provide a more intuitive and satisfying experience for their customers, ultimately leading to increased loyalty and revenue growth.
Product-recipe matching cover graphics
This use case illustrates a scenario in which product and recipe information are linked to each other. As a result, we achieve a scenario where the product page displays recipes featuring the viewed product, and the recipe page displays the products required to prepare the described dish. This approach enhances the user experience on the site and promotes up-selling, ultimately leading to an increase in the average order value. We have created an interactive web page that demonstrates the described solution in a practical manner. This page showcases the relationship between ingredients and recipes, with all the necessary ingredients conveniently listed on recipe pages and vice versa. You can easily navigate to each ingredient from the recipe page and explore other recipes that utilize the same ingredient. **Check out [the page](https://snrmarketing.blob.core.windows.net/pages/look-and-cook.html) now!** ## Prerequisites --- - Implement Synerise web SDK. - Implement [OG Tags](/developers/web/og-tags) on your website. - [Import product feed into the Synerise catalog](/use-cases/import-product-feed-to-catalog)
In this use case, we use two separate product feeds: - A standard product feed (A) - which additionally contains an itemId array with recipes that match the product. In our example, we use the **c:recipesHandle** parameter. - An additional feed with recipes (B) - which contains an array of itemId of products from the previous feed needed to make the recipe. In the example, we use the **c:productsHandle** parameter.
Click to see a sample catalog with recipes
Example of a catalog with recipes
Example of a catalog with recipes
- [Configure AI Engine for AI Search](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search) ## Prepare two search indexes --- Create two separate search indexes for ingredients and recipe catalogs. We will start by creating an index for the ingredients catalog. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Click **Add index**. **Result**: The index creation screen opens. 3. In the **Index name** field, type the meaningful name of the index. 1. From the **Choose catalog** dropdown list, select an [item catalog](/use-cases/ai-search-store-location#configure-ai-engine) to use as the source for the search results.
Remember that the value of an item attribute in the item catalog cannot be longer than 1000 characters. It applies both for creating a new index and updating it.
2. From the **Choose search engine language** dropdown, select the language of your search engine. 4. Click **Next step**.
Example of basic index settings
Example of basic index settings
5. Define response and searchable attributes. More detailed information about these attributes can be found [here](/docs/ai-hub/ai-search/define-attributes/?helpCenterAi=define#response-attributes). 6. Click **Next step**. **Result**: The Filters & Facets screen opens. 7. Define filterable and facetable attributes. More information about these attributes can be found [here](/docs/ai-hub/ai-search/define-attributes/?helpCenterAi=define#filterable-attributes). 8. Click **Next step**. **Result**: The Ranking screen opens. 9. Click **Complete**. 10. Wait until the index is ready. Refresh the page until you receive information in the upper right corner of the screen that the index is ready.
The time required to prepare the index depends on the size of the feed and can range from 5 minutes to 2 hours.
Your index is ready
Your index is ready
11. Check the performance of the filters in the **Preview** tab. 12. In the search field, enter the name of the product. **Result**: A list with the defined search results appears.
Preview of inngredient catalog
Preview of inngredient catalog
13. Create a recipe search index. Follow the same instructions as described for the product index. ## Implement a solution on your site --- According to the [Synerise API Reference](https://hub.synerise.com/api-reference/ai-search#tag/Listing) documentation and the description of how to construct filters for [Filters queries](/developers/iql/filters), you can use Synerise Search to expand the page using two scenarios: 1. [when you are on the recipe page, show the required ingredients](/use-cases/recipe#display-the-required-ingredients-on-the-recipe-card), 2. [when you are on the ingredient page, show the related recipes](/use-cases/recipe#show-related-recepies-on-the-ingredient-page). ### Display the required ingredients on the recipe card --- An example of cURL request:
curl 'https://api.synerise.com/search/v2/indices/8f3a20c375803e5807244e6bbc803fea1688306195/list?token=FEE539C0-D206-A685-88F8-0E433FCDFD1D&clientUUID=bbe22634-0105-41f3-ad7f-b2766071a012&limit=26&filters=itemId%20IN%20%5B%22100019%22,%22100010%22,%22100016%22,%2210006%22,%2210003%22,%2210001%22,%2210008%22,%22100023%22%5D'
Explanation of the respective elements of the request:
https://api.synerise.com/search/v2/indices/8f3a20c375803e5807244e6bbc803fea1688306195/list
token=FEE539C0-D206-A685-88F8-0E433FCDFD1D
clientUUID=bbe22634-0105-41f3-ad7f-b2766071a012
filters=itemId IN ["10001","10006"]
- **token**: the token parameter contains the authentication UUID (tracker key) that gives access to API, - **clientUUID**: the parameter contains the identifier of the customer for which the request is sent, - **filters**: is a parameter that specifies the criteria by which the elements should be retrieved. In this case, we are looking for items whose title matches one of the values in the array (10001, 10006). In other words, with **itemId** we retrieve the ingredients from which we can prepare the meals we are currently reviewing. ### Show related recepies on the ingredient page --- An example of cURL request:
curl 'https://api.synerise.com/search/v2/indices/0036645cd9413eccbd31877a8c967e991688311535/list?token=FEE539C0-D206-A685-88F8-0E433FCDFD1D&clientUUID=bbe22634-0105-41f3-ad7f-b2766071a012&limit=26&filters=itemId%20IN%20%5B%2230003%22,%2230004%22,%2230005%22,%2230007%22,%2230009%22,%2230000%22,%2230001%22,%22300010%22,%22300011%22,%22300012%22,%2230002%22,%2230006%22%5D'
Explanation of the respective elements of the request:
https://api.synerise.com/search/v2/indices/0036645cd9413eccbd31877a8c967e991688311535/list
token=FEE539C0-D206-A685-88F8-0E433FCDFD1D
clientUUID=bbe22634-0105-41f3-ad7f-b2766071a012
filters=itemId IN ["30001","30002"]
- **token**: the token parameter contains the authentication UUID (tracker key) that gives access to the API, - **clientUUID**: the parameter contains the identifier of the customer for which the request is sent, - **filters**: is a parameter that specifies the criteria by which the elements should be retrieved. In this case, we are looking for items whose title matches one of the values in the array (30001, 30002). In other words, with **itemId** we retrieve recipes for meals we can prepare from the ingredient we are currently viewing. ## Check the use case set up on the Synerise Demo workspace --- You can check all the analytics directly in the Synerise Demo workspace: - [Ingredients catalog](https://app.synerise.com/assets/catalogs/17889) - [Recipe catalog](https://app.synerise.com/assets/catalogs/17890) - [Ingredients index](https://app.synerise.com/ai-v2/search/indices/8f3a20c375803e5807244e6bbc803fea1688306195/stats/global) - [Recipe index](https://app.synerise.com/ai-v2/search/indices/0036645cd9413eccbd31877a8c967e991688311535/stats/global) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~2), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AI engine configuration](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search#selecting-attributes-for-preview) - [AI search](/docs/ai-hub/ai-search/introduction-to-ai-search) - [Catalogs](/docs/assets/catalogs) # In-app message with a price drop for recently viewed products In-app messaging has become an essential tool for businesses as it provides a direct and personal communication channel with customers. Price drops are a key aspect of business strategy to drive sales, increase customer engagement, and enhance brand loyalty. In an ever-competitive market, price drops can help companies stand out and create a unique value proposition for their customers. With the right strategy, price drops can produce significant results, leading to revenue growth and increased customer engagement. For customers, price drops represent an opportunity to save money on products that interest them. This, in turn, can increase customer loyalty and satisfaction and encourage repeat purchases. The scenario described in this use case involves using an in-app message to notify customers of price drops on recently viewed products. The in-app message will be displayed right after the start of the mobile session only for customers for whom the product they were viewing has actually been reduced in price.
In-app price drop message example
## Prerequisites --- - Implement the [required version](/docs/campaign/in-app-messages/introduction-to-inapp-messages#requirements) of [Synerise SDK in your mobile app](/developers/mobile-sdk). - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - [Create an item catalog](/use-cases/import-product-feed-to-catalog) containing information on the actual price of products. ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate that returns the IDs of visited products](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-ids-of-last-visited-products) 2. [Create an aggregate that returns the prices of visited products](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-original-prices-of-last-visited-products) 3. [Create an aggregate that returns sku of recently purchased products](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-skus-of-recently-purchased-products) 4. [Create an in-app campaign](/use-cases/in-app-price-drop-last-seen-products#create-an-in-app-campaign) ## Create an aggregate that returns the IDs of last visited products --- 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 5. From the **Choose event** drop-down list, select the **page.visit** event. 6. As the event parameter, select **product:retailer_part_no**. 7. Click the **+ where** button. 8. From the **Choose parameter** drop-down list, select the **product:retailer_part_no** parameter. 9. From the **Choose operator** drop-down list, select **Is true (Boolean)**. 10. Set the period for which the aggregate will return IDs of the viewed products to the last **30 days**. 11. Save the aggregate.
Configuration of the aggregate with last visited products
Configuration of the aggregate with last visited products
## Create an aggregate that returns the original prices of last visited products --- 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 5. From the **Choose event** drop-down list, select the **page.visit** event. 6. As the event parameter, select **product:original_price:amount**. 7. Click the **+ where** button. 8. From the **Choose parameter** drop-down list, select the **product:original_price:amount** parameter. 9. From the **Choose operator** drop-down list, select **Is true (Boolean)**. 10. Set the period for which the aggregate will return the original prices of viewed products to the last **30 days**. 11. Save the aggregate.
Configuration of the aggregate with original price of last visited product
Configuration of the aggregate with original price of last visited product
## Create an aggregate that returns the skus of recently purchased products --- This aggregate will be used to exclude products that the customer has already purchased. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 5. From the **Choose event** drop-down list, select the **product.buy** event. 6. As the event parameter, select **$sku**. 7. Click the **+ where** button. 8. From the **Choose parameter** drop-down list, select the **$sku** parameter. 9. From the **Choose operator** drop-down list, select **Is true (Boolean)**. 10. Set the period for which the aggregate will return skus of the viewed products to the last **30 days**. 11. Save the aggregate.
Configuration of the aggregate with skus of last visited product
Configuration of the aggregate with skus of last visited product
## Create an in-app campaign --- In this part of the process, you will create an in-app campaign triggered by the `session.start` event. We will use a predefined template for the price drop scenario, so there is no need to create a template from scratch. 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create new** 2. Enter a meaningful name for the in-app campaign. ### Define the audience --- 1. In the **Audience** section, click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. ### Define content --- 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select **Price alert** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable)) and/or by filling out the form in the **Config** tab. In this use case, we will use the capabilities of the predefined **Config** tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. The fields in **Config** are split into two types: ones for dynamic content (related to Jinja) and ones for in-app appearance. The dynamic content fields must match the values in the catalog and the names of the attributes returned by the recommendations. The appearance fields only affect the visual layer of the in-app message. 1. In the **Header text** text box, type the header you want to display in the in-app message. 2. From the **Aggregate with IDs of products the customer interacted with** drop-down list, select the aggregate you created in [this step](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-ids-of-last-visited-products). You can find it by typing its name or ID in the search box.
In this scenario, customers interact with the product by viewing it. This is just one example. You can create other aggregates to show different types of interaction with the product, such as adding it to the cart or favorites list, etc. This also applies to all related aggregates used in this use case.
3. From the **Aggregate with prices of products the customer interacted with** drop-down list, select the aggregate you created in [this step](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-original-prices-of-last-visited-products). You can find it by typing its name or ID in the search box. 4. From the **Aggregate with IDs of products purchased** drop-down list, select the aggregate you created in [this step](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-skus-of-recently-purchased-products). This field corresponds to the code fragment in the template that excludes products displayed in the in-app message, so the products with the IDs returned by the selected aggregate won't be displayed. You can find it by typing its name or ID in the search box. 5. In the **Name of the catalog with product information** field, change the default `Snrs-produktu-ogTag` value to the catalog name with product information you use. In our case, we use the same product catalog. 6. In the **Name of the column with sale price** field, change the default `g:sale_price` value to the name of the column with sale price in your catalog with product information. In our case the name of the column with sale price is `product:sale_price:amount`.
The price defined in this field refers to a column in the catalog with the discount price of the product.
7. In the **Name of the column with product title** field, change the default `og:title` value to the name of the column with product title in your catalog with product information. 8. In the **Name of the column with product link** field, change the default `og:url` value to the name of the column with product link in your catalog with product information. 9. In the **Name of the column with image link** field, change the default `og:image` value to the name of the column with image link in your catalog with product information. 10. Define the **Name of the column with average rating** and **Name of the column with number of ratings** fields if you want to include this information in your in-app message. 11. In the **Name of the column with price** field, change the default `product:original_price:amount` value to the name of the column with price in your catalog with product information.
The price defined in this field refers to the column in the catalog with the original price of the product - the price before any reductions.
12. In the **Button text** text box, type the text you want to display on the in-app button that adds the product to the cart. 13. Define the color in the following fields: **Wrapper background color**, **Button background color**, **Button text color**. 14. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer or a product. 3. Click **Apply**. 15. If the template is ready, in the upper right corner, click **Save this template > Save as**. 16. On the pop-up: 1. In the **Template name** field, enter the name of the template. 2. From the **Template folder** drop-down list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 17. To continue the process of configuring the in-app campaign, click **Next**. 18. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, define the event that triggers the display of the in-app message. In our case, the trigger is the start of the session start. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the drop-down list, choose the `session.start` event. 3. Click the **+ where** button and as the parameter, choose `mobile`. 4. As the logical operator, select **Exists**. 5. Click **Apply**.
The view of In-app trigger event configuration
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you need to set the schedule, display settings configuration, capping, priority of the message among other in-app messages. 1. In the **Schedule** section: 1. Click **Define**. 2. Choose **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Define**. 2. Define the **Delay display** as **5** and **Priority index** as **1**.
The mobile application can display one in-app message at a time. If the conditions allow the display of several in-apps at a time, the priority is a decisive factor for displaying the message. The messages with lower priority aren’t queued.
3. Enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the message to the customer maximum once a day. 4. You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a customer in general. 5. Click **Apply**. 3. Optionally, you can define the UTM parameters in the **UTM & URL parameters** section. Otherwise, click **Skip step**. 4. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 5. To start your campaign, click **Activate**.
In-app campaign configuration settings
In-app campaign configuration settings
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [Aggregate that returns the IDs of visited products](https://app.synerise.com/analytics/aggregates/d6b649d5-e0c5-3c2a-b311-4eaf3530e82b), - [Aggregate that returns the prices of visited products](https://app.synerise.com/analytics/aggregates/300949d8-f120-3714-adcc-14a6c8bb6119), - [Aggregate that returns sku of recently purchased products](https://app.synerise.com/analytics/aggregates/46a9c55a-f894-3d83-b7a5-d193e0223de9), - [In-app campaign](https://app.synerise.com/communications/in-app/6eaea5ba-88a7-4507-a904-e09a2a99e867) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`session.start`](/docs/assets/events/event-reference/web-and-app#sessionstart) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) - [Mobile campaigns](/docs/campaign/Mobile) # Item comparison recommendations on the website An overwhelming number of products can often discourage a customer from purchasing. An intelligent solution is to use product comparison recommendations to make the buying decision process smoother. Such offers make it easier for customers to decide when trying to choose between multiple models or styles of the same products to get a better idea of which option is best for them. But it also allows marketers to promote products with specific features. Such a solution is a great way to increase customer engagement and conversions. This use case describes the process of creating dress comparison recommendations for customers on the website. Item comparison recommendations ## Prerequisites --- - Implement [Synerise tracking code](/developers/web/installation-and-configuration) on your website. - Implement [OG Tags](/developers/web/og-tags) on your website. - [Prepare a product feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) with attributes to be used in item comparison recommendations. - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable the item comparison recommendations. - Meet the minimum data requirements of interactions and events. At least 10,000 item page visits for **Item comparison recommendations**. ## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter a meaningful name of the recommendation. 3. In the **Type & Items feed** section, click **Define**. 1. From the **Items feed** dropdown list, select the catalog that contains items for the recommendation. 2. As the type, select **Item comparison**. 3. Click **Apply**. 4. In the **Compare attributes** section, click **Define**. 5. Click **Choose**. 6. Select the item attributes from the list of all available attributes to be compared in the recommendations. 6. Click **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. You can name the slot for later reference. 2. In the **Number of items** subsection, set the minimum and maximum number of items to `3`.
Setting the minimum and maximum number of items to the same number ensures that exactly this many items will appear in the slot.
3. In **Static filters** set the following parameters: 1. From the dropdown list, choose **Visual Builder**. 2. Click **Select attribute**. 3. From the dropdown list, choose the **category** attribute. 4. Click **Operator**. 5. From the dropdown list, choose **Equals**. 6. Click **Select value**. 7. From the dropdown list, choose the `dress` category. 8. On the bottom of the static filter, click **Apply**. 9. In the **Items** section, click **Apply**.
Learn about the difference among [elastic, static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter).
8. Optionally, you can define the settings in the **Boosting** and **Additional settings** sections.
Learn more about [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors) and [additional settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#additional-settings).
9. Save the recommendation by clicking **Save**.
You can also check the recommendation configuration directly in Synerise Demo workspace at this [link](https://app.synerise.com/ai-v2/recommendations/psaucwbowxkX). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business.
## What's next --- You can display the recommendation to customers in a number of ways, for example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Dynamic content campaigns](/docs/campaign/dynamiccontent/introduction-to-dynamic-content) - [Dynamic content inserts](/developers/inserts/dynamic-content) - [Filters in recommendations](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Requirements for item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) # Landing page collecting customers preferences With landing pages you can enrich information about customers' preferences you already have (for example their favorite categories, products and so on). Then, based on their answers you can personalize products and offers that you send to them later. Thanks to this solution you can get to know them better and be able to match the content of your messages to their preferences. ## Example of use - Retail industry Our client wanted to be prepared for Black Friday and be sure that their customers receive only offers that interest them. For this purpose, they prepared a landing page which made it possible for their customers to choose their favorite product categories: - **Technology**: Smartphones, TVs, Gaming software, PC monitors, Desktops, Printers, Portable speakers, Peripherals, Laptops, Gaming consoles, Tablets, Smartphone accessories, E-scooters, Wearable gadgets, Cameras - **Entertainment**: Toys, Books, Comics, Movies, Music - **Marketplace**: Infant, Home, Fitness, Personal care, Fashion, Clothing Each customer received special Black Friday offers connected with those categories via email or web push. Before it could happen, the customers had to first select the categories available in a form on the landing page, provide an email address and submit the form. Later, these customers could be grouped into a segmentation to which the messages could be sent. This way, the landing page became a great place to get new leads.
Screenshot presenting personalized landing page
A form about customers' preferences on a landing page
## Prerequisites --- To be able to implement this use case, you must: - [Implement a tracking code](/docs/settings/tool/tracking_codes) - [Track forms](/developers/web/tracking-form-data) - [Configure newsletter sign-up process](/docs/settings/configuration/newsletter-sign-up) - [Create a sender account](/docs/campaign/e-mail/configuring-email-account) In case you want to send web push notifications: - [Configure web push notifications](/docs/campaign/Webpush/configuring-web-push) - [Implement an agreement form](/docs/campaign/Webpush/two-step-agreement-form) ## Process --- Create a landing page with customer preference perform the steps in the following order: 1. [Track landing page data](/use-cases/landing-page-customer-preference#track-landing-page-data). 2. [Prepare an automation](/use-cases/landing-page-customer-preference#prepare-an-automation). 3. [Prepare segment of customers](/use-cases/landing-page-customer-preference#prepare-segments-of-customers). 4. [Run your landing page](/use-cases/landing-page-customer-preference#run-your-landing-page). ## Track landing page data --- To collect information gathered through a form implemented on a landing page (instead of a landing page, you can also use pop-ups) and save it on a customer's profile in, [track this form](/developers/web/tracking-form-data). In this use case, a customer can select up to 26 categories. Below, you can find an example code for 3 categories.
Check the Jinjava code
<form action="" method="post" data-synerise="BF_Preferences"> <input type="email" placeholder="E-mail" data-synerise="email" > <label> <input type="checkbox" data-synerise="BF_email_agreement" data-synerise-value="1"> I consent to the processing of my email address by xxxx in order to send me a newsletter with xxxx offers. </label> <label> <input type="checkbox" data-synerise="tvs" data-synerise-value="interested"> tvs </label> <label> <input type="checkbox" data-synerise="music" data-synerise-value="interested"> music </label> <label> <input type="checkbox" data-synerise="clothes" data-synerise-value="interested"> clothes </label> <input type="submit" value="Save" /> </form>
With this code you will collect 4 types of information - Customer’s email. - Custom attribute with agreement for email communication **BF_email_agreement = 1**. - Tag **BF_preferences**. - Attributes collected when a customer selects a checkbox on the form, for example **music = interested**.
If your form is not in the source code, but you’re adding it dynamically (using Java Script or Dynamic Content) you have to call the method which will catch the form `SyneriseTC.initFormCatch()`[Documentation](/developers/web/tracking-form-data)
## Prepare an automation --- If you want to add newsletter agreement to users who submit this preferences form, you have to prepare an automation which will enable the newsletter consent on the customer card.
Screenshot with prepare an automation
Enabling newsletter agreement on a customer's profile
This example contains the instruction on enabling an agreement for receiving emails in a customer's profile. However, you can also create such automation for other types of agreements: [web push](/docs/campaign/Webpush) and [SMS](/docs/campaign/SMS).
### Detect enabling the agreement Create a workflow for every customer who selected the newsletter agreement checkbox on the form. 1. Go to **Automation Hub > workflow > New workflow**. 2. Click the plus button and select **Profile Data Changed** trigger. 3. Double-click the node. 4. From the **Choose value** dropdown list, select a newsletter agreement related attribute (in our example it’s **BF_email_agreement**). 5. From the **Choose operator** dropdown list, select **Equal**. 6. In the text field, enter the value of the attribute (in our example, it's `1`.)
Screenshot with create agreement
The configuration of the Profile Change Data node
### Update agreement on a customer's profile 1. As action choose **Update Profile node**, 2. Set that **newsletter_agreement** attrribute has to change for enabled.
Screenshot presenting Update Profile node
The configuration of the Update Profile node
### Prepare the final settings 1. Add the **End** node where the workflow finishes for customers. 2. Optionally, add titles to each node so the workflow will be more understandable to your colleagues. 3. Name the workflow. 4. To save it as a draft, click **Save** it or activate by clicking **Save & Run**. ## Prepare segments of customers --- Based on the collected attributes, you can prepare segments of users, interested in a category or more categories. 1. Go to **Decision Hub > Segmentation > New segmentation**. 2. From the **Choose filter** dropdown list, select **Clients** tab. 3. In the **Clients** tab, select **Attributes**. 4. Select the attribute which is an equivalent of a category on the form. 5. In the **Choose operator** dropdown list, click the Boolean icon icon. 6. Select **Is true**.
Screenshot with prepare segments of users
A segmentation of customers who are interested in the TV category
## Run your landing page --- At the end of creating landing page with customer preferences, set up your landing page. Plan your communication - decide when you want to reach your customers, prepare the content of the message and select the communication type. For example, you can send [email](/docs/campaign/e-mail/creating-email-campaigns) or [web push](/docs/campaign/Webpush) communication. Remember to choose appropriate segment of customers.
Screenshot with run landing page
List of landing page
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/08e5f60e-6fbc-4d5e-8296-352b329fdd0f) - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/fe3a1af4-a64c-4085-b336-02e88a55c725) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`landingpage.visit`](/docs/assets/events/event-reference/landing-page#landingpagevisit) (~1), [`form.submit`](/docs/assets/events/event-reference/web-and-app#formsubmit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Email communication](/docs/campaign/e-mail/creating-email-campaigns) - [Forms data](/developers/web/tracking-form-data) - [Segmentation](/docs/analytics/segmentations/introduction-to-segmentations) - [Web push](/docs/campaign/Webpush) # Predicting Churn and Favorite Brands to Retain Lapsing Customers Customer churn is a major challenge for businesses looking to maintain engagement and revenue. Instead of reacting to churn after it happens, predictive analytics allows us to intervene before customers leave. In this use case, we use machine learning to predict both a **customer's likelihood to churn** and their **preferred brand**. By combining these insights, we can craft highly targeted retention campaigns. Our approach begins with two key predictions: - identifying each customer’s best-fit brand, - assessing their churn probability. Customers with a high risk of churn are then segmented based on their preferred brand. Using this segmentation, we launch a personalized email campaign featuring product recommendations from their favorite brand. The final step involves integrating this process into an automated workflow, ensuring that high-risk customers receive timely, brand-aligned email with optimized delivery timing for the best engagement results. ## Prerequisites --- - Implement the [transaction events](/developers/web/transactions-sdk). - [Enable Time Optimizer](/docs/settings/configuration/time-optimizer#enabling-time-optimizer) in Synerise settings. - Enable the personalized recommendation type in [AI Engine Configuration](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - Configure [a sender account](/docs/campaign/e-mail/configuring-email-account). **Prepare 2 predictions** 1. **Churn prediction** (for example, as described in [Predict churn](/use-cases/churn-prediction)).
See an example preview of the Churn Prediction
Example of what happens if the conditions are fulfilled
2. **Bestfit brand prediction** (for example, as described in [Boosting item selection with best fit predictions](/use-cases/bestfit-brand)).
See an example preview of the Bestfit Brand Prediction
Example of what happens if the conditions are fulfilled
## Process --- 1. [Create a segmentation](/use-cases/lapsing-customer#create-a-segmentation) that retrieves the result of the churn prediction prepared as a part of [prerequisites](#prerequisites) - users with high and very high churn risk. 2. [Create an aggregate for best brand](/use-cases/lapsing-customer#create-an-aggregate-for-best-brand) with best fit brand recommendation, thet retrieves the result of a prediction. 2. [Create AI recommendations](/use-cases/lapsing-customer#create-ai-recommendations) with personalized products from specific, personalized brand based on the results of the bestfit brand prediction prepared as a part of [prerequisites](#prerequisites). 3. [Create a workflow](/use-cases/lapsing-customer#create-a-workflow) sending email with AI recommendations with personalized brand to users with the high risk of churn. ## Create a segmentation --- In this part of the process, we will create a group of customers who have the high and very high risk of churn - based on the churn prediction prepared as a part of [prerequisites](#prerequisites). 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Give the segmentation a meaningful name, for example `High churn risk`. 3. Click **Choose filter** and select the `snr.prediction.score` event.
The event may have a custom label in the list, but can always be found by entering the system name (`snr.prediction.score`) in the search field.
3. Add the following conditions to the event: - `modelId` parameter equals the ID of the prediction you want to use. - `score_label` parameter contains `High`, as this will cover customers with High and Very High probability of churning.
The model ID can be copied from the Three-dot icon menu in the Prediction list. Remember, that the values are examples and the model ID needs to be changed.
4. Click **Save**.
The view of the segment
The segment
## Create an aggregate for best brand --- Create an aggregate which will return the latest value from the `topValue` parameter of the **snr.bestfit.score** event with modelID representing bestfit brand prediction. This aggregate will be referenced in the filters of AI recommendation configuration. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 5. From the **Choose event** dropdown list, select the **snr.bestfit.score** event. 6. As the event parameter, select **topValue**. 7. Click **+ where** button. 8. From the **Choose parameter** dropdown list, select the **modelID** parameter. 9. From the **Choose operator** dropdown list, select **Equal (string)**. 10. Enter the ID of the created prediction.
You can find the ID in the URL of the Prediction, it is the last string of characters. Below you can find a screenshot which represents exemplary value, and the place in the URL of the prediction where you can find the prediction ID. Remember that the values presented below are examples and the model ID needs to be changed.
ID of the prediction
ID of the prediction
11. Set the period from which the aggregate will analyze the results to the last **365 days**. 12. Save the aggregate.
Decision Hub Last aggregate returning the topValue parameter of the last snr.bestfit.score event filtered by prediction model ID in the past 365 days
Configuration of the aggregate
## Create AI recommendations --- In this part of the process, you will create an AI recommendation that will display items from the customer's favorite brand returned in the prediction results. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > 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. 5. Select the **Personalized** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 6. In the **Items** section, click **Define**. 8. Define the minimum and maximum number of products displayed in the frame according to your needs. 9. Use filters to include specific items in the recommendation frame. 6. Click **Elastic filter**.
Learn about the difference among [elastic, static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter).
7. From the dropdown list, choose **Visual Builder**. 7. Click **Select attribute**. 7. From the dropdown list, choose the **brand** attribute. 8. Click **Operator**. 9. From the dropdown menu, choose **Equals**. 10. Click the icon next to **Select value**. 11. Select **Aggregate** 12. Click **Select value**. 11. From the dropdown list, choose the aggregate created in the [previous step](#create-an-aggregate-for-best-brand). 11. At the bottom of the elastic filter pop-up, click **Apply**.
Recommendations configuration
Recommendations configuration
12. In the **Items** section, click **Apply**. 10. In the **Slots and items ordering**, click **Define**. 1. Define how you want to arrange the order of slots and their items in the recommendation frame. 2. In the **Items sorting method within slots** section, select your desired item sorting method within slots. 1. In **Boosting**, you can enable [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors). 13. In **Additional settings**, optionally you can exclude already bought products and set a metric to sort by. Remember that you can define the order of slots if you have created more than one. 14. Save the recommendation by clicking **Save**. ## Create a workflow --- In this part of the process, create a workflow which sends an email with the recommendations of the products from a favorite brand to the customers with the high and very high risk of churn. Additionally you can add the time optimizer node to optimize the time of sending the email. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Audience node --- Choose the **Audience** node as the trigger. 1. Start the workflow with the **Audience** node. 2. Leave the **Run trigger** as one time or repeatable with period configured depending on your needs. 3. Choose the day and time when the process starts. 4. In **Define audience**, choose **Segments** and choose the segmentation created in the [previous step](#create-a-segmentation). The following screen shows the audience configuration used in this use case.
Audience configuration
Audience configuration
### Define the Optimize Time node to the Matched path --- 1. Optionally you can add the **Optimize Time** node. In the node settings: 1. From the **AI optimization mode** dropdown list, choose **Web**. 2. In **Time period to analyze**, choose the best moment to activate the node that follows the **Optimize Time** node. In our case it will be **Custom time period**. 3. In the **Time period** field, enter specific number of hours, for example, `12` 2. Click **Apply**. ## Define the Send Email node --- To distribute the product recommendations based on the results from the best fit prediction, prepare an email template that contains the recommendation you created in the previous part of the process. 1. Add the **Send Email** node. 2. In the **Sender details** section, choose the email account from which the email will be sent. 3. In the **Content** section, in the **Subject** field, enter the subject of the email. You can use the template from the folder or create your own one using the email code editor. To use the template, click **New Template**. 4. Create your email according to your business needs. 5. Click **Inserts** in the upper right corner, find **AI Recommendations** on the list of inserts, then choose the recommendation you prepared in the [previous step](/use-cases/bestfit-brand#create-ai-recommendations). 6. Save the template. ### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for re-engaging lapsing customers
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can also check on our demo account the: - [churn prediction](https://app.synerise.com/ai-v2/predictions/wrqifoexkwcm) - [bestfit prediction](https://app.synerise.com/ai-v2/predictions/orbypencokue) - [segmentation](https://app.synerise.com/analytics-v2/segmentations/134c8225-72da-4cd9-90c5-c9f1a4cfe541) - [aggregate](https://app.synerise.com/analytics-v2/aggregates/673eb2b8-8869-329c-b6d4-b79e3a0f99bf) - [AI recommendations](https://app.synerise.com/ai-v2/recommendations/eb5qO10yrfXe) - [workflow](https://app.synerise.com/automations/workflows/automation-diagram/0fd6f246-b12d-485b-9baf-2e470f7d6639) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## What's next --- Once the initial workflow is in place, there are several ways to enhance and optimize it further. Here are some ideas: - **A/B Testing** – Split high-risk churn customers into different test groups using **A/B/X node**, choose the group percentage allocation to analyze what works best. For example: - Each segmentation receives different types of recommendations, - Each segmentation gets various discount level (e.g., 10%, 20%, or free shipping). This allows us to determine the most effective tactics for re-engagement and customer recovery. - **Multi-Channel Optimization** – Identify the preferred communication channel for each customer based on historical interactions (e.g., push, email, SMS, in-app messages) as in this use case [Identifying Customers' Preferred Communication Channel](/use-cases/channel-preference). Adapt the workflow to automatically select the most effective channel for each individual. This ensures higher deliverability and engagement by reaching customers where they are most active. Read more about [recommendation ABX testing](/docs/ai-hub/recommendations-v2/recommendation-abx-test) ## Check our latest Case Study --- Check our [Case Study](https://pulse.synerise.com/modivo/) with **Modivo** and discover how they leveraged Synerise BaseModel.AI to send personalized mailing with customers's favourite brand. ## Generated events This use case generates approximately 13 events per profile that completes the flow: [`snr.prediction.score`](/docs/assets/events/event-reference/predictions#snrpredictionscore) (~1), [`snr.bestfit.score`](/docs/assets/events/event-reference/predictions#snrbestfitscore) (~1), [`snr.ate.prediction`](/docs/assets/events/event-reference/predictions#snrateprediction) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Email](/docs/campaign/e-mail) - [Predictions](/docs/ai-hub/predictions/predictions-introduction) # Loyalty points for the first purchase after registration There are various strategies to motivate new customers to join your loyalty program, boost revenue, and encourage repeat purchases, ultimately fostering long-term loyalty. One effective approach is to provide customers with rewarding loyalty points immediately upon registration, coupled with a minimum transaction requirement. By offering these points, you incentivize customers to increase their spending while providing them with a valuable currency that can be used to unlock a range of rewards, discounts, and exclusive benefits. In this use case, we will create a workflow that grants 100 loyalty points for new loyalty program members. This offer will be available for transactions equal to or higher than 10$. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). - Add a [custom event](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CustomEvent) to save data to customers' profiles when they perform an activity. In this particular use case: `points.register` - Integrate Synerise [mobile SDK](/developers/) in your mobile application. - Integrate mechanism for awarding loyalty points.
Find more in the [Loyalty programs basics](/use-cases/loyalty-programs-basics) use case.
## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](#create-a-segmentation) that groups customers that already have loyalty points for registration. 2. [Create a workflow](#create-a-workflow) which grants 100 loyalty points for the first purchase worth a minimum $10 after registration. ## Create a segmentation --- In this part of the process, you create a segmentation based on the `points.register` event. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful name for the segmentation. 3. Click the **Add condition** and from the dropdown list, select the `points.register` event. 4. In the calendar in the right bottom of the page: 1. In the **Relative date range** section, click **More** and from the dropdown list, select **Lifetime**. 2. Click **Apply**.
Decision Hub segmentation configuration filtering customers who registered for the loyalty program
Segmentation configuration
5. Click **Save**. The segment is saved and can be viewed in **Preview**. ## Create a workflow --- Create a workflow that grants 100 loyalty points for the first purchase for a minimum value to customers who register for the first time. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node At this stage, we will configure the conditions that launch the workflow. As a trigger, we will use the `transaction.charge` event with value equal to or higher than $10. 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From **Choose event** dropdown menu, choose the `transaction.charge` event. 2. Click the **+ where** button and from the dropdown list, choose **$revenue**. 3. From the **Choose operator** dropdown, select **More or equal to (Number)**. 4. In the text field, type the minimal value of the transaction. In our case it will be `10`. 5. Confirm by clicking **Apply**.
The view of the Profile Event node configuration
Profile Event node configuration
### Define the Profile Filter node As the next step, add the Profile Filter node, which checks if the customer already has points for the registration. If the customer has not yet received loyalty points for registration, then in the next step we will generate an event with those points for them, and if they have already received points, then the workflow ends. 1. Add **Profile Filter** node. 2. Click **Choose filter > Profiles > Segmentations** and from the dropdown list, select [the segmentation you created in the previous step](#create-a-segmentation). 3. From the **Choose operator** dropdown, choose **Is true (Boolean)**. 4. Click **Apply**.
Automation Hub Profile Filter node checking customer segmentation for existing loyalty points
Profile Filter node configuration
### Congifure the Generate Event node 1. To the **Not matched** path, add a **Generate Event** node. 2. In the settings of the node: 1. Enable the **Action limit** toggle. 2. In the **Event name** field, enter the name of the event. In our case, we are using `points.register` event. 4. In the **Body** section, use the following code and modify it to your needs:
{
               "points": "100"
               }
3. Click **Apply**.
The view of the Generate Event node configuration
Generate Event node configuration
### Add final setting to your workflow 1. Add the **End** node to both paths. 2. Launch the workflow by clicking **Save&Run**.
Automation Hub workflow for awarding loyalty points on registration
Configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- In Synerise Demo workspace, you can check the configuration of: - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/5b6f8c9a-5bef-4902-acd7-46bad11e976f) - [Workflow](https://app.synerise.com/automations/automation-diagram/637d8052-4bff-4040-81db-afd3f1db59c7) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `points.register` (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Snippets](/docs/assets/snippets) - [Segmentation](/docs/analytics/segmentations) # Boost High-Margin Products in Personalized Recommendations It's hard to disagree that the ultimate goal of business is to make a profit. To achieve specific profit margin targets, marketers need to create an effective plan to achieve these goals. One of the ways to increase profits is to recommend higher-margin items to customers than the average margin of items typically purchased by customers while personalizing the results of product recommendations. This approach can streamline sales efforts without involving high costs. ## Prerequisites --- - [Create items catalog](/docs/ai-hub/recommendations-v2/item-feed-requirements). The item catalog must include an attribute which will be used to denote (in this use case, it's the `margin` attribute, which contains the margin value for each product). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable personalized recommendations. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events/operation/CreateATransaction). When implementing transaction events, remember to add a `margin` parameter, which will contain the value of the margin on the sold product. ## Process --- 1. [Create an aggregate](/use-cases/boost-higher-margin-products#create-an-aggregate). 2. [Create recommendation](/use-cases/boost-higher-margin-products#create-a-recommendation). ## Create an aggregate --- In this part of the process, create an aggregate that returns the average margin value of the products bought by an individual customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Average**. 4. From the **Choose event** dropdown list, select the **product.buy** event. 5. As the event parameter, select **margin**. 6. Define the period from which data will be analyzed. 7. Save the aggregate.
Decision Hub Average aggregate returning the average margin value from product.buy events
Configuration of the aggregate
## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. In the top left corner, enter the name of your recommendation. 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown menu, choose the provided feed. 5. Choose the **Personalized** recommendation type.
AI Hub recommendation model Type and Items feed section with Personalized recommendation type selected
Configuraion of the catalog and recommendation type section
6. Click **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the user in each slot. 3. Confirm by clicking **Apply**. 8. In the **Boosting** section: 1. Click **Define**. 2. Click **Add rule**. 3. Click **Define rule** and select **Visual Builder**. **Result**: The Visual Builder window opens. 4. From the **Select attribute** dropdown list, select the **margin** attribute. You can use the search field. 5. From the **Operator** dropdown list, select **More than**. 6. Click the value type icon (Value icon) and choose **Aggregate**. 7. From the **Choose aggregate** dropdown list, select an aggregate created in [the previous step](/use-cases/boost-higher-margin-products#create-an-aggregate). The configured filter allows you to boost items with a margin higher than the one returned in the created aggregate. 8. Click **Apply**.
Boosting items with margins higher than the average margin of products purchased by the customer
Boosting items with margins higher than the average margin of products purchased by the customer
9. In the **Promote/Demote** selector, select **Promote** (default value). 10. Use the slider to adjust how much you want the rule to affect the results. 11. Save the **Boosting** section settings by clicking **Apply**. 12. Optionally, you can define the settings in the **Additional settings** section. 13. Save the recommendation. ## What's next --- You can display the recommendation to customers in several ways, for example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content) or in a mobile app using documents - [iOS SDK](/developers/mobile-sdk/displaying-recommendations/content-widget/ios), [Android SDK](/developers/mobile-sdk/displaying-recommendations/content-widget/android). If you decide to implement recommendations through dynamic content then you need to implement [Synerise JS SDK](/developers/web/installation-and-configuration) and [OG tags](/developers/web/og-tags) into your website. Alternatively, you can also implement campaigns through [API](https://hub.synerise.com/api-reference/ai-recommendations#tag/Recommendations/operation/GetRecommendationsByCampaignV2). ## Check the use case set up on the Synerise Demo workspace --- You can also check the [aggregate](https://app.synerise.com/analytics/aggregates/f8a165a0-1deb-3ab8-8e20-9b1a520ebe72) and [AI recommendation](https://app.synerise.com/ai-v2/recommendations/Pk2EKr9IlyTw) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating aggregates](/docs/crm/aggregates/creating-profile-aggregates) - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Filters in recommendations](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Requirements for item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) # Banner with a discount for subscribing to a newsletter Getting people to actually subscribe to a mailing list is very important but at the same time it definitely isn’t easy. Increasing the number of subscribers is key when it comes to the effectiveness of your email marketing programs. Most people check their email every day, and it is an important place to maximize your conversion opportunities.  If you want people to subscribe to your newsletter, you need to **make the benefits clear to them**. Offering a discount can be an incentive to sign up. Remember that the moment you send the invitation is also very important. It’s better to send it when customers view your products or spend time on your website since it’s unlikely that a visitor will decide immediately after visiting your home page to sign up to a newsletter. One option is to put the sign-up box in a fixed position on the site, perhaps in the header or footer, so users know where to find it. ## Example of use - Retail industry **Challenge** A client from the retail industry wanted to increase newsletter sign-ups. For signing up for the newsletter, they offered a discount on the first purchase. This information was available to everyone in the footer of the page. However, they decided to make this information more visible to users who did not yet belong to the database. For this purpose, they prepared a scrollable banner that was displayed in the bottom corner of the screen only to people who hadn’t signed up yet and visited more than two products in the previous day. The message said "We have 40 PLN for you for your first shopping". If customer clicks this banner, a popup with a subscription form will be opened. ![Screenshot presenting banner with discount](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/banner_with_discount.png) **Results** Leads from this campaign were **13%** of the whole list of new monthly subscribers ## Requirements --- To use this case, you have to meet a few conditions: - Synerise Tracker - Tagging forms - Collecting marketing consents for the newsletter in Synerise ## How to do it --- 1. Prepare your dynamic content campaign 2. Create an appropriate segment of people in which two conditions will be met: - attribute newsletter_agreement = disabled - aggregate counting events visiting the product card will have a value greater than 2. For this purpose, create an aggregate in advance, in which you will indicate event page visit, where OG tag retailer part number exists (retailer_part_no is true). ![Screenshot presenting banner with discount](/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/banner_with_discount2.png) ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`form.submit`](/docs/assets/events/event-reference/web-and-app#formsubmit) (~1). ## Read more --- - Read more about [dynamic content campaigns](/docs/campaign/dynamiccontent) - Learn more about [aggregates](/docs/crm/aggregates) - Learn more about [segmentation](/docs/analytics/segmentations/creating-segmentations) # Promoting new items when a certain phrase is searched AI Search Engine enables creating rules which can help you promote items with specific attributes, based on the searched phrase. One of the applications is to create a rule which shows new products to customers based on selected phrases. This use case will help you create a rule in AI Search that promotes new models of TVs when the customer is searching for a TV. ## Prerequistes --- - An item feed must be provided. - Enable [the search engine](/docs/ai-hub/ai-search/introduction-to-ai-search) for your workspace and create an [index](/docs/ai-hub/ai-search/create-index). - Add an attribute which marks items as new in your items catalog and add this attribute to filterable attributes. In this example, the attribute is the value "new" in the `G:adwords_labels` attribute. - [Implement AI search](https://hub.synerise.com/api-reference/ai-search#tag/Search) in any of your channels (mobile app, website etc.). ## Create a rule --- 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Select an index from the list. 3. Go to the **Rules** section. 4. Click **Add Rule**. 5. Name the rule. In this case, it's "Promote new TVs". 6. To adjust the query conditions, in the **Conditions** section, click **Define**. 1. On the **Query** tab, to define the method of checking the query, choose **If query is**. 2. Click **Add phrase**. 3. Enter a phrase. You can do it in two ways: - In text field, type a word (or a phrase) in a singular form. - Next to the text field, click the Facet icon in Query rules button. From the dropdown list, select a facet. It is different from defining an exact query: you can define an attribute whose values the query looks for. For example, if you choose _brand_ as the facet, the query rule will apply its consequence whenever any brand name is detected in the query.
Example of phrases
Example of phrases
4. If you want to add more phrases, repeat steps **b** and **c**. 5. Confirm the settings by clicking the **Apply** button. 7. To define how the search engine reacts to the defined conditions, in the **Consequences** section, click **Define**. 1. Click **Add consequence**. 2. From the dropdown list, select a consequence, in this case **Filter query results**. 3. Add filter and choose attribute **G: adwords_labels**.
The attribute can have a different name in your workspace, the above is an example.
4. In the next field choose **new**. 5. Enable the **Mark as elastic** option.
Example of condition consequences
Example of condition consequences
6. Confirm by clicking **Apply**. 8. To define when the query rule applies, in the **Schedule** section, click **Define**. 1. Select an option: - To launch query rules immediately, click **Active immediately**. - To schedule the rules at specific time, click **Scheduled**. Set the schedule according to your business needs. 3. Confirm by clicking **Apply**. 8. To complete working on the query rule, you can either: - Save it as a draft by clicking **Finish later**. - Save and activate it by clicking **Publish**. **Result:** If you chose **Publish** the rule will take effect in those areas where AI search has been implemented, according to the schedule you set. ## Check the use case set up on the Synerise Demo workspace --- You can check the [rule configuration](https://app.synerise.com/ai-v2/search/indices/2891e883b914a485c4f3f98b37b652271657484874/query-rules/14434) directly in Synerise demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [Configuring AI Search](/docs/ai-hub/ai-search/introduction-to-ai-search#configuring-ai-search) - [Rules in AI Search](/docs/ai-hub/ai-search/query-rules) # Personalized promotion for digital signage Digital signage is revolutionizing the way businesses engage with customers in physical retail spaces. These dynamic displays offer a versatile platform to convey information, enhance the shopping experience, and drive sales. It allows to create a shopping environment where every customer is greeted with tailored offers perfectly aligned with their preferences and past shopping behaviors. In this use case we are reffering to the Interactive digital signage. This technology relates to a dynamic and engaging communication tool that combines digital displays with interactive technology to deliver information, advertisements, or content to an audience. Unlike traditional static displays, interactive digital signage allows users to actively engage with the content through touchscreens, gestures, or other interactive elements, fostering a more immersive and personalized experience. This use case describes the following scenario: - A customer enters a stationary store and interacts with the digital signage by scanning the mobile app or identifying themselves in some other way (for example, by logging into their loyalty profile), - The digital signage sends an API request to Synerise to get a list of personalized promotions available and customized for the customer, - At this point, the Synerise AI engine swings into action and selects the most appropriate promotions for the customer based on their profile, - After the AI engine selects the list of promotions, they are displayed on the digital signage for the customer. ## Prerequisites --- - POS must be integrated with Synerise promotion engine. - [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog). - Create promotions and tag them to use later as a filter when creating a personalized promotion. - Create a filter on the list of (regular) promotions to be reused while preparing the personalized promotion. In our case, we create a filter for special digital signage promotions.
Click here to see how to build the filter
  1. Go to AI Hub > Regular Promotions.
  2. On the right side of the screen, click
    Clicking the filter icon
  3. Click Define.
  4. On the pop-up, define the conditions by clicking Choose filters. The list contains all parameters from the product feed.
    Definition of promotion filter
    Definition of promotion filter
  5. To add a new condition, repeat the previous step.
  6. Save the filter by clicking Save and Apply.
- Apply the ["Generate personalized promotions for Profile and get Profile promotions"](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Personalized%20promotions/operation/getAssignHandbillForClient_GET) method for digital signage to retrieve a list of promotions assigned to a Profile. ## Process --- 1. [Create a personalized promotion](/use-cases/personalized-digital-signage-promotion#create-a-personalized-promotion). 2. [Generate personalized promotion for Profile and get Profile promotions in digital signage](/use-cases/personalized-digital-signage-promotion#generate-personalized-promotion-for-profile-and-get-profile-promotions). ## Create a personalized promotion --- In this part of the process, create a personalized promotion for digital signage promotions that will be active for customers in September 2023. 1. Go to AI Hub icon **AI Hub > Personalized Promotions > New personalized promotion**. 2. As the type of promotion, select **Check-in**. 3. In **A/B test settings**, add variants of the personalized promotion by clicking **Define**. 1. To add the first variant, click the plus button. 2. In **Advanced options**, leave the default option - **AI Engine** (the AI engine chooses the items to be included in the promotion). 3. Confirm by clicking **Apply**.
AB test settings
AB test settings
4. In the **Filter and limits** section, define: - the promotion type (in our case we use **Personalized promotion**), - the filter you created as a part of prerequisites, - number of promotional products to be extracted for the customer from the promotions tagged with the filter from prerequisites.
Filters and Limits configuration
Filters and Limits configuration
5. In the **Activity** section, define the activity of the promotion as **Absolute**.
You can find more detailed information on all Activity types in ["Defining promotion schedule"](/docs/ai-hub/personalized-promotions/creating-ai-promotions#defining-promotion-schedule).
Personalized promotions activity
Personalized promotions activity
6. Optionally, define the AI Engine boosting settings. You can find the instruction on how to do that in ["AI boosting settings"](/docs/ai-hub/personalized-promotions/creating-ai-promotions#ai-engine-boosting-settings). 7. After configuring all settings, publish personalized promotions. ## Generate personalized promotion for Profile and get Profile promotions --- In this part of the process, use the [Generate personalized promotions for Profile and get Profile promotions](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Personalized%20promotions/operation/getAssignHandbillForClient_GET) method to assign personalized promotion to a profile and retrieve a list of promotions assigned to the profile. As a result, Digital Signage will display a set of personalized promitions to the customer. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [personalized promotion](https://app.synerise.com/campaigns/handbills/5a106661-0c6e-4cee-a496-43a758d93e22) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1). ## Read more --- - [API references for personalized promotions](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Personalized%20promotions) - [Promotions](/docs/ai-hub/promotions)