Example Use Cases for Trigger Tokens

Tyron_Pretorius
Level 9 - Champion Level 9 - Champion
Level 9 - Champion

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.

 

 

What are Trigger Tokens?

 

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.

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.

 

Tyron_Pretorius_0-1708397914936.png

 

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.

 

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.

 

Tyron_Pretorius_1-1708397914753.png

 

Tyron_Pretorius_2-1708397914817.png

 

Smart campaign to transfer trigger tokens to fields

Tyron_Pretorius_3-1708397915012.png

 

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).

 

Tyron_Pretorius_4-1708397914714.png

 

Tyron_Pretorius_5-1708397914860.png

 

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.

 

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.

 

Tyron_Pretorius_6-1708397914743.png

 

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.

 

Tyron_Pretorius_7-1708397914745.png

 

Tyron_Pretorius_8-1708397915008.png

 

Smart campaign used to store custom activity field values in fields

Tyron_Pretorius_9-1708397914821.png

 

Fields set equal to trigger token values

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.

 

Tyron_Pretorius_10-1708397914823.png

 

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.

 

Tyron_Pretorius_11-1708397914753.png

 

Message sent to Slack

Tyron_Pretorius_12-1708397914867.png

 

Tyron_Pretorius_13-1708397914944.png

 

Smart campaign used to send the webhook to Slack

Tyron_Pretorius_14-1708397914811.png

 

Setting of fields equal to trigger tokens and sending of the webhook

What’s Next After 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.

 
3596
10
10 Comments