Using Policy for Engagement Tracking

March 26, 2020 Contributors

To enable or disable engagement tracking for a specific message, you can use policy to override the X-MSYS-API header and configuration option. In addition, engagement data specified in the policy’s context variables will take precedence over the corresponding X-MSYS-API header fields. For details about engagement tracking for SMTP injections, see Tracking Engagement for SMTP .

The following context variable are used for engagement tracking in SMTP injections. These context variables must be set before or during the validate_data_spool_each_rcpt phase.

Note that context variables are always strings.

Context Variables

smtpapi_campaign_id

Name of the campaign to associate with the SMTP message

e.g.: "black friday"

smtpapi_click_tracking

Whether click tracking is enabled or disabled for the SMTP message

e.g.: "1" or "0" or "true" or "false"

smtpapi_click_tracking_scheme

Set the hyperlink scheme to use for click tracking links in the SMTP message

smtpapi_metadata

JSON key value pairs associated with the SMTP message

Metadata is available during engagement events based on a configuration option. See “engagement_tracker – HTTP Engagement Tracking”.

e.g.: "{"key" : "value"}"

smtpapi_open_tracking

Whether open tracking is enabled or disabled for the SMTP message

e.g.: "1" or "0" or "true" or "false"

smtpapi_open_tracking_scheme

Set the hyperlink scheme to use for open tracking links in the SMTP message

smtpapi_tags

Array of text labels associated with the SMTP message

e.g.: "["cat", "dog"]"

smtpapi_tracking_domain

Set the tracking domain to use in the hyperlink for the SMTP message

smtpapi_tracking_link_expiry

Set the expiration time for engagement tracking for the SMTP message

Note

The smtp auth module sets the connection context variable mo_customer_id. Lua policy may also set this context variable, and it will be honored by the smtpapi module. There is no X-MSYS-API header equivalent for customer_id.