---
title: "Install Contextual Commerce"
id: "web-installation"
project: "Contextual Commerce"
url: "https://docs.bazaarvoice.com/articles/contextual-commerce/web-installation"
updated: 2026-10-15T09:12:53Z
---

# Install Contextual Commerce

To install Bazaarvoice Contextual Commerce on your site, add either the BV loader or Contextual Commerce snippet. This article describes how to install Contextual Commerce for both new and existing clients.

## New Bazaarvoice clients

If you're a new Bazaarvoice client, follow these steps to install either the loader or the snippet on your site.

1. #### Choose how to install Contextual Commerce 

    * **Use the BV loader** (Recommended) 
 
        The BV loader is a small, asynchronous JavaScript application that manages and displays Contextual Commerce campaigns on your web pages. The BV loader will only download approved features on the specific page. The BV loader also manages features from other Bazaarvoice product offerings, making it easier to expand your suite of products in the future with less additional setup. 
 
```javascript
<script async src="https://apps.bazaarvoice.com/deployments/<client_name>/<site_ID>/<environment>/<locale>/bv.js"></script>
```

 
        The following table describes the required parameters:

        | Parameter | Description |
        | --- | --- |
        | client\_name | Client name provided by Bazaarvoice. Use lowercase letters. |
        | site\_ID | ID of the deployment zone you want to use.<br><ul> <li>This is set up in the Bazaarvoice configuration. Default deployment zone is &#39;main_site&#39;. </li> <li>To ensure you&#160;have the correct ID, select&#160;the gear icon<img src="/resources/Storage/contextual-commerce/Imported/web-installation/img0001.png" alt="" data-ch-thumbnail-mode="none" style="height: auto; width: 100%; max-width: 55px;" class="bvimageinline" loading="lazy"> to the right of the deployment zone on the configuration Site Manager page. </li> </ul> |
        | environment | Deployment environment where you want to implement Contextual Commerce. |
        | locale | Locale used by your Contextual Commerce implementation. If you're not using US English (en\_US), ensure you use the correct [locale code](/smart/bv-ratings-reviews/localization). |

####
    * **Use the Contextual Commerce snippet**  The snippet loads the Contextual Commerce SDK which enables Contextual Commerce to monitor traffic and deliver campaigns on your site. 
 
```javascript
function activateGranify(sid) {
  if (!window.Granify) !function(r,t,e){
    var a,n;
    try{
      var i=window.localStorage,o="granify.entry_page."+t,c="granify.entry_referrer."+t;
      if(n=JSON.parse(i.getItem(o)),n&&parseInt(n.expires)>+new Date?n=n.data:(n=null,i.removeItem(o)),!n){
        i.removeItem(c),i.removeItem("granify.entry_page_sent."+t),i.removeItem("granify.entry_referrer_sent."+t);
        var s=window.location,f=window.location.origin;
        a=new Date(+new Date+18e5),f||(s.port?port=":"+s.port:port="",f=s.protocol+"//"+s.hostname+port);var y={data:window.location.toString().replace(f,""),expires:+a},p={data:document.referrer,expires:+a};i.setItem(o,JSON.stringify(y)),i.setItem(c,JSON.stringify(p))}}catch(r){}r=r+(-1===r.indexOf("?")?"?":"&")+"id="+t,window.Granify=function(r,t){Granify._functionsAvailable?Granify[r].apply(this,Array.prototype.slice.call(arguments,1)):Granify._stack.push([r].concat(Array.prototype.slice.call(arguments,1)))},Granify._stack=[],Granify._stack.push(["on","granify:init",function(){Granify._functionsAvailable=!0}]),Granify.init=function(r,t,e){for(var a=Granify,n=["on","identify","addTag","trackPageView","trackProduct","trackCart","addToCart","deleteFromCart","trackOrder","setCurrentProduct"],i=0;i<n.length;i++)!function(r,t){r[t]=function(){Granify._stack.push([t].concat(Array.prototype.slice.call(arguments,0)))}}(a,n[i])},Granify.init();var l,d=document.createElement("script");d.src=r,d.async=!0,(l=(l=document.getElementsByTagName("script"))[l.length-1]).parentNode.insertBefore(d,l)}("//cdn.granify.com/assets/javascript.js",sid);
}

// ** Replace with your actual Granify Site ID **
activateGranify("XXXXX");

```

2. ####  Choose where to place the code 

    * **Use the** `<head>` **tag** (Recommended) 
Placing the loader or snippet in the `<head>` tag improves performance and session tracking. 
 
If you use a conditional loading mechanism, prioritize the execution of **bv.js**. Use the **defer** attribute to optimize the critical rendering path. This allows Contextual Commerce to initialize without blocking the initial page load. 

To defer rendering of components, delay the injection of target container `<div>` tags for **Ratings & Reviews** components.
    * **Use a tag manager**  Use a tag manager if you prefer to manage the code across your site. This option allows you to manage changes without editing site headers, but may deliver less reliable data.
3. #### Add the code to the chosen placement 

    * **Using the**`<head>`**tag**
        1. Open the HTML file for the required page(s).
        2. Locate the `<head>` tag at the top of the page.
        3. Paste the code inside the `<head>` tag.
        4. Save and publish your changes.
    * **Using a tag manager**
        1. Sign in to your tag manager platform (e.g., Google Tag Manager).
        2. Create a new tag for the loader or snippet.
        3. Configure the tag to fire on the required page(s).
        4. Publish the changes in your tag manager.

 **Note:** Although you can use the loader on some pages and the snippet on others, or mix installation methods between the head tag and tag manager, we recommend consistent placement across all pages. This makes your setup easier to manage and troubleshoot over time.

##  Existing Bazaarvoice clients

If you’re already using either the BV loader or Contextual Commerce snippet on some pages, ensure you:

1. #### Check all required page types for existing code 
 
    Search `<head>` tags or your tag manager to ensure the BV loader or Contextual Commerce snippet is present on all required page types across your site.
2. #### Add the code to any page missing it 
 
    For consistency, we recommend that you use the same method (loader or snippet) and placement (head tag or tag manager) on new pages that you have used on existing pages. Do not add both the loader and snippet to the same page, as this can cause data duplication and errors.

## Page types

Add the Bazaarvoice loader or Contextual Commerce snippets to the following pages via the `<head>` tag or tag manager:

* **Receipt**  The page displayed after the checkout process, containing the customer's order information.
* **Home**  The home page of the website.
* **Collection**  A page containing a list of products, or a list of product categories.
* **Search**  A page containing a list of products, as the result of a search.
* **Product**  A page containing product information specific to a single product and its variants, where you are typically able to add the item to your cart.
* **Category**  A category page containing product listings related to a specific category.
* **Cart**  The cart page for a store, listing the customer's current cart contents. Often the entry point for checking out.
* **Other**  Any page that does not fit the previous page types.

Do **not** add it to pages containing PII (personally identifiable information), credit card information:

* **Checkout**  The checkout page that facilitates the process of placing an order.
* **Account**  A page that's related to the customer's account information.

[![Provide feedback button](/resources/Storage/contextual-commerce/bv-global/topic-footer-2026/provide-feedback-button.png)](https://docs.google.com/forms/d/1qGZ5rApqDrXO_j6vNzcDihDAOPMEjmUr1alHvcEIbQU/edit)