• Homepage
  • Blog
  • How Jinjava can help you optimize your communication in Synerise

How Jinjava can help you optimize your communication in Synerise

10 min read
How Jinjava can help you optimize your communication in Synerise

In Synerise CDP, we collect data about your clients to create a 360 profile. We have AI-powered analytics to gain insights from the collected data and use it to optimize & personalize our omnichannel campaigns. Jinjava can help you achieve that. It enables you to personalize interaction with your customers by referring to content created and stored in various platform modules.

What is Jinjava? 

Jinjava is a Java-based template engine based on the Django template syntax, allowing the separation of application logic from its presentation layer. The principle of Jinjava operation is placing tags in the content’s source files. The tags are then replaced with content generated by the application. The system allows the use of control structures (tests (if), loops (for), and so on). It comes with an easy-to-use filter system. 

Jinjava in Synerise – practical usage

The most popular places in which you can use jinjava in Synerise are: 

  • Inserts – used in communication module as a reference to created earlier analytics or AI recommendations. They can be used for example, if you want to personalize your email with the client’s name, adding the value of your client's last transaction or the number of loyalty points.
  • AI recommendations campaigns with a specific context (for example presenting products from a specific brand),
  • Automation module.

It is worth noting that based on jinjava you are able to create consistent, omnichannel communication. By collecting information about a specific customer, you can create the best customer experience on different channels. All of that - keeping the client's context (e.g., his last visited pages, bought products, favorite categories) based on which you can create personalized communication with him at every touchpoint.

In this article, we will describe the most frequently used examples of jinjava in Synerise Platform, and we will show you a few use cases based on this solution which can be a great inspiration for your business.

Inserts in your Communication module 

Jinjava is extremely useful in the communication module. By using inserts, you can add content already created in various modules of the platform – analytics, recommendations, and code pools.  

Let’s see what kind of analytics can be added to your communication based on Jinjava and in which cases they might be used: 

Expressions 

Expressions allow you to create your own indicators based on mathematical formulas or calculations for both profiles and events. Jinjava helps us make a connection between created analysis and add it to the communication message, for example – loyalty points.  

The basic syntax looks like this:  

{% expression %} expression-hash {% endexpression %} 

Example of use:

An expression that shows the value of an abandoned cart.  

Output: 

Total amount: 345$ 

Aggregates 

An aggregate is prepared with the intention of analyzing the actions of an individual customer. Thanks to Jinjava, you can use it in your communication and analyze the number of actions made by specific customers and present the personalized number, different for every user (for example, product added to cart or top viewed products by specific customer). 

Syntax: 

{% aggregate aggregate-hash %} 

  {{ aggregate_result[0] }} 

{% endaggregate %} 

Example of use: 

An aggregate that stores a list of categories that have recently been added to the cart. 

Output:

Home, Sports, Toys, Electronics

Metrics

In Synerise, we have two types of metrics. Simple metrics allow you to analyze events or customer attributes. You can create analyses that calculate the number of event occurrences, the sum, average, median, quantiles, and minimal and maximal values of events or customer attributes. You can also analyze events by time of occurrence. Formula metrics allow you to create an analysis based on the mathematical operations between events and customer attributes. The results of metrics are presented as numerical values.  Based on metrics, we create KPIs using formulas and calculation methods. 

Syntax:

{% metricsvar metric_id:metrics-hash %} {{ metric_result }} {% endmetricsvar %}  

Example of use: 

A metric that stores the value of products sold in the last 30 days. 

Output (metric result is 2356): 

2144 USD more to achieve the goal! 

Thanks to jinjava, you are able not only to get the specific value but also, to use the function “IF” to create a different version of result-based communication. 

Customer Attributes 

Access customer attributes, such as name, surname, email, and phone number, to use them as variables. By using those variables, personalizing content is possible, for example, using the customer's first name in the greeting at the beginning of an email. 

Syntax:

{% customer attr-name %}

Social proof

To create social proof, you need to create a metric with a dynamic key. To find out how to do it, read this article. Social proof is a great option to show, for example, how many products have been sold today in a dynamic content campaign, how many of them are in stock, or how many users are watching specific products right now. All those options can be useful in boosting the interest of customers and encouraging them to make a final transaction. 

