Randomise snippets used in nurture program emails | Community
Skip to main content
Paul_Raybould
New Participant
January 14, 2019
Solved

Randomise snippets used in nurture program emails

  • January 14, 2019
  • 1 reply
  • 5452 views

Hi all, I'm hoping someone can help with the following.

I've created a folder of snippets that contain very short messages to promote the various products and services of our company.

Our nurture program emails promote relevant content but I'd also like to add a randomly assigned snippet to every email that goes out that contains a sales note such as 'Take a look at our upcoming events at...' for example.

I understand I will need to use Velocity but have not knowledge/experience of using this.

Can anyone advise as to how to add snippets to each nurture program email in a way that will randomly show one of the snippets in every email that is sent/

Thanks,

Paul

Best answer by SanfordWhiteman

Hi Sanford.

I put the following in to an email script token, then sent myself an email test that included that token. The email was delivered but there was just blank space where the token should have been.

I can't see the syntax highlighter above when creating an email  script token.Iis that why it's not working for me?

Is there a software/website you use to insert the syntax highlighter before pasting it in to the email script token?

Thanks again for your support. It feels like I'm very close to being able to do this.

#set( $random = $math.random(0,3) ) 

#set( $linkText = { 

0 : 'QS runs a number of global events for HE professionals, including <a href="reimagine-education.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">Reimagine Education</a> and <a href="edudatasummit.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">The EduData Summit</a>. <a href="qs.com/higher-education-tl-conferences/?utm_source=nurture&utm_medium=email" target="_blank" id="">Click here for more information and to view our events</a>.', 

1 : 'Does your institution want to recruit more students? Check out <a href="qs.com/solutions/online-marketing/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS’ online advertising</a> options or <a href="info.qs.com/2019-01-14-Advertising-Options-and-Call-Back-Request_01-Landing-Page-with-Form.html" target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.', 

2 : 'Is your institution looking for ways to differentiate from its competitors? Take a look at <a href="qs.com/solutions/research-intelligence/qs-stars/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS Stars</a> or <a href="info.qs.com/2019-01-14QSStarsandCallBackRequest_01LandingPage.html" target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.' 

}) 


I can't see the syntax highlighter above when creating an email script token.Iis that why it's not working for me?

The syntax highlighter is for here in the Community, not in Marketo! Click the name of the thread to open the full thread page, then when you reply you can see the Advanced Editor link at the upper right:

When you paste code without highlighting it, the Jive Community platform makes it unreadable. It needs to be in monospace (Courier) and laid out the way the syntax highlighter does it:

#set( $random = $math.random(0,3) )

#set( $linkText = {

  0 : 'QS runs a number of global events for HE professionals, including <a href="https://www.reimagine-education.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">Reimagine Education</a> and <a href="https://www.edudatasummit.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">The EduData Summit</a>. <a href="https://www.qs.com/higher-education-tl-conferences/?utm_source=nurture&utm_medium=email" target="_blank" id="">Click here for more information and to view our events</a>.',

  1 : 'Does your institution want to recruit more students? Check out <a href="https://www.qs.com/solutions/online-marketing/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS’ online advertising</a> options or <a href="http://info.qs.com/2019-01-14-Advertising-Options-and-Call-Back-Request_01-Landing-Page-with-Form.html" target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.',

  2 : 'Is your institution looking for ways to differentiate from its competitors? Take a look at <a href="https://www.qs.com/solutions/research-intelligence/qs-stars/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS Stars</a> or <a href="http://info.qs.com/2019-01-14QSStarsandCallBackRequest_01LandingPage.html" target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.'

})

There's nothing actually wrong with your code, you just forgot to output anything. Add:

${linkText[$random]}

1 reply

SanfordWhiteman
New Participant
January 14, 2019

Have you read this blog post?

     Lightweight A/B testing using Velocity

Paul_Raybould
New Participant
January 14, 2019

Thanks for this.

So would I need to add the name of each snippet instead of the subject lines to make this work?

SanfordWhiteman
New Participant
January 14, 2019

Ah, no. You can't switch literal snippets (as in Snippets™) this way.  You would be switching between blocks of text included in the Velocity token.

If you truly must switch between predefined Snippets™ then you'd need to embed all the snippets in the email, then wrap each one in Velocity tokens that either output nothing or output HTML <!-- and --> around the ones to hide. I've done this before but it's pretty envelope-pushing if you're not comfy in Velocity.

The other way to go about this is to create a special segmentation to manage the random cohorts (i.e. use Random Sample to sort people into a set of Static Lists, then segment based on Member of List). This would allow you to use Dynamic Snippets™ in the typical fashion.