Add delivery schedule type to link UTM parameters
The Braze REST API returns the delivery schedule type of a campaign or Canvas as
schedule_type. This example uses a Content Block to retrieve that value through Connected Content, then references that Content Block from an email link template so every link in the message carries the value as a query parameter.
About this example
MovieCanon, a fictional movie streaming service, sends scheduled, action-based, and API-triggered email. The analytics team wants to compare click performance by delivery type in their web analytics tool, without asking the marketing team to enter a UTM value by hand for each campaign.
Supported personalization tags don’t include delivery schedule type. Use schedule_type from the Export campaign details and Export Canvas details endpoints instead, with values such as time_based, action_based, or api_triggered.
This example combines the following Braze features:
- Connected Content calls the export endpoint for the message that’s currently rendering and saves the response.
- A Content Block wraps that call so it’s maintained in one place and returns only the
schedule_typevalue. - An email link template uses the Content Block as a query parameter value, so the parameter is appended to the links in your email.
Use the same approach for other campaign or Canvas metadata returned by these endpoints, such as name or tags.
Considerations
- Confirm link templates are available. If Email Link is missing from Templates in your dashboard, contact your customer success manager to have the feature turned on.
- Use this pattern for workspaces with many campaigns. If you send a small number of campaigns, entering a static query parameter value in each message avoids the API dependency entirely.
- Treat the REST API key as a secret. Store it as a Connected Content credential rather than pasting it into message or Content Block bodies, and never share it in screenshots, tickets, or exported message HTML. If a key is exposed, create a replacement key and remove the old one.
- Use the correct Liquid tag for Canvas. In a Canvas Message step,
{{campaign.${api_id}}}returns the step ID. Call the Canvas endpoint with{{canvas.${api_id}}}and thecanvas_idparameter. For a full mapping of these attributes, see Campaign and Canvas attributes across sources. - Plan for API volume. Braze doesn’t rate limit Connected Content itself, so request volume scales with your sends and can exceed your recipient count. A single email can be rendered more than once (HTML, plain text, and AMP). Both export endpoints draw on a shared limit of 250,000 requests per hour across many REST endpoints. Because
schedule_typeis identical for every recipient of a message, set:cache_max_ageto reduce calls. See Caching responses. - Keep the rendered value on a single line. Query parameter values can’t contain line breaks or spaces, so strip whitespace from your Content Block output. Otherwise, the URL can be malformed and the click may not be tracked as expected.
- Expect an empty value when calls fail. If the endpoint is unreachable, Braze renders an empty string, so the link is still clickable but the parameter has no value.
- Keep sensitive data out of query strings. Query parameters are visible to recipients and are often passed to third-party analytics tools.
- Plan for plain-text clicks separately. Link templates aren’t applied to plain text, so clicks from the plain text version of an email won’t include these parameters.
Setup
Step 1: Create a REST API key with export permissions
- Go to Settings > APIs and Identifiers > API Keys.
- Select Create API Key and give the key a name.
- Grant the
campaigns.detailsandcanvas.detailspermissions. - Copy the REST endpoint shown on the tab, such as
https://rest.iad-01.braze.com. Use your own instance’s endpoint in the following steps.
Step 2: Store the key as a Connected Content credential
- Go to Settings > Connected Content.
- Select Add credential > Token authentication.
- Name the credential, such as
braze_export_token. - Add the header key
Authorizationwith the valueBearer YOUR-REST-API-KEY, then set the allowed domain to your REST endpoint.
For more about credentials, see Using token authentication.
Step 3: Create a Content Block that returns the schedule type
- Go to Content > Content Blocks.
- Select Create Content Block and select HTML code editor.
- In the HTML tab, add the following Liquid. The
captureblock andstripfilter remove the line breaks that make the code readable, so the Content Block renders only the value.
{% capture schedule_type %}
{% if canvas.${api_id} == blank %}
{% connected_content
https://rest.iad-01.braze.com/campaigns/details?campaign_id={{campaign.${api_id}}}
:auth_credentials braze_export_token
:cache_max_age 3600
:save details
%}
{% else %}
{% connected_content
https://rest.iad-01.braze.com/canvas/details?canvas_id={{canvas.${api_id}}}
:auth_credentials braze_export_token
:cache_max_age 3600
:save details
%}
{% endif %}
{{details.schedule_type}}
{% endcapture %}{{schedule_type | strip}}
- Select Done, then name the Content Block, such as
braze_schedule_type. The name populates the Content Block Liquid Tag you reference in the next step. - Select Launch Content Block.

Don’t add content after the final tag. Anything that follows it, including a trailing line break, becomes part of the URL when the Content Block is used in a link template.
Step 4: Create an email link template
- Go to Templates > Email Link.
- Select Create email link template and give the template a name, such as
Schedule type UTM. - Set Template Position to After URL.
- Add a query parameter with the key you want to report on, such as
utm_contentorschedule_type. - For the value, enter the Content Block Liquid tag from the previous step:
{{content_blocks.${braze_schedule_type}}}. - In the Template preview, confirm the parameter is appended as expected, then select Save.
To compare the two template positions, see Link templates.
Step 5: Apply the link template to your email
In the Content tab of the updated HTML editor or the drag-and-drop editor, select Link Management > Add a Link Template, select your link template, and then select Add.
Start every URL in your message with http:// or https:// so Braze recognizes it in Link Management. If your workspace uses link aliasing, you may need to add link templates again after you edit an existing message.
Step 6: Verify the rendered links
- In Preview & Test, generate a preview and select View details to open the Connected Content debugger. Confirm the response status is
2XXand thatschedule_typeis present. - Open the links in the preview pane and confirm the parameter value has no extra spaces, line breaks, or duplicate
?characters. - Send a test email, or duplicate the campaign and launch it to an internal audience, then confirm the value that reaches your analytics tool.