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.

 
3532
10
10 Comments
gergana
Level 3

Hi Tyron,

This is a fantastic guide on using Trigger Tokens!

I’d like to know if it’s possible to use them for changing program statuses as well. We have several programs with similar setups for updating statuses (e.g., Trigger "Opens Email" -> Change Program Status to "Email Opened", clicks a link with a specific UTM -> Change Program Status to "Content Viewed", etc.).

I'm looking for a way to automate this process at a higher level, so we don’t have to activate the "change program status" Smart Campaigns for every program we launch. Ideally, we'd like to create a single Smart Campaign that updates statuses across different programs.

Thanks,
Gergana

 

Vinay_Kumar
Level 10 - Community Advisor

Marketo trigger tokens are like little secret codes that unlock a world of dynamic personalization and automation. By leveraging trigger tokens, marketers can create customized messaging and experiences based on specific actions or events, enhancing engagement and relevance for their audience.

SanfordWhiteman
Level 10 - Community Moderator

@Vinay_Kumar this seems AI-generated, let’s try to stay on topic for the OP.

 

@gergana you can’t change the Program Status to {{lead.Some Field}}.

 

Even if Some Field contains the exact Program Status label like “Webinar > Registered” or just “Registered”, that won’t work because under the hood the Change Program Status flow step uses the system-generated Status ID. And it won’t translate your (text) token to the (numeric) ID. (This can be confusing because with the REST API, Marketo will do that translation from text label → underlying ID automatically. But things work differently in the UI.)

gergana
Level 3

Hi @SanfordWhiteman,

Thank you for your response. I’ve tried several different approaches but haven't found a solution, leading me to the same conclusion. I was hoping there might still be some way to accomplish it nonetheless. 🙂

SanfordWhiteman
Level 10 - Community Moderator

Well, there is a way, but only if you incorporate a webhook-compatible service. Not within Marketo proper. We do this for the very similar task of running Add to SFDC Campaign based on a value stored in a {{lead.token}}.

gergana
Level 3

In this case you're updating directly the Campaign member status in SFDC and not the program status in Marketo first?

SanfordWhiteman
Level 10 - Community Moderator

Correct.

gergana
Level 3
Thanks @SanfordWhiteman! I'll speak with our IT team in order to understand if we can persue this approach.
Just one last question: So in this case, we are changing the campaign member status in SFDC, which will sync with Marketo afterwards. What about the "progression steps" of the program status? This (Marketo) logic won't apply in this specific case, right? To maintain the hierarchy of statuses, we need to consider this beforehand and avoid updating the campaign member status through the webhook if it's a "lower" status than the current one, correct?
 

P.S. Please let me know if you think it's better to open a new discussion, as we might be going off-topic from the original request/post. 🙂

SanfordWhiteman
Level 10 - Community Moderator

Feel like we're talking about 2 different things. 

 

If the Program is synced with an SFDC Campaign, you can't use the webhook-to-Request Campaign API method because it uses the Add to SFDC Campaign flow step, and Marketo disables that step for synced Proggies.

 

But if the Program is synced with an SFDC Campaign you can use a webhook-to-Sync Program Member API, which flips the Program Status directly.

 

So there's always a way once you incorporate the loopback via API.

gergana
Level 3

Thanks for the clarification. I am not at all expert on APIs, so these dynamics are new to me 🙂