HTML example code - Product display page (PDP)
Follow these instructions if your implementation uses the scout file (bvapi.js
) for display integration.
Note: Only use this code as a reference. Do not copy and paste this code without adding your company's specific information.
-
Add the following example JavaScript code within the
<head>
element of your product display page (PDP).<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Bazaarvoice Test Integration</title> <script type="text/javascript" src="https://default.ugc.bazaarvoice.com/bvstaging/static/client_name/site_ID/locale/bvapi.js"> </script> <script type="text/javascript"> $BV.configure('global', { productId : 'ProductID123' }); </script> </head> </html>
Contact Bazaarvoice Support for the following values:
default.ugc
,client_name
andsite_ID
. -
Add the following summary container code near the top of your product page, (underneath the product name or image). The summary container displays a summary of Ratings & Reviews (or Questions & Answers) data on the PDP.
<div id="BVRRSummaryContainer"></div>
-
To display the Ratings & Reviews content, add the following code below the product description.
<div id="BVRRContainer"></div> <script type="text/javascript"> $BV.ui( 'rr', 'show_reviews', { doShowContent : function () { } }); </script>
Note: Refer to the Ratings & Reviews knowledge base for the full code example for display integration.
JavaScript code
Script element | Description |
---|---|
default.ugc.bazaarvoice.com |
Contact
Bazaarvoice Support
for this value. It's the name of the folder where your display code configurations are stored. This value normally contains your company name, for example http://dyson.ugc.bazaarvoice.com . |
/bvstaging |
This allows you to test your submission container in your staging environment. Remove /bvstaging from the URL before launching in your production environment. |
client_name |
Contact Bazaarvoice Support for this value. The client name is assigned by Bazaarvoice at provisioning and always uses lowercase letters. |
site_ID |
The ID of the deployment zone you want to use. Contact Bazaarvoice Support to ensure you have the correct site ID. |
locale |
The locale used by your implementation. For example, use en_US for English. |
bvapi.js |
bvapi.js loads synchronously. However, this file introduces no perceived performance impact in most conditions. All remaining resources load asynchronously. |
productId |
This represents the ID of the product that is displayed on the page. This value must match the ID that is associated with the product in the product catalog feed. |
$BV.ui |
This is the Bazaarvoice UI configuration call. The BV.ui call loads the relevant Bazaarvoice display module into your PDP. For example, the Ratings and Review or Questions and Answers content. |