Data sent to Bazaarvoice for post-interaction email (PIE) messages, is referred to as the interaction data feed. This feed must be in one of the following file formats:
- A tab-delimited text file
- An XML file (preferred format)
Each file uploaded must have a unique name to avoid it overwriting the previous file. We accept any naming convention you choose but we recommend including your site name and current date, such as in the following example:
If you intend to send multiple feeds a day, add a unique character to the file name. For example:
Tab-delimited interaction data feed
Tab-delimited PIE text files support two kinds of columns:
- Interaction. Interaction columns appear before product columns, and each column only appears once.
- Product. Product columns appear after interaction columns, and can occur in repeating sets (maximum of 5) to define multiple products as part of a single interaction.
The following columns are ‘interaction’ columns:
- Interaction date
- Email address
- User ID
- User name
The following columns are ‘product’ columns:
- Product ID
- Product name
- Product thumbnail image URL
- Product price
The following example shows the general structure of a simplified tab-delimited interaction feed with:
- interaction date
- email address
- user ID “interaction” columns
- varying numbers of repeating sets of product ID, product thumbnail image URL
- product name “product” columns
date email userId productId imageUrl productName date email userId productId imageUrl productName productId imageUrl productName date email userId productId imageUrl productName date email userId productId imageUrl productName productId imageUrl productName
Use the following best practices when you create a tab-delimited PIE interaction feed:
Interaction dates can be in any format that can be expressed via the methods defined in Java’s SimpleDateFormat class. Bazaarvoice recommends the following format:
Feeds may utilize header rows to denote column names; Bazaarvoice will ignore these rows.
XML-based interaction data feed
The XML interaction data feed file begins with a root node of
<Feed xmlns="http://www.bazaarvoice.com/xs/PRR/PostPurchaseFeed/5.6" >, and each transaction in the feed features its own
Interaction element under the root. Transaction-related metadata appears as children elements like
TransactionDate under the appropriate transaction.
The following example shows the general structure of a simplified XML interaction feed that exhibits all possible elements:
<?xml version="1.0" encoding="UTF-8"?> <Feed xmlns="http://www.bazaarvoice.com/xs/PRR/PostPurchaseFeed/5.6"> <Interaction> <TransactionDate>...</TransactionDate> <EmailAddress>...</EmailAddress> <UserName>...</UserName> <UserID>...</UserID> <Locale>...</Locale> <Products> <Product> <ExternalId>...</ExternalId> <Name>...</Name> <ImageUrl>...</ImageUrl> <Price>...</Price> </Product> </Products> </Interaction> </Feed>
Use the following best practices when you create an interaction data feed file (XML interaction feed):
Interaction dates must conform to the XML dateTime format. For example:
Ensure that the first line of your feed adheres to the following format:
<?xml version="1.0" encoding="utf-8"?>
- The standard character-encoding scheme, such as UTF-8 or Windows-1252, must match the scheme that you use for any special characters in the feed.
- If you do not have a value for a particular field, omit the field from your feed. Do not include the field with a blank value.
Validating XML interaction feeds
You can validate your XML interaction feeds using a local validator such as XMLBeans before submitting them to Bazaarvoice. To do so, follow these steps:
- Visit http://xmlbeans.apache.org/ and install XMLBeans. Installation steps may vary by operating system and platform.
- Save a copy of the Bazaarvoice schema you’re validating to your local machine. To do this, visit the site defined in the xmlns. For example: http://www.bazaarvoice.com/xs/PRR/PostPurchaseFeed/5.6 and save the output as an XSD file on your local machine.
- Use the command line to call XMLBeans to validate your file. Full documentation of the XMLBeans command line tools can be found here: http://xmlbeans.apache.org/docs/2.0.0/guide/conValidationWithXmlBeans.html#command_line_validation
svalidate schema.xsd localfile.xml