Subscription for a product in mobile app

Published January 10, 2023
Modules
Difficulty
Selected Clients
zabka logo

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

  • 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 an Automation after the client buys coffee and resets at midnight.

  1. 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 module, if you are a Synerise customer or partner, consider reading the section about denylisting events. 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 checking the subscription status.

  2. Create a segmentation eligible for the subscription based on the previously created aggregate.

  3. Create a promotion in Synerise, that reduces the subscribed item’s price to zero for the customer.

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

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.

Important: 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 Analytics icon Analytics > 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.

  5. From the Choose event dropdown list, select the subscription.status event.

  6. As the event parameter, select segment_enabled.

  7. Click +where and choose the segment_enabled parameter.

  8. From the Choose operator dropdown list, select Equal.

  9. As the value set up 1 (it means that it is active).

  10. Define the period from which the aggregate will look up event data - in this case, it is Lifetime.

  11. Click Save.

Configuration of the aggregate
Configuration of the aggregate

Create a segmentation


Create a segmentation of customers based on the results of the aggregate you created 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 Analytics icon Analytics > 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.

  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 Communication > Promotions > Add promotion.

  2. Select the For selected items option.

  3. In the Audience section:

  4. Choose the segment created previously.

  5. Click Apply.

  6. In the Content section:

  7. Add the name in the Display name.

  8. In the Price field, enter 0.

  9. In the Long description add the names and SKU’s of products which price should be reduced to zero (in this case coffees).

  10. Define the name and description of the promotion.

  11. Confirm the settings by clicking Apply.

  12. In Type & limits section:

  13. Choose the Custom type.

  14. Choose the Multibuy sub-type.

  15. Define the number of usages per activation as 1.

  16. Define distribution period in the Schedule section and publish the promotion to apply all changes and run the promotion.

  17. 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 or second 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 icon Automation > 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:

  2. From Choose event dropdown menu, choose client.removePoints event.

  3. Click the + where button, from the Choose parameter dropdown menu, choose promotionUuid.

  4. From the Choose operator dropdown, choose Equal (String).

  5. In the next field, type the UUID of the promotion that you created earlier.

  6. 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.
  3. 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.
  4. Click Apply.

Add the finishing node


  1. Add the End node.

  2. In the upper right corner, click Save & Run.

The workflow configuration
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:

  3. Set the Run trigger option to repeatable.

  4. Set the interval to 1 per day.

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

  6. Select the time zone.

  7. In Define audience, choose New Audience and click Define conditions.

  8. As the first condition, from the Choose filter dropdown menu, choose the subscription.status event.

  9. Click the + where button, choose segment_enabled, and then select Equal. As the value, enter 0

  10. Set the time range to Last 1 day before 1 day.

  11. As the second condition, from Choose filter dropdown menu, choose the subscription.active attribute and then select Equal. As the value, enter 1.

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

  3. In the Body section, define the parameters of this event. In this case, it is:


{"segment_enabled": "1"} 

This re-adds the customer to the segment of customers eligible for a coffee on this day.

  1. Click Apply.

Add the finishing node


  1. Add the End node.

  2. In the upper right corner, click Save & Run.

The workflow configuration
The workflow configuration

Request from cash register


After using one of the methoddescribed in the promotion section - when customer buy a coffee, the cash register sends a request about promotions (read more). If the cash register sees in the answer that customer has an active subscription, after processing the transaction, redeem 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:

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

Read more


😕

We are sorry to hear that

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

😉

Awesome!

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

Close modal icon Placeholder alt for modal to satisfy link checker