Knowledge Base
BROWSE TOPICS

Direct-to-Website Installation

17 min read
Updated 9 Jun 2026

Online Buyer Survey Code (Basic Setup)

Copy-and-paste the code below into your website’s Order Confirmation/Thank You page. Be sure to replace the ##Order_ID## and ##EMAIL_ADDRESS## placeholders with data calls for that information from your site.

<!-- Add to the HTML body of the order confirmation page for the Bizrate Online Buyer Survey. -->
<!-- Replace the MID, order ID, email address, and GTIN placeholders with values from your site. -->

<script type="text/javascript">
  var _cnx = _cnx || [];

  _cnx.push(['mid', '##INSERT_STORE_MID_HERE##']);
  _cnx.push(['surveyType', 'pos']);
  _cnx.push(['orderId', '##INSERT_ORDER_ID_HERE##']);
  _cnx.push(['emailAddress', '##INSERT_EMAIL_ADDRESS_HERE##']);
  _cnx.push(['gtin', '##INSERT_GTIN_HERE##']);

  (function (w, d, t) {
    var s = d.createElement(t);
    s.async = true;
    s.src = '//insights.bizrate.com/js/init.js';

    var h = d.getElementsByTagName(t)[0];
    h.parentNode.insertBefore(s, h);
  })(window, document, 'script');
</script>

Online Buyer Survey Code (Advanced Setup)

By configuring and including additional/optional code snippets, you can collect and append more data into the survey experience. This information will live in the background and is not visible to respondents, but will be included at the respondent-level for additional reporting and analysis capabilities. You are encouraged to include all optional passed-in data, some of which may incur an additional fee for setup and/or reporting. Options include:

  • Products purchased to analyze and aggregate customer purchasing behavior
  • Referring URL tracking to identify all online properties sending your website traffic
  • Customer identification assigned by you including customer ID & web analytics ID
  • Session ID tracking/URL (can be direct or via a third party)
  • A/B testing or page indicators
  • Custom identifiers

Refer to the Data Passing Dictionary below for accepted data points and pass-through content.

Data Passing Dictionary

Note: Make sure to have the basic code on the page before including any additional code and passed-in data. All data, except for your site’s MID, is optional and will be treated as strings. Please note that the string below includes placeholders and must be replaced with the data being called from your site (i.e., page identifier, etc).

Customer Identification

<script type="text/javascript">
  // Your internal identifier for the customer
  _cnx.push(['customerId', '123456']);

  // The customer's ZIP code
  _cnx.push(['zip', '90025-1234']);

  // The web analytics ID for the current page or session
  _cnx.push(['webAnalyticsId', 'webAnalyticsId123345']);

  // The customer's email address
  _cnx.push(['emailAddress', 'example@bizrate.com']);

  // Your internal identifier for the physical store location
  _cnx.push(['storeId', 'SEA-206']);
</script>

Custom Values

<script type="text/javascript">
  // Store up to two custom values for use in your analytics
  _cnx.push(['customValue1', 'a helpful custom value']);
  _cnx.push(['customValue2', 'another helpful custom value']);
</script>

Coupons

<script type="text/javascript">
  // Use true if a coupon was applied and false if it was not
  _cnx.push(['couponApplied', true]);
</script>

Page Type Identifier

<script type="text/javascript">
  // The current page's unique identifier
  _cnx.push(['pageId', 'orderConfirmation']);

  // A predefined customer or site segment
  _cnx.push(['segment', 'SiteA']);
</script>

Product Identification

<script type="text/javascript">
  // A 12-digit UPC or 13-digit EAN; required for Product Reviews
  _cnx.push(['gtin', '887223651093']);
</script>

Referring Page

<script type="text/javascript">
  // The referring page
  _cnx.push(['referrerPage', 'www.mypage.com']);

  // The referring URL
  _cnx.push(['referrerUrl', 'www.myURL.com']);
</script>

Shopping Cart Products

<script type="text/javascript">
  // Add one shopping-cart product
  var product4 = {
    id: '4040',
    price: '100.00',
    originalPrice: '100.00',
    quantity: 1,
    title: 'Sample Product Name',
    imageUrl: 'https://images.merchant.com/4040'
  };

  _cnx.push(['cart', product4]);

  // Alternatively, add products as a list
  var product5 = {
    id: '555',
    price: '303.03',
    originalPrice: '403.03',
    quantity: 1,
    title: 'Another Sample Product Name',
    imageUrl: 'https://images.merchant.com/555'
  };

  var cartList = [product5];
  _cnx.push(['cart', cartList]);
</script>

Online Buyer Survey Code | Sample

The sample below includes placeholders for multiple pass-throughs from the dictionary above. This is meant to show what the code will look like with these options included, but you must make calls for each of these in order to carry them into the final survey and script.

