A variation feed enables you to automate the process of creating, editing, and removing variations. You select a template, and connect it to a CSV or XML file with the variations metadata (images, titles, and so on). Whenever the file changes – the variations change as well.
Variation feeds can be used with Dynamic Content, Banner Grid, and Menu Blocks.
Step 1: Design your template
- Create a template for the variations.
- Create variables: Turn every part of the template that you want to be populated by the variation feed into a variable. For example, if you want the image to be different for every variation, and the image URL is in the variation feed – make the image SRC a variable.
Step 2: Prepare the file
The file can be a CSV or XML file. You can either upload the file to Dynamic Yield or host it on your server. Structure the file as follows:
- Each row is a variation.
- Columns are the variables. For example, if you have 3 variables for the title, image URL, and link – the file must include at least 3 columns, one for each of the variables.
- The file must have at least one column with a unique value. It can be an additional column (that is not used in any variable). This column is used for the variation name.
- Avoid using spaces or special characters in the title. If you have special characters in the table, save the file in UTF8 format.
- Files can have a maximum of 50 columns and 4,000 rows. Values must include fewer than 4,000 characters.
- Note: URLs must be encoded with HTML Entity Encoding. If your source includes URLs that are encoded differently, use the parser function to adapt them.
Example:
| Title | Image URL | Target URL |
| New summer collection | acme.com/img/summer.png | acme.com/summer |
| 25% off | acme.com/img/sale-banner.png | acme.com/sale |
| Complete the look | acme.com/img/complete.png | acme.com/collection |
Tip: If your file is not a flat table, you can later use a parser function. This means that you can write JavaScript code to transform your source and adapt it to a flat table.
Add affinity attributes to your variation feed
If you're using affinity allocation in your campaigns, you must add affinity attributes to your variation feed (learn more about affinity allocation). Use the following column format:
affinity:[AFFINITY ATTRIBUTE]
For example: affinity:categories or affinity: color
You can set up to 5 values for each attribute using pipes ( | ). For example, for the attribute categories you can add shoes|sportswear|accessories and for the color attribute, purple|white.
Note: It's mandatory that any attribute you use in this feed is also defined in your product feed, or else you'll get a validation error. Validation errors appear only within the experience screen in Experience OS. For more information, see Affinity allocation in variation feed campaigns later in this article.
Example with affinity attributes:
| Title | Image URL | Target URL | affinity:categories | affinity:color |
| New summer collection | acme.com/img/summer.png | acme.com/summer | sportswear|dresses | purple|white |
| 25% off | acme.com/img/sale-banner.png | acme.com/sale | ||
| Complete the look | acme.com/img/complete.png | acme.com/collection | accessories |
Localize your variations (optional)
You can translate each variable into any language you defined in your section. Add a new column in the file for each translated variable, and make sure to follow the proper naming convention:
language param + language code + country code + variable to translate
For example:
lng:fr_FR: column name
This is how it looks in a table:
| Title | Target URL | Image URL | Title Text | lng:pt_PT: Target URL | lng:pt_PT: Title Text | lng:fr_FR: Target URL | lng:fr_FR: Title Text |
|---|---|---|---|---|---|---|---|
| Stay Active Men | https://www.my-brand.com/men/en-en | eg.com/path | New Outdoor Gear | https://www.my-brand.com/men/pt | Novo Equipamento ao ar Livre | https://www.my-brand.com/men/fr | Equipement extérieur |
| Stay Active Women | https://www.my-brand.com/women/en-en | eg.com/path | New Collection | https://www.my-brand.com/women/pt | Nova Coleção | https://www.my-brand.com/women/fr | Nouvelle Collection |
Learn more about localization and supported language and country codes in Multi-Language Support.
Step 3: Create a variation feed
- In Assets › Data Feeds, click New and select Variation Feed.
- Name the feed.
- In the Feed Source field, do one of the following:
- Upload the file: After you connect variations to the variation feed, they update every time you replace the file.
- Paste the URL that hosts the file: Whenever the file changes, the variations change accordingly.
- In Synchronization, if the feed source is a URL on your servers, set the sync rate.
- Use a parser function to adapt and manipulate the feed source to create a simple, flat table that will be the variation feed.
Note: The parser function runs only during manual syncs. Changes made through the parser are not applied during automatic syncs. - Click Preview.
- Select any column with a unique value in the Unique Key settings.
- Select a column to serve as the variation name in Variation Name Key. The variation name later appears in your reports, so make sure it's descriptive of the variation content.
Note: Make sure to select these values carefully, as you can define them only once during the creation stage of the variation feed. You can't change the values later.
- Click Save and Activate. Verify that the feed syncs.
Tip: You can use the same feed for multiple experiences or campaigns, and add a column that is later used as a filter, and set a different filter per experience. For example, if you have promotions for mobile users and promotions for desktop users, you can have them in the same feed. Add a column named "Device", and a value of either "Mobile" or "Desktop". When you create an experience that is targeted to mobile users, you can filter rows that include the "Mobile" value in the "Device" column. The same goes for an experience that is targeted at desktop users.
Step 4: Create an Experience Email Campaign
Create a new Experience Email campaign and add a Dynamic Content block
Under the Create Variation button, click to manage the experience by syncing it with a Data Feed.
Select the template you created in Step 1, and then, in the template, select the variation feed you created in Step 3.
In the template, map the feed columns to the template variables. You immediately see a preview of what the variation would look like if it's based on the feed's first row.
Localization: The languages defined in your General Settings appear at the top. You can click each country code to define the mapping.
Important: Make sure your feed columns and template variables have the same names. Clicking Automatically map columns fills the mapping for you. This works only for feed columns that have the same name as template variables. If names don’t match for a data feed source, it remains empty and you'll need to map columns manually. The automatic mapping also works for translated fields.
-
Choose variations:
Decide how many (1-80) and which variations to serve.
Optionally, filter rows by a value in the feed.
Click Sync Variations. The variations are added to an experience in the campaign.
Click Save Experience and then Save and Publish.
You can always click Sync Settings to update existing variations, change the template, the mapping, or the filter.