Syntax:

{% socialproof %} metric-hash {% endsocialproof %}

Example of use: 

Presenting the number of times the product was added to the cart during the last 30 days. 

Code pools

Code pools can be useful in all campaigns in which you want to reward your customers with personalized discount codes. To find out what code pools are and how to create them, read this article.

Syntax:

{% voucher %} pool-uuid {% endvoucher %} 

Example of use:

A promotion code from a selected code pool can be added to your personalized campaign. This way, sending personalized discount codes to a specific group of your customers is possible. 

Resignation linkin email templates 

You can generate a URL that revokes the customer’s email communication agreement. 

Syntax:

{{ synerise-resign-link }}

If the email communication includes links, you can track their additional parameters (such as UTM) and click-related events. If your link is stored as a jinja variable and then used as a variable in HTML, you must use a preparelink tag to generate a link with the parameters. Check how to do it properly here

Recommendations

Thanks to jinjava, you can show a set of recommendations to the customer in your campaigns. Jinjava inserts help you create the connection with the AI campaign created before and place it in your message. The following code is an example of showing recommendations on a website or in a message.  

Syntax:

{% recommendations3 campaignId=campaign-hash %} {{recommended_products3}} {% endrecommendations3 %} 

Automation inserts

Jinjava can be used in the Automation module: in all action nodes, outgoing integrations, communication templates sent from the module, and in profile filters.

Personalizing attributes of your customers in automation might be available by adding the personalized subject of your message using jinjava code.  

You can also refer to the parameters of a specific Trigger or Event Filter node. Use this way of referring to params in Schema Builder and communication templates included in an automation workflow. The name of the node must be unique and cannot contain any special characters. The name is entered next to the node type. 

While defining the settings of a node, you can use data (event parameters) received in the preceding nodes in the diagram. This enables inserting dynamic values (for example, a customer’s name or ID) in the input of the following nodes in a workflow or a request in a webhook. It helps to make a connection with the event created during the workflow. Such reuse in automation is called the event context. 

The context of an event is kept in the {{ event.params }} Jinjava variable. This variable contains all parameters of the event from the preceding node (either Profile Event (a trigger) and/or Profile Event Filter (a condition)). 

At the beginning of the workflow, {{ event.params }} stores the context of an event from the trigger, it can be kept throughout the whole workflow and can be referred to at any moment unless the workflow contains a Profile Event Filter (which is the only node that changes the context). Then, {{ event.params }} takes over the event context from the Profile Event Filter node. You also can refer to event context from any trigger or Profile Filter in the workflow. Read more about this way of usage. 

Other options of use

  • Tests allow you to return true/false values depending on the tested value.
  • Jinjava filters let you perform operations on values, such as rounding or formatting. If a filter has more than one parameter, the parameters are listed in the order they need to be provided.
  • Extracting values from catalogs - this method lets you obtain a single value from a specific catalog.

Use cases based on Jinjava

If you have a basic knowledge of how jinjava is used in our platform, take a look at some of the use cases where this solution is used.  

Reuse the collected data about your customers to send personalized communication and help your customers find the best products for them. For this purpose, you can use the customer’s size (collected through transactions events) and send a message to the customers with the link to the discounted products in their size. 

It is worth remembering how important it is to analyze what users view on the website, what subpages they visit and how much time they spend there. Even if the users do not add anything to the basket, they can be reminded of the products they most often visited by sending them a personalized email. 

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. The described scenario involves sending customers products at a discounted price that the customer previously added to favorites and did not finalize the purchase. 

In Synerise, you can create several types of analytics that calculate customer actions within a workspace and use AI-powered recommendations to offer your customers exactly what they want. To make use of those features to the fullest, use them as inserts while creating content for your e-mails, website or even mobile. 

In conjunction with Jinjava engine templates, design complex conditions or convert the content of inserts into communication with customers.  

 

Are you inspired to learn more about this topic? Read more about Jinjava in our Help Center. 

Are you familiar with this topic? Go to our Certification Program and pass your certificate in Jinjava!