Transaction Conversion- eCommerce Transactions

Clients interested in measuring the impact of user-generated content (UGC) on their sales must implement the trackTransaction analytics event.

Overview eCommerce transactions

The transaction event captures purchase data when a customer buys a product. This event is required on eCommerce sites. Typically, the transaction event is added to a confirmation page, such as a thank you page or payment confirmation page.

πŸ“˜

You can send email messages to users to request reviews or answers to product questions by adding personally identifiable information (PII) parameters to the transaction event.

trackTransaction()

BV.pixel.trackTransaction(TransactionData);

The trackTransaction event should execute once the user has completed a purchase. This will often be after a payment has been processed or when loading a payment confirmation page.

Personal Identifiable Information (PII)

A significant percentage of reviews are collected through follow-up emails sent to verified purchasers. One way to capture a purchaser's personal information (email address, nickname, locale, userId) is by including it in the trackTransaction event. When this occurs, the transactional data is considered to contain personal identifiable information (PII) and must be handled differently than anonymous transaction data.

The analytics code base has a allowlist (sometimes called a "whitelist") of expected parameters when handling transactions. If the provided data contains a field that is not allowlisted, the field is assumed to contain PII data. This causes two events to be
transmitted. The first event will be of class PIIConversion and contain all the fields in data. The second event will be of class Conversion and will only contain the allowlisted fields from data.

By adding PII parameters, you can perform the following:

  • Send personalized email messages to users to request reviews if post-interaction email (PIE) is enabled
  • Request answers to product questions if Ask a Product Owner is enabled
  • Send users additional notifications about their reviews or questions

Be aware that PII is:

  • Never associated with the Bazaarvoice persistent cookie
  • Always transmitted over HTTPS
  • Encrypted before writing to disk
  • Never processed by Bazaarvoice analytics
  • Stored separately from non-PII data

The following lists the necessary data to execute an eCommerce transactions analytics event.

Arguments

NameTypeDefaultDescriptionPriority
TransactionDataObjectN/AAn object containing data related to the Bazaarvoice products and the eCommerce transactionRequired

Usage

This example below is analytics code that would execute on the order confirmation page when capturing PII:

//create the TransactionData object
var TransactionData = {
orderId: 'EX-123',
city: 'Exampleville',
state: 'Texas',
country: 'USA',
email: '[email protected]',
locale: 'fr_CA',
nickname: 'Test',
userId: '7448dc2',
tax: "8.25",
shipping: "25.00",
total: "60.00",
currency: "USD",
items: [
  {
    sku: '1234567-1',
    name: 'RXV CD player',
    imageUrl: "http://www.someserver.com/images/someimage.jpg",
    category: "electronics",
    quantity: '1',
    price: "50.00",
    shippingDate: '2016-12-21'
  },
  {
    sku: '1234567-2',
    name: 'HDMI cable 100 ft',
    imageUrl: "http://www.someserver.com/images/someimage.jpg",
    category: "cables",
    quantity: '1',
    price: "10.00",
    shippingDelay: '23'
  }
]
};

BV.pixel.trackTransaction(TransactionData);

πŸ“˜

The productId is the ExternalID and should match the same value sent to Bazaarvoice in the product feed.

πŸ“˜

Total is the total amount of the product order (all items) with any discounts and coupons applied and without tax and shipping. Represent total value in the English format (two decimal places) without the currency symbol (e.g. "$" for USD).

Transaction data

FieldTypeSample valuePriority
orderIdString'EX-123'Required
totalNumber133.25Required
currencyString'USD'Required
taxNumber8.25Recommended
shippingNumber25.00Recommended
cityString'Austin'Recommended
stateString'TX'Recommended
countryString'USA'Recommended
labelStringRecommended

The parameters below should be addressed when considering sending Personal Identifiable Information (PII)

FieldTypeSample ValuePriority
emailString'[email protected]'Required
localeString'en-US'Required
nicknameString'SomeNickname'Required
userIdString'someUserId'Required
shippingDateStringItem specific - '2014-12-21'Optional
shippingDelayNumberItem specific - '23'Optional

The parameters below are specific to the items[] array. See code sample.

FieldTypeSample ValuePriority
itemsArrayN/ARequired
productIdStringItem specific - '1234567-1'Required
quantityNumberItem specific - 3Required
nameStringItem specific - 'RXV CD player'Required
priceNumberItem specific - 50.00Required
categoryStringItem specific - 'electronics'Optional
imageURLStringItem specific -'http://www.someserver.com/images/someimage.jpg'Optional