Migrating Browse Event Capture to Script Manager

You can migrate your browse event capture to Script Manager so that your features all use the same script on your site.

About this task

After Script Manager is toggled on, the script is on your site, and you have set up browse event capture, the bba.js script will stop capturing data. This is true for both production and staging sites.

Procedure

  1. Add the Script Manager code to your site manually or with Google Tag Manager.
  2. Enable Browse Recovery or Recommendations Premium.
  3. Configure Script Manager features. See Configuring a Script Manager Feature.
  4. Test that browse data is being captured correctly.
    1. Browse for products on your e-commerce site.
    2. Open your web browser. There are two ways that you can verify browse data is being collected.
      • Within your browser's development tools, you can look for the cookie __bron_bar.
      • You can also run code within the console of your browser's development tools to print out all browsed products. Run this code in your console.
        brontoWebRecs.getRecentlyViewedProducts() 
    3. With either method of checking for browse data, you should see the productId value populated with an ID and time stamp if you have viewed a product. If this data is populated, then you are ready to remove your legacy scripts.
  5. Locate your existing code that includes bba.js.
    It should look similar to
    <script type="text/javascript" src="https://cdn.bronto.com/bba/bba.js"></script>
  6. Remove the code that links to bba.js.
  7. Verify that browse data is still being captured correctly following Step 4.