<script type="text/javascript">
  var _cnx = _cnx || [];

  // Required integration values
  _cnx.push(['mid', '##INSERT_STORE_MID_HERE##']);
  _cnx.push(['surveyType', 'pos']);

  // Order and customer values
  _cnx.push(['orderId', '##INSERT_ORDER_ID_HERE##']);
  _cnx.push(['emailAddress', '##INSERT_EMAIL_ADDRESS_HERE##']);
  _cnx.push(['gtin', '##INSERT_GTIN_HERE##']);
  _cnx.push(['pageId', 'orderConfirmation']);
  _cnx.push(['webAnalyticsId', '##INSERT_WEB_ANALYTICS_ID_HERE##']);
  _cnx.push(['referrerPage', '##INSERT_REFERRER_PAGE_HERE##']);
  _cnx.push(['referrerUrl', '##INSERT_REFERRER_URL_HERE##']);
  _cnx.push(['customerId', '##INSERT_CUSTOMER_ID_HERE##']);
  _cnx.push(['zip', '##INSERT_ZIP_CODE_HERE##']);
  _cnx.push(['storeId', '##INSERT_STORE_ID_HERE##']);

  // Use true or false
  _cnx.push(['couponApplied', true]);

  // Optional custom values
  _cnx.push(['customValue1', '##INSERT_CUSTOM_VALUE_1_HERE##']);
  _cnx.push(['customValue2', '##INSERT_CUSTOM_VALUE_2_HERE##']);

  // Product purchased
  var product = {
    id: '##INSERT_PRODUCT_ID_HERE##',
    price: '##INSERT_PRODUCT_PRICE_HERE##',
    originalPrice: '##INSERT_ORIGINAL_PRICE_HERE##',
    quantity: 1,
    title: '##INSERT_PRODUCT_TITLE_HERE##',
    imageUrl: '##INSERT_PRODUCT_IMAGE_URL_HERE##'
  };

  var cartList = [product];
  _cnx.push(['cart', cartList]);

  // Load the Bizrate Insights script after passing the available data
  (function (w, d, t) {
    var s = d.createElement(t);
    s.async = true;
    s.src = '//insights.bizrate.com/js/init.js';

    var h = d.getElementsByTagName(t)[0];
    h.parentNode.insertBefore(s, h);
  })(window, document, 'script');
</script>

Site Abandonment Survey Code (Basic Setup)

<!-- Add to the HTML body of every page except the order confirmation page. -->

<script type="text/javascript">
  var _cnx = _cnx || [];

  _cnx.push(['mid', '##INSERT_STORE_MID_HERE##']);
  _cnx.push(['surveyType', 'multi']);

  (function (w, d, t) {
    var s = d.createElement(t);
    s.async = true;
    s.src = '//insights.bizrate.com/js/init.js';

    var h = d.getElementsByTagName(t)[0];
    h.parentNode.insertBefore(s, h);
  })(window, document, 'script');
</script>

Site Abandonment Survey Code (Advanced Setup)

By configuring and including optional codes snippets, you gain visibility and reporting capabilities to further understand why your shoppers abandon and what actions they are taking on your website prior to doing so. You are encouraged to include all optional passed-in data. Additional reporting options, which may incur a fee, include:

  • Shopper abandonment stage:
    • After viewing the home page or product pages
    • After placing items in cart
    • After beginning the checkout process
  • Products viewed
  • Products added to the cart
  • Path of pages and products viewed
  • Exit page
  • Referring URL
  • Customer ID assigned by you

Data Passing Dictionary

Note: Make sure to have the basic code on the page before including any additional code and passed-in data. All data, except for your site’s MID, is optional and will be treated as strings. Please note that the string below includes placeholders and must be replaced with the data being called from your site (i.e., page identifier, your Order ID, etc).

Page Type Identifier

<script type="text/javascript">
  // The current page's unique identifier
  _cnx.push(['pageId', 'category']);

  // A predefined site or customer segment
  _cnx.push(['segment', 'en-us']);

  // Determines whether the invitation can display on this page
  _cnx.push(['invite', true]);

  // The web analytics ID for the current page or session
  _cnx.push(['webAnalyticsId', 'webAnalyticsId123345']);
</script>

Shopping Stage

<script type="text/javascript">
  // Use true when the current page is part of the checkout process
  _cnx.push(['checkout', true]);
</script>

Customer Identification

<script type="text/javascript">
  // Your internal identifier for the customer
  _cnx.push(['customerId', '123456']);

  // The customer's ZIP code
  _cnx.push(['zip', '90024-999']);

  // The customer's email address
  _cnx.push(['emailAddress', 'test@bizrateinsights.com']);
</script>

Coupons

<script type="text/javascript">
  // Use true if a coupon was applied and false if it was not
  _cnx.push(['couponApplied', true]);
</script>

Referring Page

<script type="text/javascript">
  // The referring page
  _cnx.push(['referrerPage', 'www.mypage.com']);

  // The referring URL
  _cnx.push(['referrerUrl', 'www.myURL.com']);
</script>

Viewed Products

