Skip to main content
All CollectionsSalesforce Marketing Cloud
SFMC - Personalisation AMPscript with Jacquard Experiments
SFMC - Personalisation AMPscript with Jacquard Experiments

A quick guide to using AMPscript to personalise your variants

Updated over a week ago

In order to use personalisation in Jacquard variants using our Salesforce integrations, you must set any AMPscript variables you plan to use in the body of your email. These AMPscript variables must be written in a specific format to work properly.

You'll need to do this because Jacquard already uses AMPscript to populate language variants. If you were to then include standard personalisation without these special measures in the variant itself, it would mean you have AMPscript in AMPscript. Salesforce Marketing Cloud cannot natively process that.

This can be a little tough to understand conceptually, so let's look at an example.

The basics

Let's say within your sendable data extension you have a column for first name personalisation called FirstName. To use this field within Jacquard variants, you would need to declare that variable in the body of the email in an AMPscript block first as in the below:

%%[
Var @FirstName
Set @FirstName = [FirstName]
]%%

Now that you've included that block in your email, you can use the following format to actually call the variable in your Jacquard variant:

%%=v(@FirstName)=%% 

So, let's say you want your variant to read:

Hey Matthew, you look great today.

You would enter the following as the subject line:

Hey %%=v(@FirstName)=%%, you look great today.

That is the simplest form of rendering a first name variable. Remember, you would need to replace our FirstName example with whatever your actual first name field is called (e.g. FIRST_NAME, fname, First Name, etc.).

Jacquard's standard Salesforce first name block

For Jacquard testing, we like to be able to test a bit more diversity with the usage of personalisation fields. It's important you discuss with your Customer Success Manager the personalisation fields you'd like to use so we can ensure we build them into your language model.

However, as first name is a pretty common field to want to use in language variants, we do have a standard first name block that allows us to play a bit with the placement and punctuation around first name.

This is the standard first name block for Jacquard projects you should include in your emails leveraging Jacquard language and first name personalisation:

%%[
var @FirstNameColon, @FirstNameComma, @FirstNameStop, @FirstNameSpace, @FirstNameCommaEnd
IF Empty([FIRST_NAME]) or length([FIRST_NAME]) < 3 THEN
SET @FirstNameColon = ""
SET @FirstNameComma = ""
SET @FirstNameStop = ""
SET @FirstNameSpace = ""
SET @FirstNameCommaEnd = ""
ELSE
SET @FirstNameColon = Concat(Trim(ProperCase([FIRST_NAME])),": ")
SET @FirstNameComma = Concat(", ", Trim(ProperCase([FIRST_NAME])))
SET @FirstNameStop = Concat(Trim(ProperCase([FIRST_NAME])),". ")
SET @FirstNameSpace = Concat(Trim(ProperCase([FIRST_NAME]))," ")
SET @FirstNameCommaEnd = Concat(Trim(ProperCase([FIRST_NAME])),", ")
ENDIF
]%%

Again, you'll need to replace our FIRST_NAME placeholder with your actual first name tag.

Ensure you tell your Customer Success representative you wish to include the standard Jacquard Salesforce first name personalisation merge tags in your language model.

Once you've included this block in your emails, you'll notice you have a variety of merge tags you can now leverage:

  • %%=v(@FirstNameColon)=%%

  • %%=v(@FirstNameComma)=%%

  • %%=v(@FirstNameStop)=%%

  • %%=v(@FirstNameSpace)=%%

  • %%=v(@FirstNameCommaEnd)=%%

When you generate subject lines in Jacquard, your language model will know of these available tags and use them accordingly to test diversity of language, placement, and grammar. They will look something like this:

Hey %%=v(@FirstNameColon)=%%you look great today.

If your AMPscript block is in place and configured correctly, Salesforce Marketing Cloud will render this as:

Hey Matthew: you look great today.

We ask that you include and leave these variables in your template so they are a constant that Jacquard can use to generate language.

It's also important to remember to choose the correct tag when you enter your human control into Jacquard if you want to use first name personalisation in your human control.

Keep in mind how each of the above tags will actually render with the following examples of proper use:

%%=v(@FirstNameColon)=%%check this out!

renders as...

Matthew: Check this out!

Hi%%=v(@FirstNameComma)=%%!

renders as...

Hi, Matthew!

Hi %%=v(@FirstNameStop)=%%😊 Check this out!

renders as...

Hi Matthew. 😊 Check this out!

Hey %%=v(@FirstNameSpace)=%%😊 check this out

renders as...

Hey Matthew 😊 check this out

Hey %%=v(@FirstNameCommaEnd)=%%check this out...

renders as...

Hey Matthew, check this out...

Did this answer your question?