For Cloud app templates, you must manually add the required UTM and custom tracking parameters to links in the template. You must also manually add the impression and click callback URLs for impression and click tracking.
Impression and click tracking
Blueshift supports impression and click tracking for Cloud app templates, but they are not automatically tracked (like for emails). Instead, we provide impression and click callback URLs that you can include in the payload.
- Impression URL - {{tracking.impression_url}}
- Click URL - {{tracking.click_url}}
Blueshift records an impression or click when an HTTP GET request is issued to the respective URL.
UTM and custom tracking parameters
For Cloud apps templates, tracking parameters are not automatically appended to links in the templates. You must manually append the parameters to the links in the Cloud app template.
You can access the tracking parameters that would be present during campaign execution through the {{tracking_params}} Liquid variable.
Option 1:
Use the following Liquid variable to specify each of the tracking parameters individually:
- utm_campaign: {{tracking_params.utm_campaign}}
- utm_source: {{tracking_params.utm_source}}
- utm_medium: {{tracking_params.utm_medium}}
In the following example, the tracking parameters are added to the action_web_target URL.
"action_web_target": "https://www.demosite.com/whatsnew?nwmsgid={{message_uuid}}&utm_campaign={{tracking_params.utm_campaign}}&utm_medium={{tracking_params.utm_medium}}&utm_source={{tracking_params.utm_source}}"
Option 2:
The Liquid variable {{tracking_params}} is a hash and you can set the value of the entire {{tracking_params}} payload to an attribute by first converting it to a JSON string and then base64 encoding it.
For example:
"tracking_params": "{{tracking_params | json | base64_strict_encode}}"
When you receive the payload from a campaign, you must then base64 decode the string and JSON parse the resulting value to get the complete hash of tracking parameters and then orchestrate any tracking of these parameters.
Note
When you preview the template or test send the template, there is no campaign context available and so any {{tracking_params}} will render as blank. You must run a test campaign to preview the rendered parameters.
Comments
0 comments