Marketo trigger tokens are a powerful way to extract information about the event that caused a smart campaign to run. This blog post will walk through three examples that show you how to use this information to populate fields, extract field values from custom activities, reduce the number of smart campaigns you create, and send trigger context via webhooks.
N.B. If you are looking for a general introduction to Marketo tokens and how they can save you time when building your emails, webhooks, and smart campaigns then check out the Example Use Cases for Marketo Tokens post.
Marketo trigger tokens are tokens available for use in smart campaign flows and webhooks that contain information related to the activity that triggered a smart campaign to run.
Basically, if there is a smart campaign trigger for an event in Marketo then at the very least there will be two trigger tokens available:
In the Marketo documentation there is a list of triggers which have more trigger tokens available e.g. email, form fill, and web page visit activities. I recommend taking a look at this list to see the trigger tokens that are available for you to use for each trigger.
Trigger tokens available for different triggers in Marketo
In the sections below I will give you examples of what sort of information is available via trigger tokens and how you can use this information in smart campaign flow logic, in webhooks, and to extract field values from custom activities.
In this example I use the visit web page trigger in the smart list with change data value steps in the flow to show how you can set field values equal to trigger tokens and to show you all of the trigger tokens that are available for this activity:
Looking at the results tab it is noticeable that the {{trigger.Name}} is the same as the {{trigger.Web Page}}, which makes sense since the web page is the object of the trigger.
Smart campaign to transfer trigger tokens to fields
Fields set equal to trigger token values
Aside from simply setting field values equal to trigger tokens, you can also use these trigger tokens within conditional logic in your flows. Unfortunately, you cannot use trigger tokens within flow choices directly so you have to use a “Dummy” field to store the trigger token context and then use this field value in your flow choices.
In one of our MQL campaigns we trigger on certain form fills and then use the “Dummy” field in the choices of the Change Data Value flow step to decide what value to set a person’s MQL Source Detail field to based on the form they filled out (since the form name is in the Dummy field via the {{trigger.Name}} token).
Trigger tokens used in flow logic
The advantage of using trigger tokens in this way means we can have a single smart campaign for many forms to set the MQL Source information instead of having 1 smart campaign for each form. This is especially useful when almost all the same flow actions need to be done for a form (or any asset in general) except one action that needs to be done differently based on the form, which is where trigger tokens can be used in choices.
The same principle can be applied to using 1 smart campaign for different triggers, when almost all the same flow actions need to be done for a trigger except one action that needs to be done differently based on the trigger.
Arguably the most valuable thing I have gotten from Marketo trigger tokens is the ability to extract field values from custom activities and either store them in a field or use them in flow action choices. As mentioned in the “What are Trigger Tokens in Marketo?” section above, the {{trigger.Name}} value for a custom activity will always be the primary attribute value.
If you are unfamiliar with custom activities just know that the primary attribute value is the default constraint that is present when you drag a custom activity into a smart list e.g. the “timestamp” field in the image of the purchased number trigger below.
Custom activity fields with the primary attribute value denoted by an asterisk
If your custom activity has more fields than the primary attribute value then you can extract these field values (and the primary attribute value too btw) using the {{trigger.field name}} trigger token where you would replace “field name” with the name of the custom activity field e.g. {{trigger.quantity}} in the example below.
Smart campaign used to store custom activity field values in fields
Fields set equal to trigger token values
The last example I want to show you is how you can send trigger tokens in Marketo webhooks to provide context about the event that triggered a webhook. The setup is pretty simple, the trigger tokens you want to include in the webhook just need to be included within the “Payload Template” when configuring the webhook.
Slack webhook configuration
{"text": "\n\nContact Sales Form Fill\n\n Trigger Name: {{trigger.Trigger Name}}\n Name: {{trigger.Name}}\n Web Page: {{trigger.Web Page}}\n IP Address: {{trigger.Client IP Address}}" }
The webhook in this example sends a message to Slack containing information about the form fill that triggered the smart campaign to run.
Message sent to Slack
Smart campaign used to send the webhook to Slack
Setting of fields equal to trigger tokens and sending of the webhook
Now that you have a taste for what you can do with Marketo trigger tokens you should take a look at your smart campaigns and webhooks to see if you can optimize them based on the three examples I gave above. Or maybe you can unlock completely new things for your team!
If you want to use these trigger tokens in your Marketo emails and email templates then you should check out the Marketo Email Template Quick Start guide to see how embedding tokens in your emails can reduce the number of emails you need to build and maintain.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.