A variation feed enables you to automate the process of creating, editing, and removing variations. You choose 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.
Step 1: Design your template
- Create a template of the variations.
- Turn into a variable every part of the template that you want to be populated by the variation feed. For example, if you want the image to be different for every variation, and the image URL is in the variation feed – the image SRC should be a variable.
Step 2: Prepare the file
The file can be a CSV or an XML file, that you can either upload to Dynamic Yield or host on your server.
- Every 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 there are special characters in the table, save the file in UTF8 format.
- Files with over 50 columns or 4,000 rows are not supported, and 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 a JavaScript code to transform your source and adapt it to a flat table.
Step 3: Create a variation feed
- Go to Assets › Data Feeds.
- Click Add New and select Variation Feed.
- Name the feed.
- In the Feed Source field, you can 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 will change.
- In the Advanced Settings:
- If the feed source is a URL on your servers, choose 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.
- Click Preview.
- Choose a column with a unique value in the Unique Key settings.
- Choose a column to be served as the variation name in Variation Name Key. The variation name later appears in the reports, so make sure it is descriptive of the variation content.
- Click Save and Activate.
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 your campaign
- Create a campaign that contains the experience with your variations.
- When you create a new experience, in the Variation wizard step, click Syncing it with a Data Feed:
- Select the template you created in Step 1.
- 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 how the variation will appear if it is based on the first row of the feed.
- Choose variations:
- Decide how many (1-50) and which variation to create.
- You can also 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 change the template, the variation feed, the mapping, or the filter.
That's it! Your experience is synced with the variation feed:
- When rows are added – new variations are created.
- When rows are removed – the variations are deleted.
- When values change in the variation feed – the variation changes as well.
Variations do not sync if:
- A new version of the feed source is empty (relevant if the feed is hosted on your server).
- There are no rows in the feed that matches the filters.