Customize a template
You can customize a template for use in GenStudio for Performance Marketing by inserting content placeholders, or fields, that the generative AI uses to insert content.
The next few sections explain how to adapt your HTML templates for GenStudio for Performance Marketing by using the Handlebars templating language. The Handlebars syntax uses regular text with double braces as content placeholders. See in the Handlebars language guide to learn how to prepare your template.
Once your template is ready, you can upload it to GenStudio for Performance Marketing and start generating personalized emails based on your custom template.
Content placeholders
GenStudio for Performance Marketing recognizes certain elements within a template, but only if you identify them with a recognized field name.
Within the head or body of a template, you can use the Handlebars syntax as a content placeholder where you require GenStudio for Performance Marketing to populate the template with actual content. GenStudio for Performance Marketing recognizes and interprets the content placeholders based on the recognized field name.
For example, you can use {{ headline }}
with the Handlebars syntax to indicate where the headline of the email should be placed:
Recognized field names
The following table lists the field names recognized by GenStudio for Performance Marketing for population into templates. Add these field names using the Handlebars syntax to your template where you need GenStudio for Performance Marketing to generate content.
{{pre_header}}
{{headline}}
Meta ad
Display ad
{{body}}
Meta ad
Display ad
{{cta}}
Meta ad
Display ad
{{on_image_text}}
{{image}}
Meta ad
Display ad
GenStudio for Performance Marketing populates certain fields automatically in the following templates:
- Email template does not require you to identify the
subject
field - Meta ads template does not require you to identify the
headline
,body
, andCTA
fields - Display Ads template does not require you to identify the
CTA
field
There is a limit of 20 fields when uploading a template to GenStudio for Performance Marketing. Since the subject
field is automatically generated in an email, it counts as one field. This means that there are 19 fields allowed in an email template.
Brand logo field name
At this time, you cannot select the brand logo for the template upload. The following examples demonstrate two methods that conditionally render the brand logo. Each method verifies the source, provides a default or alternative image in case the brand logo is not available, and applies a style:
Example 1: Using Handlebars Built-in Helpers condition directly in the HTML img src
attribute:
<img src="{{#if brand_logo}}{{brand_logo}}{{else}}<default-image>{{/if}}" alt="img alt text" style="max-width: 88px; margin: 10px auto; display: block;">
Example 2: Using Handlebars Built-in condition statement to wrap the HTML img
tag:
Manual field names
All other field names are treated as manually populated fields.
To create an editable section, add double brackets around the section name:
Sections or groups
Sections inform GenStudio for Performance Marketing that the fields in this section require a high degree of coherence. Establishing this relationship helps the AI to generate content that matches the creative elements in the section.
Use a prefix of your choice in the field name to indicate that a field is part of a section or group. Use a field name (headline
, body
, image
, or cta
) after the underscore (_
). For example, the following headline and body belongs to the pod1
section:
pod1_headline
pod1_body
Each section can use only one of each field type. In the above example, the pod1
section can only use one pod1_headline
field. Because of this rule, the sections cannot be nested.
Each template type, such as email or Meta ad, has channel-specific constraints on the use of sections. See channel-specific guidelines in the Best practices for using templates topic.
For example, an email template can include up to three sections; therefore, you could have three headline and body sections:
pre-header
pod1_headline
pod1_body
pod2_headline
pod2_body
pod3_headline
pod3_body
cta
GenStudio for Performance Marketing understands that pod1_headline
is more closely related to pod1_body
than to pod2_body
.
See Structured prompts to learn how to craft a prompt that generates varying content for each section in an email.
Calls to action
A Call to action (CTA) includes a phrase and a link. For the CTA Rephrase and Add link capabilities to work properly during the variant generation process, you must include placeholders for the link and the phrase in your template.
Use the following guidance to set up CTA placeholders:
-
CTA rephrase is available and link is editable
code language-html <a class="button" href="{{pod1_link}}" >{{cta}}</a>
-
CTA rephrase is available, but link is not editable because actual link is provided in the template
code language-html <a align="center" href="https://link">{{cta}}</a>
-
CTA link is editable, but rephrase is not available because phrase is provided in the template
code language-html <a class="button" href="{{pod1_link}}" >Register now</a>
GenStudio for Performance Marketing can provide variant calls-to-action phrases, too. See Revise Call to action.
Template preview
When you upload a template, GenStudio for Performance Marketing scans the HTML file for recognized fields. Use the preview to review your template elements and confirm that you identified them properly with the recognized field names.
Example Preview for an email template:
Control preview
You can control the visibility of special content by using Built-in Helpers (special expressions in the Handlebars template language that perform certain actions). For example, you can add a conditional statement that adds tracking parameters to links in the exported template while keeping the preview links clean.
The _genStudio.browser
value is set when rendering a template, and the genStudio.export
value is set when exporting a template. You may decide to include certain content at the top of an email using a conditional wrapper, for example, when the template is used for export:
Another example may be to prevent the use of tracking codes when previewing a template in GenStudio for Performance Marketing. The following example shows how to add tracking parameters to links in the exported template, while keeping the preview links clean:
Static content
Email and Meta templates often link to images and CSS files hosted on other domains. When GenStudio for Performance Marketing generates thumbnails for template previews or the experiences derived from them, it validates the content source and embeds a copy for preview purposes.
External files are temporarily embedded only for the purpose of creating the template preview, which ensures that the preview accurately reflects the content as it appears at the time of creation. These external files are not stored permanently in GenStudio for Performance Marketing. After the template preview is created, GenStudio for Performance Marketing continues to reference the original source link provided in the template.
Refresh content
If the source changes after creating the initial preview, use the refresh function to update the template preview with the most recent version of the content from the external sources.
Template examples
The following is a basic example of an HTML template for an email that contains one section. The head contains simple, inline CSS for styling. The body contains a pre-header
, headline
, and image
placeholder for use by GenStudio for Performance Marketing to inject content during the email generation process.
code language-handlebars line-numbers h-13 |
---|
|
The following is the same HTML template in the example above, but with two more sections. The head contains inline CSS for styling a group. The body uses two groups with content placeholders using a prefix.
code language-handlebars line-numbers h-33 |
---|
|
The following is a basic example of a Meta ad template. The head contains inline CSS for styling. The body uses content placeholders using a prefix.
code language-handlebars line-numbers h-33 |
---|
|