Skip to main content
Marketing AutomationMarketing Tips and Tricks

TechTips: Using Velocity Scripting for Content Customization

By August 20, 2019September 23rd, 2020No Comments

There are many ways to customize content in Marketo, but one of the coolest ways I have found is using Marketo’s velocity scripting — more so being able to use velocity scripting to customize My.Tokens. What I’m talking about is Tokenception! Yes, you heard me right Tokenception – being able to put tokens inside of tokens. 

While using velocity to add tokens inside of tokens is fantastic, there are a couple limitations — you can only use lead tokens – you cannot use system, program, or  Tokens” inside the script.  

In this example we will be creating a text token with a brief message to use throughout our program. But we also need to include the Person’s first name in the message, which is where we will add our velocity script token. 

You will need to create: 

  • A program 
  • An email 
  • A “Text” token (See {{my.firstleveltoken:default=Friend}} below). 
  • An “Email Script” token (See {{my.nestScript}} below). 


1.  Edit your message in the Text token,{{my.firstleveltoken:default=Friend}}. Wherever you want the velocity script token you will create a unique name prefaced with a “$”. In this sample we will be using “$Name”. Save your Text token.

Sample text Below 

“How is it going, $Name? Are you ready for the webinar, May 12th?” 

2.  Next, edit your Email Script token. Select the field you will use for the Email Script token. Drag and drop it into the Edit Script Token window. Wrap your Email Script token with the code below to set the variable for “$Name”. Save your Email Script token.

Sample text Below 

“#set($Name =  ${lead.FirstName})”  

3.  Finally, place your Text token within your email, and test the output of your Email Script token within your Text token.


Congratulations, you know have personal content inside your tokens! 

While this is one of my favorite things to do with velocity scripting it’s not the only thing it can do. Velocity can also perform mathematical calculations, manipulate data, format dates, and more. 

To learn more, stay tuned in the coming weeks for a more in-depth blog on velocity scripting from Mckell Cousins. In the meantime, you can check out Marketo’s documentation on email scripting, Apache’s Velocity Scripting Docs, or you can Contact Us to create your personalized Velocity Scripts. 

Solomon Solution

At Solomon, we believe every lead, contact, and opportunity is more than a transaction – they’re relationships that need to be nurtured far beyond a single campaign or transaction. We are an engagement design firm that focuses upon the real motivators for strong customer engagement and we deliver actionable solutions and company-wide marketing strategies. Solomon Solution uses innovative products and expert consulting services to transform your customer engagement journey – from initial spark to advocacy.