There are three types of ways you can pass variables into your notifications:
This document walks you through an example of using event values as variables in your notifications.
In this example, we will guide you through creating a triggered notification when someone views a product page but has gone inactive.
To paint a full picture, the first part we need to do is track an event that we are going to be using for this triggered notification. For this example, let's imagine you are tracking the following event when someone views your product page:
"category" : "Product",
"action" : "Viewed",
"label" : "Moonshine Premiums",
"value" : 15,
"lens" : "polorized",
"icon" : "https://cdn.shopify.com/s/files/1/1356/7869/products/affordable-sunglasses-black-moonshine-premiums-flyover_1024x1024.png?v=1562372323"
As you'll note above, the usual event tracking fields are present:
Beyond that, we also track a few variables we'd like to use
Note: These additional variables won't be stored for segmentation but can be used as variables within the push notification.
If done correctly, these events will start showing up in our event logs (Logs > Event)
Next up, we will create a push campaign that will be triggered based on the event above and pass in some variables. To dive in, let's show you how it's going to look at the end:
As you can see above, there are various ways you will be feeding in your event variables. As a quick map/breakdown follow this:
Whatever is in the parameter brackets with be replaced with the appropriate information. Additionally, worth noting that the use of "icon" or "image" within the event tracking function will replace the icon and image automatically.
So, in this case, the end result of the notification will look something like"