BV Pixel
bvapi.js
), refer to the BV Pixel v1 documentation. We strongly recommend you migrate to BV Pixel v2 (using the BV loader file, bv.js
) for performance improvements and future innovations. Prerequisites
You must implement BV Pixel on an approved whitelisted domain. Bazaarvoice manages domain names internally.
- If you’re at the Bazaarvoice implementation stage, contact your Bazaarvoice implementation team to request allowlist (sometimes called a “whitelist”) updates.
- If you’ve completed implementation, contact Bazaarvoice Support to request changes.
Implementing BV Pixel (bv.js
)
BV Pixel uses the loader file <bv.js>
, which is a small, asynchronous JavaScript application that tracks events on your website. Once you’ve added the loader file <bv.js>
to a page, the event tracking code fires automatically and captures Page views, Impressions, and Feature events.
BV Pixel tells Bazaarvoice when a consumer converts on your site. There’s two types of BV Pixel tags:
- Transaction events: Transaction tags collect purchase data from your order confirmation page.
- Conversion events: Conversion event tags are triggered by coupon downloads, newsletter sign-ups, or product warranty registrations.
Transaction event for e-Commerce sites
- Add the BV loader.
- Add the transaction event.
- (Optional) Add PII parameters to send review requests (formerly post-interaction email or PIE).
- Test your implementation.
Conversion event for non-Commerce sites
- Add the BV loader.
- Add the conversion event.
- (Optional) Add PII parameters to collect information about the consumer.
- Test your implementation.
Add the BV loader
The BV loader <bv.js>
loads the Bazaarvoice JavaScript library. This library contains event-tracking code that captures consumer activity on your website.
Add the BV loader code to the head
of your page:
<!-- load BV loader -->
<script async src="https://apps.bazaarvoice.com/deployments/<client_name>/<site_ID>/<environment>/<locale>/bv.js"></script>
Required parameters are descripted in the following table.
Parameter | Description |
---|---|
client_name |
Client name provided by Bazaarvoice. Use lowercase letters. |
site_ID |
ID of the deployment zone you want to use.
|
environment |
Deployment environment where you want to implement BV Pixel.
|
locale |
Locale used by your BV Pixel implementation. If you're not using US English (en_US), ensure use the correct locale code. |
Example URL: Endurance Cycle’s staging environment Main Site deployment zone
https://apps.bazaarvoice.com/deployments/endurancecycles/main_site/staging/en_US/bv.js
Example URL: Endurance Cycle’s production environment implementation
https://apps.bazaarvoice.com/deployments/endurancecycles/mobile/production/en_US/bv.js
Add the transaction event (e-Commerce sites)
The transaction event tag captures purchase data and feeds the Conversion Impact Report e-Commerce. We recommend adding this event tag to a Thank you or Payment confirmation page.
Add the transaction event and required parameters below the BV loader code, as the following code example shows.
<!-- load bv.js -->
<script async src="https://apps.bazaarvoice.com/deployments/<client_name>/<site_ID>/<environment>/<locale>/bv.js"></script>
<!--load Transaction event and parameters-->
<script>
window.bvCallback = function (BV) {
BV.pixel.trackTransaction({
"currency" : "value",
"orderId" : "value",
"total" : "value",
"items" : [
{
"price" : "value",
"quantity" : "value",
"productId" : "value",
"optional_item_parameter" : "value"
},
...
],
"optional_order_parameter" : "value",
...
"optional_PII_parameter" : "value",
...
});
};
</script>
Required order parameters
Parameter | Description | Example value |
---|---|---|
orderId |
Unique ID of an order generated by a site. Impact:
|
55555 |
total |
Total cost of the product order with discounts and coupons applied but excluding tax and shipping. Specify the value for Impact:
|
1178.07 |
items |
Array of the individual items in the transaction. See the following sections for required and optional array parameters. |
Required item parameters
The following item parameters are important factors in measuring ROI.
Parameter | Description | Example |
---|---|---|
price |
Individual price of the item, not Specify the value for |
12.95 |
quantity |
Number of items purchased. | 3 |
productId |
Must match the product |
908736 |
Optional order and item parameters
tax
parameter has no data, don't add "tax" : ""
(an empty string). Leave out the parameter.Parameter | Description | Example |
---|---|---|
name |
Name of the item. |
Serena Boots |
category |
(Recommended) Item parameter that captures the product category used on the website. Impact: Enables you to measure ROI by category. |
Mens casual boots |
shipping |
(Recommended) Order parameter that captures the cost of shipping the order. Specify the value for Impact: Enables you to verify |
10.00 |
shippingDate |
Used instead of the transaction date to determine when Bazaarvoice sends the review requests. The date must be in the following format: YYYY-MM-DD. If a first review request delay is configured, that delay is added to the date specified here. For example, if you specify "shippingDate" : "2016-12-21" and the review request delay is set to 10 days, the review request is sent on Dec 31, 2016 (2016-12-31). You can use |
2016-12-21 |
tax |
(Recommended) Order parameter that captures the amount of tax applied to the order. Specify the value for Impact: Enables you to verify |
11.44 |
discount |
(Recommended) Amount discounted from the entire order or for each item. Specify the value for Impact: Enables you to verify |
5.00 |
city |
Order parameter that captures the end user specifying the order’s city. |
Detroit |
state |
Order parameter that captures the end user specifying the order’s state. |
Utah |
country |
Order parameter that captures the end user specifying the order’s country. |
CA |
deploymentZone |
If you have multiple deployment zones, use this order parameter to specify the ID for the deployment zone where your implementation is deployed. This parameter ensures that Bazaarvoice uses the implementation's email templates for sending review requests. Before referencing the deployment zone in the interaction feed, make sure the implementation with the configured email templates is published to that specific deployment zone. If you don't provide this parameter, the deployment zone specified by environment in the BV loader's path will be used. |
secondary_site |
Add the conversion event (non-Commerce sites)
The conversion event captures non-transactional customer interactions (or behavior) on pages that display Where to Buy or AddToCart links.
-
Conversion events accept three high-level parameters to describe the type of conversion taking place.
-
The conversion event feeds the Conversion Impact Report non-Commerce.
Add the conversion event and its parameters to the page below the BV loader, as shown in the example code.
<!-- load BV loader -->
<script async type="text/javascript" src="https://apps.bazaarvoice.com/deployments/<client_name>/<site_ID>/<environment>/<locale>/bv.js"></script>
<!--load Conversion event and parameters-->
<script>
window.bvCallback = function (BV) {
BV.pixel.trackConversion({
"type" : "value",
"label" : "value",
"value" : "value"
});
};
</script>
Required parameters
The conversion event only has one required parameter - type
. It’s used to:
- Describe the type of conversion taking place. For example, a consumer signing up for a coupon, downloading trial software, or signing up for a newsletter.
- Map directly to each goal that is measured in the non-eCommerce CIR.
type
parameter, but we recommend the values in the following table for specific conversion types.Parameter | Type | Description | Permutations |
---|---|---|---|
type |
StoreLocator |
Used to locate a store or to find where to purchase products offline. Use the permutation value if it matches your needs better. |
DealerLocator, FindStore |
WhereToBuy | Where to buy products online or in store. | ||
BuyNow | Enables the consumer to make a purchase now. Use the permutation value if it matches your needs better. | BuyOnline, ClickToBuy | |
Compare | Allows the consumer to compare two or more products. | ||
ProductDetail | Provides additional product details. | ||
AddToCart | Adds product to a cart. | ||
Quote | Enables a consumer to request a price quote. |
Optional parameters
Parameter | Description | Example |
---|---|---|
Value | Value attributed to the conversion. This value does not appear in the non-Commerce CIR. | 55781 |
Label | Descriptive label to apply to the conversion. This value does not appear in the non-Commerce CIR. | ClickToBuy |
Add personally identifiable information (PII) parameters
Email addresses and phone numbers are considered to be personally identifiable information (PII), that is, private content that could potentially identify a specific individual. PII enables you to:
- Send personalized messages asking consumers to submit a product review.
- Request answers to product questions if you’ve enabled the Ask a Product Owner feature.
- Send consumers reminders about reviews or questions.
Collect personal consumer data by adding PII parameters to either a transaction or conversion event.
Protecting PII
PII collected using BV Pixel is:
- Never associated with the Bazaarvoice persistent cookie
- Always transmitted over HTTPS
- Encrypted and stored separately from non-PII data
- Never processed by Bazaarvoice analytics
Required parameters
Parameter | Description | Example |
---|---|---|
email |
The consumer's email address. Note: If using BV Pixel to power review request messages, use encryption to ensure the security of consumer email addresses when sending notifications and requests.
|
username@example.com |
locale |
The locale to use to determine the language-specific email template to use. Refer to Supported locales and languages for the list of supported values. This parameter is required if you are sending unique templates for multiple locales. |
fr_CA |
nickname |
The consumer's nickname, captured when the consumer creates an account. Used to personalize review request emails. |
MaryO |
userId |
The consumer's user ID, which must match the userToken (user ID) that is sent to Ratings & Reviews during the review submission process. This parameter is required if you're using site authentication. It can be omitted if an ID is not created, for example, in the case of guest purchasers. Note: If you're using Ratings & Reviews legacy (PRR), ensure your review request configuration worksheet reflects this parameter value accurately.
|
7448dc2 |
Optional parameters
- If you’re adding PII parameters in a transaction event, you can specify parameters for either the order or item.
- If you’re adding PII parameters in a conversion event, only order-level parameters are available.
orderID
parameter has no data, do not add "orderID" : ""
(an empty string).Order
parameters
Parameter | Description | Example |
---|---|---|
shippingDate |
Used instead of the transaction date to determine when Bazaarvoice sends the review request. The date must be in the following format: YYYY-MM-DD. If a first review request delay is configured, that delay is added to the date specified here. For example, if you specify "shippingDate" : "2016-12-21" and the review request delay is set to 10 days, the review request is sent on Dec 31, 2016 (2016-12-31). You can use |
2016-12-21 |
shippingDelay |
Used to increase the time (in days) between the transaction date and the date Bazaarvoice sends the review request. This can be useful if you expect delayed fulfillment. This delay is added to the first review request delay. For example, if the review request delay is set to 10 days and you specify "shippingDelay" : "10", the review request is sent on May 25 if the transaction date is May 5. You can use either |
25 |
Item
parameters
Parameter | Description | Example |
---|---|---|
imageURL |
The full, absolute URL to the product image (not a relative path). If omitted, Bazaarvoice will retrieve the value from our database by matching the This parameter is useful if you want to use a specific image. For example, if your product feed includes a picture of a white shirt but a blue shirt is purchased, the email message can display the blue shirt. |
http://www.test.com/1.jpg |
shippingDate |
Used instead of the transaction date to determine when Bazaarvoice sends the review request. The date must be in the following format: YYYY-MM-DD. If a first review request delay is configured, that delay is added to the date specified here. For example, if you specify "shippingDate" : "2016-12-21" and the review request delay is set to 10 days, the review request is sent on Dec 31, 2016 (2016-12-31). You can use |
2016-12-21 |
shippingDelay |
Used to increase the time (in days) between the transaction date and the date Bazaarvoice sends the review request. This can be useful if you expect delayed fulfillment. This delay is added to the first review request delay. For example, if the review request delay is set to 10 days and you specify "shippingDelay" : "10", the review request is sent on May 25 if the transaction date is May 5. You can use either |
25 |
PhoneNumber |
Specifies the phone number of the customer. Must be in a valid format (E164 ). |
|
Preference |
Specifies what the customer opts for sending review requests - Email or text. |
PII example code (transaction and conversion)
Imagine a consumer orders the following products from the StuffForSale.com website:
Product 1 | Product 2 |
---|---|
|
|
Scenario: This event code collects order and item information, in addition to PII such as the consumer’s email address, nickname, and location.
<!-- load bv.js --> <script async type="text/javascript" src="https://apps.bazaarvoice.com/deployments/stuffforsale/main_site/staging/en_US/bv.js"></script> <!--load Transaction event and parameters--> <script> window.bvCallback = function (BV) { BV.pixel.trackTransaction({ "orderId" : "55552", "total" : "168.08", //(sum of all products' items * price with discounts applied, without the $ sign) "currency" : "USD", "tax" : "11.44", //(tax amount without the $ sign) "shipping" : "10.00", //(shipping amount without the $ sign) "items" : [ { "name" : "Leather Chukka", "price" : "140.00", //(individual price of item, not price X quantity, without the $ sign) "quantity" : "1", "productId" : "156278", //(ExternalId in product feed) "category" : "Mens Casual Boots", "discount" : "9.99" //(discount applied to this item, without the $ sign) }, { "name" : "Polar White Candle", "price" : "12.69", //(individual price of item, not price X quantity, without the $ sign) "quantity" : "3", "productId" : "908736", //(ExternalId in product feed) "category" : "Home Decor" } ], "email" : "drew@example.com", //Optional PII parameters "locale" : "en_US", "nickname" : "Drew" }); }; </script>
Scenario: This event code collects order and item information, and the consumer’s PII, for example, unencrypted email address, nickname, and location.
<!-- load BV loader --> <script async type="text/javascript" src="https://apps.bazaarvoice.com/deployments/stuffforsale/main_site/staging/en_CA/bv.js"></script> <!--load Transaction event and parameters--> <script> window.bvCallback = function (BV) { BV.pixel.trackTransaction({ "orderId" : "69872", "total" : "64.95", //(sum of all products' items * price, without the $ sign) "currency" : "USD", "tax" : "5.89", //(tax amount without the $ sign) "shipping" : "10.00", //(shipping amount without the $ sign) "discount" : "5.00", //(discount applied to the entire transaction, without the $) "items" : [ { "name" : "Ivory Throw", "price" : "69.95", //(individual price of item, not price X quantity, without the $ sign) "quantity" : "1", "productId" : "100598", //(ExternalId in product feed) "category" : "Home Decor" }, ], "email" : "cheryllynne@example.com", "locale" : "en_CA", "nickname" : "Cheryl" }); }; </script>
Scenario: This event code tracks consumers who click the StoreLocator feature on your website. The value parameter collects the zip code. Additionally, StoreLocator_ProductPage identifies that the store locator was used on the product page.
<!-- load BV loader --> <script async type="text/javascript" src="https://apps.bazaarvoice.com/deployments/stuffforsale/main_site/staging/en_US/bv.js"></script> <!--load Conversion event and parameters--> <script> window.bvCallback = function (BV) { BV.pixel.trackConversion({ "type" : "StoreLocator", "label" : "StoreLocator_ProductPage", "value" : "78701" //(value attributed to conversion, the zip code) }); }; </script>
Scenario: This event code tracks consumers who click the download feature on your website. The label parameter indicates that the consumer downloaded an owner manual. The type parameter appears on Bazaarvoice reports.
<!-- load bv.js --> <script async type="text/javascript" src="https://apps.bazaarvoice.com/deployments/stuffforsale/main_site/staging/en_US/bv.js"></script> <!--load Conversion event and parameters--> <script> window.bvCallback = function (BV) { BV.pixel.trackConversion({ "type" : "Download", "label" : "OwnersManual_ProductDetails", "value" : "Product78493_OwnerManual" }); }; </script>
Test your BV Pixel implementation
Use the following tools to test and debug your BV Pixel implementation:
- Bazaarvoice Analytics Inspector (Google Chrome extension)
- Transactions monitoring tool in Bazaarvoice Portal
Bazaarvoice Analytics Inspector
This tool enables you to view and analyze the data being captured on any page that contains the BV Pixel code. You can debug transaction events, conversion events, and product display page events.
- Install the Bazaarvoice Analytics Inspector extension on Chrome.
- To test that the tool is working properly, load a sample transaction or product display page (PDP).
- Select Bazaarvoice Analytics Inspector from your Chrome extensions menu. The Analytics Inspector modal will display on top of your web page.
- Interact with the sample page. For example, filter the reviews or click Write Review. The tool will display event values in real time and highlight missing (required) parameters.
- Next, verify that your BV Pixel solution is capturing data for your website pages.
Test product display page (PDP)
- Load your PDP page. This should cause the PageView event to fire automatically.
- Select Bazaarvoice Analytics Inspector from your Chrome extensions menu. The Analytics Inspector modal will display on top of your page.
- Under Event Counts > PageView, select View Details to see details of what has been captured.
- Scroll down to UGC on the page. An
InView
event should fire. Under Event Counts>Feature, select View Details to see parameters and values passed. - View UGC for at least five seconds. A
ViewedCGC
event should fire. Under Event Counts > Feature, select View Details to see details. - Interact with UGC, for example, select the helpfulness icon. A
FeatureUsed
event should fire. - Under Event Counts>Feature, select View Details to see details.
- Troubleshoot the errors related to your BV Pixel implementation by testing your transaction page.
In the following example, the InView count is 2 because the user scrolled down to Ratings & Reviews and Questions & Answers on the page. The ViewedUGC event count is 2 because the user viewed the Bazaarvoice content on that page for at least five seconds. Lastly, the user interacted with the content, so additional events were captured—the user selected to ask a question Ask, selected to write a review Write, closed the submission form Close, and used a filter Filter.
Test transaction page
- Load an order confirmation page.
- Select Bazaarvoice Analytics Inspector from your Chrome extensions menu. The Analytics Inspector modal will display on top of your page.
- Complete a purchase using a sample credit card. The
trackTransaction
event should fire. - Under Event Counts > Conversion select View Details. The
type
is Transaction. - Verify that all required order parameters are listed in each order row. Examine the values that were passed.
- Verify that all required item parameters are listed in the items row. Examine the values that were passed.
- Troubleshoot the errors related to your BV Pixel implementation.
Test conversion page
- Select Bazaarvoice Analytics Inspector from your Chrome extensions menu. The Analytics Inspector modal will display on top of your page.
- Test a page with a conversion (non-transactional) event, for example sign up for a newsletter or download a coupon. The
trackConversion
event should fire. - Under Event Counts>Conversion select View Details. The
type
is Conversion. - Verify that all the required conversion type parameters (StoreLocator, Download, Coupon) are listed in each row.
- Troubleshoot the errors related to your BV Pixel implementation.
Transactions monitoring tool
Use it to troubleshoot live transaction data gathered by BV Pixel for tracking and reporting purposes. Check for problems with your BV Pixel implementation and validate corrections using incoming data.
To get started:
- Sign in to Bazaarvoice Portal .
- From the upper-right corner, select the settings icon .
- Select Monitoring Tools.The Transactions page opens.
- Apply filters to narrow the list of transactions to those of interest.
Note: The tool only displays transaction data received during the past 30 days, including the current date. If you filter by date, transactions that occurred during the specified time period but were received more than 30 days ago will not appear in the Transactions list.
- Select an Order ID to view key transaction details about the order.
- Take note of any errors in the Transaction details and Order details sections.
- Select View all transaction details to see a JSON file containing all the information BV Pixel captured about the transaction. Take note of any
bv_pixel_violations
.Note: Select Download as file to export the transaction details. - Troubleshoot the errors related to your BV Pixel implementation.
Troubleshoot transaction event issues
Step 1: Verify the transaction event’s location
The transaction event is typically added to either a Thank you or Payment confirmation page. Add the transaction event JavaScript below the BV loader in the page <head>
, as shown in the following example:
<!-- load bv.js --> <script async src="https://apps.bazaarvoice.com/deployments/<client_name>/<site_ID>/<environment>/<locale>/bv.js"></script> <!--load Transaction event and parameters--> <script> window.bvCallback = function (BV) { BV.pixel.trackTransaction({ "currency" : "value", "orderId" : "value", "total" : "value", "items" : [ { "price" : "value", "quantity" : "value", "productId" : "value", "optional_item_parameter" : "value" }, ... ], "optional_order_parameter" : "value", ... "optional_PII_parameter" : "value", ... }); }; </script>
Step 2: Check that all values are being passed as strings
Ensure all values in the transaction event, including numbers, are enclosed in double quotation marks.
Step 3: Fix transaction event errors
The Transactions monitoring tool reveals errors and warnings about your transaction event implementation. Learn more about how to resolve transaction event errors.
Understand the JSON file
The JSON file contains all the information BV Pixel captures about your transaction events.
JSON field | Description |
---|---|
partnerSource | Source of a supported e-commerce plugin integration, when applicable. |
total | Total amount of the product order including discounts and coupons but excluding tax and shipping. |
hadPII | A true or false value that indicates whether the event contained personally identifiable information (PII). This value is set to true if any fields exist in the event other than: orderID , affiliation , total , tax , shipping , city , state , country , items , locale , discount type , label , value , proxy , partnerSource , or deploymentZone .
|
UA_Platform | Operating system family of the consumer's agent's host machine. |
host | Hostname of the page that sent the event, as obtained from window.location.host .
|
cl | BV Pixel event class, such as Conversion, Impression, and PageView. The Transactions monitoring tool shows Conversion events only. |
orderId | Unique ID of an order generated by a site. |
UA_Device | Name of the mobile device from which the transaction was made. This is null if the user agent isn't a mobile device. |
IpState | State from which the transaction was made as determined by a Geo-IP lookup on the partial IP. |
tax | Amount of tax applied to the order. |
client | Client name provided by Bazaarvoice. |
UA | Full user agent string from the HTTP header request containing information about the consumer's browser, operating system, and platform. |
shipping | Cost of shipping the order. |
shippingDate | Used instead of the transaction date to determine when Bazaarvoice sends the review request. The date must be in the following format YYYY-MM-DD. |
shippingDelay | Used to increase the number of days between the transaction date and the date Bazaarvoice sends the review request. The value should be in a numerical format, such as 10 .
|
IpCountry | ISO-3166 code for the country from which the transaction was made. |
Page | Page on the client site on which the transaction event fired. |
Dt | Timestamp of when Bazaarvoice received the event. |
currency | ISO 4217 alphabetic currency code of the transaction. |
IpCity | City from which the transaction was made as determined by a Geo-IP lookup on the partial IP. |
bv_pixel_violations | BV Pixel implementation issues you should correct to capture more accurate transaction data. |
environment | Deployment environment in which you implemented BV Pixel. Valid options are production and staging. |
label | Descriptive label to apply to the conversion. |
UA_Browser | Browser on which the transaction was made. |
UA_Mobile | Indicates whether the transaction was made on a mobile device. |
Country | Valid two- or three-letter ISO country code set by the client. |
locale | Locale captured by BV Pixel. If the transaction wasn't in US English (en_US), use the correct four-character locale code. |
type | Type of conversion that took place. Refer to Recommended values for the type parameter to define the values of this required parameter. |
source | Indicates whether the BV Pixel implementation uses the BV loader file (bv.js) or bvapi.js. |
dc | Display code or other UI variant identifier. |
IpPostalCode | Postal code from which the transaction was made as determined by a Geo-IP lookup on the partial IP. |
UA_platformVersion | Version of the operating system of the device from which the transaction was made. |
Common questions
The following frequently asked questions can help you understand the security and performance impact of BV Pixel.
No. BV Pixel has no perceived performance impact. The loader file called bv.js
that tracks activity on your website typically contains between 7 and 14KB. The bv.js
file blocks a page for no longer than 15 milliseconds while asynchronously downloading the Bazaarvoice applications, which includes the Bazaarvoice Analytics Inspector tool (optional download). The analytics tag for BV Pixel is 11KB. We compress all referenced data to make it faster to process.
The Bazaarvoice platform, hosted on Amazon Web Services (AWS), stores your transaction data. We send your data over HTTPS and store it in secure AWS protected datastores .
The Bazaarvoice platform, hosted on Amazon Web Services (AWS), stores PII such as email address, name, and IP address. AWS encrypt email addresses and either truncate or anonymize IP addresses. We send your data over HTTPS and store it in secure AWS protected datastores .
No, it is not stored separately.
Internal Bazaarvoice employees may need to access data collected using BV Pixel to verify your Pixel integration for optimal functionality.
Yes. If permitted under the terms of your agreement, all Bazaarvoice clients can use your aggregated or anonymized BV Pixel data to power solutions.
Yes. You can implement BV Pixel to capture non-transactional event information on a non-e-Commerce website, for example, signing up for a newsletter, registering a product, downloading a PDF, locating a store, or requesting more information about a product. However, PII data captured by non-transactional events cannot be used to send review requests.
Yes. You can access this information through the password-protected Bazaarvoice Workbench. The passwords used to access Workbench are secured with a 128-bit key and a one-way hash.
The CIR only considers transactions where customers interacted with Bazaarvoice components (such as ratings, reviews, questions, or answers) before making their purchases. The Transactions Monitoring tool includes all transactions, regardless of whether consumers interacted with a Bazaarvoice component before completing their purchases.
No. You can only use the BV Pixel transactional event to generate a review request.