Exporting product data with a CSV file

If you select CSV Stands for "comma-separated values"; tabular data in a plain text file separated by the comma character. format, your product data is prepared in two steps:

  1. Export product data from your e-commerce system or another data source into a CSV file.
  2. Move the CSV file to your personal directory on the server.  Optimizely Campaign retrieves the CSV file then makes its product data available in the Template Kit.

    If you have a personal directory on the server but no login information, contact customer support to set up a user account.

Export product data from your system as a CSV file. CSV files exported from different systems can differ widely. For example, names and column heading order can be different. Such differences can create problems when importing product data. If no information is provided about what the dataset columns contain (for example, the column that contains the product name), Optimizely Campaign cannot read the CSV file properly nor correctly classify the individual datasets.

But, if you use an Optimizely integration for one of these e-commerce systems, the content interface can recognize CSV files with different structures and process them correctly :

  • Magento
  • OXID
  • Shopware

If you use Optimizely integration with one of these systems, you can export product data using the Optimizely plug-in with no adjustment.

If you do not use an Optimizely integration, you must use Optimizely Campaign's generic CSV structure.

Generic CSV structure

Optimizely Campaign's generic CSV structure standardizes the structure and naming of column headings in CSV files, ensuring the correct import of product data.

If your system/your data source has a feature that supports the export of datasets to a CSV file (such as a plug-in), configure the CSV file with the following structure and column headings:

Configuring an export feature generally requires programming.

When configuring the export feature, observe the following:

  • The CSV file must be RFC-compliant. Technical notes are contained in RFC 4180.
  • Set character encoding for the CSV file to UTF-8 without BOM.
  • Use the semicolon (;) as a separator.
  • If some product data includes quotation marks (inverted commas), mask them with escape characters. Use the quotation mark " as the escape character. If you do not mask quotation marks, they are misinterpreted as code, and the product data import fails.

    Example: You surround a word or a word group with quotation marks, such as "Savoir Vivre." In your CSV file, wrap the quoted text with double quotation marks: ""Savoir Vivre"". The outer quotation marks are recognized as escape characters so are not displayed in the message text.

Creating a CSV file manually

If your system/your data source does not have a feature for exporting product datasets to a CSV file, and you want to manually create a CSV file with product data, perform the following steps:

  1. Download the template for the generic CSV structure here: template generic structure.csv
  2. Open the template using a spreadsheet program, such as Microsoft Excel or LibreOffice Calc.

    Image: Template spreadsheet

    When opening the template, if you need to enter a separator, select semicolon. If you need to specify character encoding, use UTF 8 without BOM. Some programs, such as Microsoft Excel, do not provide UTF-8 without BOM. In that case, select UTF-8.

    When filling out the template in the generic CSV structure, you must observe the following:

    If some product data includes quotation marks (inverted commas), mask them with escape characters. Use the quotation mark " as the escape character. If you do not mask quotation marks, they are misinterpreted as code, and the product data import fails. Example: You surround a word or a word group with quotation marks, such as "Savoir Vivre." In your CSV file, wrap the quoted text with double quotation marks: ""Savoir Vivre"". The outer quotation marks are recognized as escape characters so are not displayed in the message text.

  3. Begin entering product data in row 2. Enter the data for each product side by side (see image).

    Do not change the column headings or their order in row 1. If you do, your product data cannot be loaded into the Template Kit.

    Image: Entering product data

    To add another product offer, insert the data again side-by-side in the next row (see image).

    Image: Entering more product data

  4. Save and rename the file.

    Give the file the name you entered for your CSV file when setting up content interface paragraphs. If you use a different name, the product data import will fail. If you forgot the name, contact customer support.

    When saving the file, make sure the spreadsheet program does not assign a new file type. The file must have the file type CSV or file extension .csv.

Transferring the CSV file to the Optimizely server

After you save the completed and renamed CSV template, transfer it to your personal directory on the Optimizely server.

If you use an Optimizely integration for Magento, Shopware, or OXID, the transfer is automatic. If you do not use an Optimizely integration, but want to automate the transfer, use a script. Consult your system administrator or software service provider for a programming solution.

To transfer the completed and renamed Optimizely template in your directory to the Optimizely server, perform the following steps:

  1. Log in to the Optimizely server with your user data.

    If you do not have a user account for the Optimizely server, contact customer support. See FTP API (Windows) for information about logging in to the Optimizely server; see FTP API (macOS/OS X) for macOS.

  2. Upload the Optimizely template to your personal directory on the Optimizely server.

    If you have multiple directories on the Optimizely server, save the template in the directory set up for your CSV files during the configuration of the content interface. If you save the template to another directory, your product data import fails.

    After you load the completed and renamed template into the correct directory, your current product offers are available in the Template Kit for integration into your messages.

    It can take some time for your product offers, transferred as a CSV file, to be available in the Template Kit. You should automatically perform the data transfer at night.