<script type="text/javascript">
  // Add one viewed product
  var product1 = {
    id: '11111',
    price: '99.99',
    originalPrice: '120.00',
    title: 'Sample Product Name',
    imageUrl: 'https://images.merchant.com/11111'
  };

  _cnx.push(['product', product1]);

  // Alternatively, add viewed products as a list
  var product2 = {
    id: '222',
    price: '9.99',
    originalPrice: '9.99',
    title: 'Another Sample Product Name',
    imageUrl: 'https://images.merchant.com/222'
  };

  var product3 = {
    id: '33333',
    price: '0.99',
    originalPrice: '0.99',
    title: 'One More Sample Product Name',
    imageUrl: 'https://images.merchant.com/33333'
  };

  var productList = [product2, product3];
  _cnx.push(['product', productList]);
</script>

Shopping Cart Products

<script type="text/javascript">
  // Add one shopping-cart product
  var product4 = {
    id: '4040',
    price: '100.00',
    originalPrice: '100.00',
    quantity: 1,
    title: 'Sample Product Name',
    imageUrl: 'https://images.merchant.com/4040'
  };

  _cnx.push(['cart', product4]);

  // Alternatively, add shopping-cart products as a list
  var product5 = {
    id: '555',
    price: '9.99',
    originalPrice: '19.99',
    quantity: 1,
    title: 'Another Sample Product Name',
    imageUrl: 'https://images.merchant.com/555'
  };

  var cartList = [product5];
  _cnx.push(['cart', cartList]);
</script>

Custom Values

<script type="text/javascript">
  // Store up to two custom values for use in your analytics
  _cnx.push(['customValue1', 'a helpful custom value']);
  _cnx.push(['customValue2', 'another helpful custom value']);
</script>

Site Abandonment Survey Code | Sample

Product Details Page Without Placeholders Sample Code

Use the following code on product-details pages. Replace the empty values with the appropriate data calls from your website.

<script type="text/javascript">
  var _cnx = _cnx || [];

  _cnx.push(['mid', '##INSERT_STORE_MID_HERE##']);
  _cnx.push(['surveyType', 'multi']);
  _cnx.push(['pageId', '']);
  _cnx.push(['invite', '']);
  _cnx.push(['webAnalyticsId', '']);
  _cnx.push(['referrerPage', '']);
  _cnx.push(['referrerUrl', '']);
  _cnx.push(['customerId', '']);

  var product = {
    id: '',
    price: '',
    originalPrice: '',
    title: '',
    imageUrl: ''
  };

  _cnx.push(['product', product]);

  // You also have the option of storing up to two custom values
  // for later use in your analytics.
  _cnx.push(['customValue1', '']);
  _cnx.push(['customValue2', '']);

  (function (w, d, t) {
    var s = d.createElement(t);
    s.async = true;
    s.src = '//insights.bizrate.com/js/init.js';

    var h = d.getElementsByTagName(t)[0];
    h.parentNode.insertBefore(s, h);
  })(window, document, 'script');
</script>

Place the following code within your existing JavaScript method that adds products to the shopping cart.

var cartProduct = {
  id: '',
  price: '',
  originalPrice: '',
  quantity: '',
  title: '',
  imageUrl: ''
};

_cnx.push(['cart', cartProduct]);

Checkout Page Without Placeholders Sample Code

<script type="text/javascript">
  var _cnx = _cnx || [];

  _cnx.push(['mid', '##INSERT_STORE_MID_HERE##']);
  _cnx.push(['surveyType', 'multi']);
  _cnx.push(['checkout', true]);
  _cnx.push(['pageId', '']);
  _cnx.push(['invite', '']);
  _cnx.push(['webAnalyticsId', '']);
  _cnx.push(['referrerPage', '']);
  _cnx.push(['referrerUrl', '']);

  // These parameters are optional and can be added when applicable.
  _cnx.push(['customerId', '']);
  _cnx.push(['zip', '']);
  _cnx.push(['couponApplied', '']);
  _cnx.push(['orderId', '']);

  // You also have the option of storing up to two custom values
  // for later use in your analytics.
  _cnx.push(['customValue1', '']);
  _cnx.push(['customValue2', '']);

  (function (w, d, t) {
    var s = d.createElement(t);
    s.async = true;
    s.src = '//insights.bizrate.com/js/init.js';

    var h = d.getElementsByTagName(t)[0];
    h.parentNode.insertBefore(s, h);
  })(window, document, 'script');
</script>

Customization Options

We are constantly testing the latest tech to fully optimize the experience and shape the usability of our default invitation for all screen sizes. This ensures your customers’ experience with Bizrate Insights. solutions are optimized across all desktop, tablet, and mobile screens.

Please contact your account manager for assistance if you’d like to take advantage of any of these customization options.

Site Abandonment Customization Options Include:

  • Position of the invitation on your webpage
  • Frequency that the invitation is offered to repeat visitors
  • Percentage of traffic receiving the invitation
  • Invitation look & design
  • Rendering style & usability
  • Trigger invitation from user actions which you can customize by page type:
    • Number of page views
    • Page scrolled percentage
    • Time on site
    • Time on page
    • Item removed from cart
    • Value of items placed in cart
Was this article helpful?
Your feedback helps us improve the docs.