Skip to main content
All CollectionsIterable
Iterable - Handlebars Personalisation with Data Feeds
Iterable - Handlebars Personalisation with Data Feeds

How to properly add personalisation fields to your data feed

Updated over a week ago

Iterable has a very tidy solution for using Handlebars personalisation fields within data feeds. This may go without saying but at the risk of being pedantic, you'll need to ensure you've first read our article on setting up a data feed for what we're about to show you to make sense.

The three parameters

With a data feed set up, you'll need to add a few parameters to the URL that calls Jacquard for each Handlebars personalisation field you may use throughout the lifespan of the data feed.

The three parameters you'll need for each field are:

  • replacer_variable - The variable in the Jacquard language variant for which Iterable will search. You must URL encode the brackets for this variable.

  • replacer_value - Iterable will use this to replace what it finds from your replacer_variable.

  • replacer_default - This is the value Iterable will use if it doesn't find any data to display from the personalisation field you've selected.

Appending the parameters

Once you understand what each of those parameters is going to be used for, it becomes quite straightforward to decide what they need to contain.

You'll need to attach these to the URL field in the Edit data feed wizard.

As an example, let's say we wanted to use an Iterable Handlebars personalisation field in our Jacquard variant called firstName.

We would need to configure our data feed URL to contain the following parameters:

&replacer_variable=%7b%7bfirstName%7d%7d&replacer_value={{firstName}}&replacer_default=Supporter

Notice how the brackets for the replacer_variable have been URL encoded. If they are not URL encoded, Iterable will process the personalisation field and then be unable to find the processed data in the Jacquard variant.

The replacer_value has then been added as you normally would add a personalisation field to Iterable.

Finally, the replacer_default has been populated as Supporter. This will be used in case Iterable is unable to find any data in the firstName field for any subscriber in particular.

When added to our data feed URL, our example becomes:

https://realtime.phrasee.co/live/single_variant?campaign_id=633ef4e719717b0007555ef4&delivery_id={{messageId}}&recipient_id={{#urlEncode}}{{email}}{{/urlEncode}}&replacer_variable=%7b%7bfirstName%7d%7d&replacer_value={{firstName}}&replacer_default=Supporter

Multiple personalisation fields

If you're interested in using more than one personalisation field in your Jacquard variants, you can simply append another trio of parameters to the data URL as in the below example:

https://realtime.phrasee.co/live/single_variant?campaign_id=633ef4e719717b0007555ef4&delivery_id={{messageId}}&recipient_id={{#urlEncode}}{{email}}{{/urlEncode}}&replacer_variable=%7b%7bfirstName%7d%7d&replacer_value={{firstName}}&replacer_default=Supporter&replacer_variable=%7b%7bproduct%7d%7d&replacer_value={{product}}&replacer_default=Product

Ultimately, you can add as many personalisation fields as you like.

Using helpers with data feeds

If you need to use helpers on any of personalisation fields, you can do that as you normally would in the replacer_value parameter.

For example, let's say we wanted to ensure the first letter of every firstName is capitalised. We can simply add capitalizeFirst to our replacer_value just as we would in any other Iterable Handlebars use case.

See our example below:

https://realtime.phrasee.co/live/single_variant?campaign_id=633ef4e719717b0007555ef4&delivery_id={{messageId}}&recipient_id={{#urlEncode}}{{email}}{{/urlEncode}}&replacer_variable=%7b%7bfirstName%7d%7d&replacer_value={{capitalizeFirst firstName}}&replacer_default=Supporter

To learn more about how to use Handlebars and helpers to personalise content, check out Iterable's personalisation with Handlebars documentation.

Did this answer your question?