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 Great Use Cases for Marketo Tokens post.
What are Trigger Tokens in Marketo?
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:
{{trigger.Trigger Name}}
which is the name of the trigger that caused the smart campaign to run{{trigger.Name}}
is the object related to the trigger e.g. the form name for a fills out form event (see the sections below for examples) or in the case of custom activities then it is the primary attribute value of the custom activity (see the Marketo Custom Activities Quick Start post).
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.
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.
Marketo Trigger Tokens in Flow Logic
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:
- {{trigger.Trigger Name}}
- {{trigger.Name}}
- {{trigger.Web Page}}
- {{trigger.Client IP Address}}
- {{trigger.Referrer}}
- {{trigger.Search Engine}}
- {{trigger.Search Query}}
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.
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).
Wondering what that “CAPTCHA Normalized Score” is and how you can use it to filter out bot submissions to your forms? Then check out the Marketo SPAM Filter with CAPTCHA Integration post.
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.
Marketo Trigger Tokens with Custom Activities
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.
Check out the Marketo Custom Activities Quick Start post to get an in-depth look at custom activities and concepts such as the primary attribute value.
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.
Marketo Trigger Tokens in Webhooks
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.
N.B. If you want to learn how to set up webhooks in Marketo, see different use cases, and how to troubleshoot issues then check out the Marketo Webhook Guide with Examples.
{"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. If you want to learn more about sending webhooks from Marketo to Slack then check out the Marketo Slack Integration post.
What’s Next After Marketo Trigger Tokens
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.
Since webhooks and custom activities played a big part in this blog post you should check out these posts below if you want to master these concepts: