Marketing AutomationMarketing Tips and Tricks

TechTips: Using Velocity Scripting for Content Customization

By August 20, 2019 April 14th, 2020 No 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. 

Kele Powell

Kele Powell

I came to Solomon with an analytical mindset. I like to see issues and try to break down the problem/ solution into a set of logical steps. This works well with other members of the team as we can all play to our strengths and come up with unique solutions. I love the fact that everything we do has a big impact. I also enjoy that if I have an idea I am heard out and it is very easy to run tests to validate my idea. Everyone on the team shares a common drive. We all want to innovate and make processes better.