Using XML

You can use the XML format for the content interface paragraphs. If you choose XML, do not save your product data with the CSV solution on the Optimizely server. Instead, Optimizely Campaign retrieve product data from your web space or server using a HTTP request.

When the request is made, your product data must:

Your company's environment determines whether you import static or dynamic product data. Contact your system administrator to learn which implementation is in use.

Saving static product data on the server

To save product data statically as XML files on your webspace or server, each product must be saved in an XML file. You cannot group multiple products into a single XML file. To save a product as an XML file, perform the following steps.

  1. Open a text editor, such as Notepad (Windows) or Textedit (macOS/OS X).
  2. Create a new document.

    Set your text document to use UTF-8 character encoding. If you use another encoding, the text may not be represented properly.

  1. Copy the following code into your document.

    The following steps guide you through customizing this code for your setup. Only product ID (in code, the property id) is mandatory. Other values are optional. Delete any unused values.

  2. In the first property row, enter the product ID . Insert your product ID between the brackets.

    Example: Your product has the product ID "FR123". <property name="id">FR123</property>

    Use only alphanumeric characters (letters and numbers) in the product ID. If you use special characters, you may encounter problems importing product data.

    In all steps below, you insert the value between brackets, after CDATA.

  3. In the 2nd through 11th property rows (text1 through text10), enter up to ten text elements for your product offer. "Text field 1", "Text field 2", "Text field 3" and so on are entered as placeholders for your text elements.

    The text elements can include things such as the heading for the product offer, the product name, the product category, the product description, the old price, the current price, the manufacturer/supplier, and so on. Adapt the content to your needs and your product or service's requirements.

    Example: The header of the product offer is: Relax in Paris. <property name="text1"><![CDATA[Relax in Paris]]></property>

    It is best to organize product offer components sequentially, from text1 through text10, which is how they are shown in the finished product offer. If you are not sure what order is best for you, contact customer support. The formatting (text size and text color) of the text field content is set separately using an HTML layout.

  4. In the 12th property row, enter the heading for the link to your product offer. For example: Offer, More Information or Buy Now.

    Example: The link text is: Book now. <property name="link1Text"><![CDATA[Book now]]></property>

  5. In the 13th property row, enter the URL that leads to the product page in your web shop.

    Example: The URL of the product page is http://www.sonnenhungrig.com/paris: <property name="link1Url"><![CDATA[http://www.sonnenhungrig.com/paris]]></property>

  6. In the property rows 14 through 17, if your product offer needs more than one link, enter two additional links and link texts. Enter the information as specified in steps 6 and 7.

    Example: Next to the link to the booking page for the Paris trip, another link leads to the current weather in Paris.

  7. In the 18th property row enter the URL to the product image. Optimizely Campaign loads the product image using that URL and shows it in your message.

    Example: The URL of the product image is "http://www.sonnenhungrig.com/eiffeltower.jpg". <property name="image1ImageUrl"><![CDATA[http://www.sonnenhungrig.com/eiffeltower.jpg]]></property>

  8. In the 19th property row, enter the alternative text for your product image. An alternative text is the text that is shown when an image cannot be loaded. Enter alternative texts, because visually impaired people can read these using special programs, promoting an accessible Internet.

    Example: The alternative text for your product is "The Eiffel Tower in Paris in springtime". <property name="image1AltText"><![CDATA[The Eiffel Tower in Paris in springtime]]></property>

  9. In the 20th property row, enter a URL for the product image. If a recipient clicks on the image, he or she is led to the associated URL. This can be your web shop or also any other address that you want to connect to the image.

    To display the image in messages, be certain that you are using the ImageURL, which indicates the image's saved location. The ImageLink, on the other hand, directs the recipient to the link target, which has additional information.

    Example: The URL associated with your product image is: "http://www.sonnenhungrig.com/sightsinfrance". <property name="image1ImageUrl"><![CDATA[http://www.sonnenhungrig.com/sightsinfrance]]></property>

  10. In the property lines 21 through 35, up to five additional URLs for the locations where the product images are stored can be entered, and five additional alternative texts and five additional links that direct the recipient to the link target when clicked. This means: Up to six product images, each with an alternative text and a link can be associated with each product offer. Enter the information as specified in steps 9 and 11 of this manual.
  11. In the property lines 36 to 55, enter additional data records that you can use, such as metadata for the program logic of the HTML layouts.
  12. Save the text document. For the file name, use the product ID (the value you inserted for the id property). For file type, use .xml.
  13. Delete the document's file extension. For example, if the document is named ParisTrip01.xml, rename the file as ParisTrip01.

    If you do not remove the file extension, your product data cannot be loaded.

  14. Save the document in your webspace or on your server in the directory that you communicated for the setup of the product paragraph with content interface.

    Do not change the location of the product description documents without consulting customer support. If you change directories without consulting customer support, you cannot load product data using the content interface.

    When you have saved your text document in your web space or on your server, you can access your product offer in the Template Kit. Follow the individual steps in the Static XML article section to upload your product offer into the Template Kit using the content interface.

Generating dynamic product data on the server

The preparation of dynamic product data generally follows the same scheme as static product data, but the XML files are not prepared manually. Instead, they are loaded from a database when called (by HTTP request) via the content interface and automatically generated as XML. Your company needs to program this process. To generate dynamic product data, consult your system administrator.

When performing the configuration:

  1. The XML feed must be UTF-8 encoded.
  2. The product ID must be positioned at the end of the URL.

    Correct:  http://request.example.com/product?id=123456789

    Incorrect: http://request.example.com/product/123456789/data