Create personalized videos using merge fields

Adding personalized video to email can lead to 50% open rates and 30% CTRs. With personalized content performing 202% better the case for personalization across all types of media is clear cut.

Traditionally it has been difficult to introduce personalized video content. It required an advanced understanding of command line tools such as FFmpeg or working with a specialized agency to create expensive one-off personalized video projects.

What are merge fields

Shotstack merge fields work the same way as how you would use mail merge fields when personalizing your email content. These merge fields provide for a convenient way to fill out a video template with fixed placeholders.

Using merge fields makes it easier to insert your dynamic data into your video templates. No need to add your own variables inside your workflow or application. Keep it all contained inside your template, collate your dynamic data into the merge array and add this to your render request.

How to use merge fields

For this example we'll use one of our Christmas templates but you can use merge fields with any template.

Merge fields are contained as an array within the merge property added to the main branch of your JSON. Each element in the merge array is an object containing a find and replace property.

{
"merge": [
{
"find": "FIRST_NAME",
"replace": "RALPH"
}
],
"timeline": {
...
}
}

By adding your find variable inside of your timeline using double curly brackets Shotstack automatically replaces these values with the values contained within your merge array. For example {{FIRST_NAME}}.

{
"asset": {
"type": "html",
"html": "<p>MERRY CHRISTMAS</p>",
"css": "p { font-family: \"Montserrat\"; color: #ffffff; font-size: 14px; text-align: center; font-weight: bold }",
"width": 450,
"height": 30
},
"start": 3.8,
"length": 3.4
},
{
"asset": {
"type": "html",
"html": "<p>{{FIRST_NAME}}</p>",
"css": "p { font-family: \"Amatic SC\"; color: #ffffff; font-size: 64px; text-align: center; font-weight: bold; }",
"width": 450,
"height": 100
},
"start": 4,
"length": 2.8
}

Merging your data into your video allows you to quickly and conveniently personalize your videos using your own dynamic data. Looking to merge advanced values such as start times? Take a look through the merging data documentation for an in-depth overview and more examples.

Derk Zomer

BY DERK ZOMER
29th November, 2021

Become an Automated Video Editing Pro

Every month we share articles like this one to keep you up to speed with automated video editing.