
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://developers.synerise.com/LoyaltyandEngagement/LoyaltyandEngagement.html#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.
  
   <div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   To keep the time optimizer enabled, at least one mode must be active.

   </div></div></div>


<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/new-mode-mobile.png" alt="New mode mobile" class="medium" >
<figcaption>Configuration of custom mode in time optimizer</figcaption>
</figure>

## Prepare segmentations
---
### Create a segmentation of customers whose birthday is on the current day

1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/decision-hub-icon.svg" alt="Behavioral Data Hub icon" class="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**. 

    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/birthday.png" class="large" alt="Segment of customers who have a birthday on the current day">
    <figcaption>Segment of customers who have a birthday on the current day</figcaption>
    </figure>  

### 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 <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/decision-hub-icon.svg" alt="Behavioral Data Hub icon" class="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.

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/birthday-segmentation1.png" class="full" alt="Segment of customers who have received a mobile notification of a birthday promotion within the last 14 days">
<figcaption>Segment of customers who have received a mobile notification of a birthday promotion within the last 14 days.</figcaption>
</figure>

## 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 <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/ai-hub-icon.svg" alt="AI Hub icon" class="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**.

    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/birthday-promotion.png" class="full" alt="Example of birthday promotion content">
    <figcaption>Example of birthday promotion content</figcaption>
    </figure> 

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. 

    
   <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).

   </div></div></div>
 


8. In the **Items** section, define a product catalog and a filter -  specifying the products that will be discounted.
    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/catalog-product-filter.png" class="large" alt="Example of a catalog filter with products from specific categories">
    <figcaption>Example of a catalog filter with products from specific categories</figcaption>
    </figure>

    
   <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   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.

   </div></div></div>
 

   <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/catalog-filter.png" class="medium" alt="Catalog filter">
    <figcaption>Catalog filter</figcaption>
    </figure>

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/simple_push).


<div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

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!

</div></div></div>



<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/birthday-mobile-push.png" class="large" alt="Example of mobile push notification">
<figcaption>Example of mobile push notification</figcaption>
</figure>

## 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**. 

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/birthday-workflow.png" class="large" alt="Final configuration of a workflow that sends a mobile push to customers whose birthday is on the current day">
<figcaption>Final configuration of a workflow that sends a mobile push to customers whose birthday is on the current day</figcaption>
</figure>

## 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.


## 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)




