Clean up and Single-page application support

Clean up existing implementations of Ratings & Reviews

If Bazaarvoice code is currently integrated on your site, ensure that the new BV loader framework works properly by following these steps:

  1. Make sure no <script> tags or dynamic scripts reference bvapi.js.

  2. Remove any of the following attributes:

    • id="BVRRSummaryContainer"
    • id="BVRRContainer"
    • id="BVQAContainer"
  3. Remove any code that relies on $BV, such as calls to $BV.configure or $BV.ui.

  4. If Bazaarvoice SEO is implemented, update the implementation to remove references to BVRRSummaryContainer, BVRRContainer, BVQAContainer, and $BV calls. The SEO implementation must now reference the <div> tags described in Add Bazaarvoice code to your site.

Note: Other features of Ratings & Reviews do not yet support the updated syntax of the display integration code that uses data-bv-show. For these features, we recommend you follow the instructions in Show hidden content to create the bvCallback function and then add any $BV.configure or $BV.ui calls specific to those features in that function.

Single-page application support

If your site is a single-page application (SPA), the BV loader is fully supported.

Our MutationObserver monitors your site's HTML containers with the bv-data-show attribute. Once a Bazaarvoice container is on the page and registered, if any of your scripts update the data-bv-product-id, data-bv-subject-id, or any other data property recognized by our API, the BV loader will handle the rest by:

  • Reinitializing any namespaces
  • Fetching API data from the browser cache or the web
  • Redrawing any applications within the new page setup

For example, call the following methods to dynamically set attributes in containers with bv-data-show:

document.querySelector('[data-bv-show="reviews"]').setAttribute('data-bv-product-id', 'product2');
document.querySelector('[data-bv-show="rating_summary"]').setAttribute('data-bv-product-id', 'product2');
Provide feedback button