Integration with Storyly
The user engagement platform Storyly 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.
Prerequisites
- Implement Synerise SDK in your mobile app.
- Implement transaction events using SDK or API.
- Implement Storyly SDK in your mobile app.
Process
In this use case, you will go through the following steps:
- Create an event expression.
- Create an aggregate.
- Create an expression.
- 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).
- In Synerise, go to Analytics > Expressions> New expression.
- Enter the name of the expression.
- From the Expressions for dropdown list, select Event.
- From the dropdown list, select
transaction.charge
event. - In the Formula definition section of the page, click Select.
Result: A dropdown list appears. - From the list that opens, select Function > Day of week.
- In the brackets, click the left Select button and from the list, select Event attribute.
- Click Unnamed in the brackets, to display the settings of the event attribute.
- From the Choose parameter dropdown list, select
TIMESTAMP
. - Save the expression.
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.
- Go to Analytics > Aggregates > Create aggregate.
- As the aggregate type, select Profile.
- Enter the name of the aggregate.
- Click Analyze profiles by and select Top.
- From the Choose event dropdown list, select the
transaction.charge
event. - From the Choose parameter dropdown list, select the expression created in the previous step.
- In the calendar in the right bottom of the page:
- In the Relative date range section, click Custom, type 365 and from the the dropdown list, select Days.
- Click Apply.
- Save the aggregate.
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. This expression will later be placed in the document retrieved by the application.
- In Synerise, go to Analytics > Expressions> New expression.
- Enter the name of the expression.
- Leave the Expression for option at default (Attribute).
- In the Formula definition section of the page, click Select.
Result: A dropdown list appears. - From the list that opens, select Profile.
- Click Unnamed to display the settings of the profile attribute.
- From the Choose parameter dropdown list, select the aggregate created in the previous step.
- Save the expression.
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.
-
Go to Data Management > Documents > Add document.
-
Enter the name for your document. Automatically, the field with a slug is filled as well. A slug is an ID of the document.
-
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.
-
Optionally, in the Description field, you can add a description of the document.
-
In the Content (JSON) section, paste the JSON code:
{ "storyly_fav_day": "{% expression %} insert the ID of the expression {% endexpression %}" }
-
Click Apply to save the document.
-
Click the icon and from the dropdown list select Versions.
-
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
- Android
- React Native. 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
- method for Android.
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 you can send from Storyly to Synerise, and how to send them.
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.
- Aggregate.
- Expression that returns the number of the week day of the
transaction.charge
event for specific customer.
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
- Aggregates
- Documents
- Expressions
- Inserts
- List of pre-defined events in Storyly’s SDK: