Marketo Trigger Tokens Example Usage

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.

Screenshot from the Marketo documentation showing the trigger tokens available 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.

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:

  1. {{trigger.Trigger Name}}
  2. {{trigger.Name}}
  3. {{trigger.Web Page}}
  4. {{trigger.Client IP Address}}
  5. {{trigger.Referrer}}
  6. {{trigger.Search Engine}}
  7. {{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.

Screenshot of the smart campaign trigger for visiting a webpage
Screenshot showing how field values can be set equal to trigger token values in Marketo
Smart campaign to transfer trigger tokens to fields
Screenshot of the smart campaign results tab showing how the field values were set equal to the trigger token values by the flow
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).

Screenshot showing the form fill trigger used in the MQL smart campaign
Screenshot showing how the form fill trigger tokens can be used in smart campaign flow logic in Marketo
Trigger tokens used in flow logic

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.

Screenshot of the fields on a custom activity in Marketo
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.

Screenshot of the custom activity trigger for purchasing phone numbers
Screenshot showing how custom activity field values can be extracted using trigger tokens in Marketo
Smart campaign used to store custom activity field values in fields
Screenshot of the results tab showing how the field values from the custom activity were stored in the fields
Fields set equal to trigger token values

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.

Screenshot of the webhook configuration in Marketo to send trigger tokens to Slack
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. If you want to learn more about sending webhooks from Marketo to Slack then check out the Marketo Slack Integration post.

Screenshot of the message in Slack containing the Marketo trigger tokens
Message sent to Slack
Screenshot of the form fill trigger used to cause the smart campaign to run to send the webhook to Slack
Screenshot of the flow showing fields being set equal to trigger token values and the sending of the webhook to Slack
Smart campaign used to send the webhook to Slack
Screenshot of the results tab showing fields being set equal to trigger tokens and the sending of the webhook to Slack
Setting of fields equal to trigger tokens and sending of the webhook

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:

Leave a Reply

Your email address will not be published. Required fields are marked *