Customize a template
Adapt your HTML templates for Adobe GenStudio for Performance Marketing by using the Handlebars templating language. The Handlebars syntax uses regular text with double braces as content placeholders. See What is Handlebars?
in the Handlebars language guide to learn how to prepare your template.
The next few sections explain how to add content placeholders, hide unnecessary elements from preview, and manage links to static content. 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
body
Meta ad
cta
Meta ad
on_image_text
image
Meta 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 idenitify 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. For example, you may want to spotlight content that appears in a highlighted area:
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.
A template can include up to three sections:
headline
body
pod1_headline
pod1_body
pod2_headline
pod2_body
GenStudio for Performance Marketing understands that pod1_headline
is more closely related to pod1_body
than to pod2_body
.
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:
{width="650"}
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 outside GenStudio for Performance Marketing. When GenStudio for Performance Marketing generates thumbnails for these templates or the experiences derived from them, it may ignore these external resources if they do not have the correct Cross-Origin Resource Sharing (CORS) headers.
To ensure that these resources are available during the thumbnail generation process, consider two options:
-
Use CORS headers: The host server must send responses with an
Access-Control-Allow-Origin
header set tohttps://experience.adobe.com
value for production environments. This method allows GenStudio for Performance Marketing to access and include the resources. -
Use Data URLs: Embed the external resources directly into the template using Data URLs. This method bypasses CORS restrictions and ensures that the resources are available during thumbnail generation.
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 |
---|
|