The Big Open Data Layer (shortened as BODL, pronounced ‘Bottle’) is a JavaScript object that simplifies sending data from BigCommerce-hosted storefronts to third-party analytics providers. It gives third-party scripts access to clean, consistent data. BODL makes store sites more efficient by consolidating data of interest and presenting it as a package. Each analytics script does not need to fetch the same data independently.
BODL is event-based. Scripts can capture accurate storefront data as it exists at the moment a shopper triggers any BODL-supported event.
This guide illustrates the basics of using BODL data in your integration. This article does the following:
For scripts to successfully use BODL to access storefront data, the following must be true:
BODL exposes data when shoppers trigger storefront events. Currently, BODL supports the following storefront events:
If a merchant enables the consent banner, the following fields appear in the BODL object for the bodl_v1_loaded_consent event when a page loads:
If a shopper changes the cookie consent settings, the following fields appear in the BODL object for the bodl_v1_update_consent event:
When the shopper enters search keywords and clicks Enter or presses the search button, the following fields appear in the BODL object for the bodl_v1_keyword_search event:
When a shopper views a storefront banner, the following fields appear in the BODL object for the bodl_v1_view_banner event:
When the shopper clicks a button to view the category page for a product, the following fields appear in the BODL object for the bodl_v1_product_category_viewed event:
When the shopper clicks a button to view a product page, the following fields appear in the BODL object for the bodl_v1_product_page_viewed event:
When the shopper clicks a button to add a product to a cart, the following fields appear in the BODL object for the bodl_v1_cart_product_added event:
When the shopper clicks a button to view a cart, the following fields appear in the BODL object for the bodl_v1_cart_viewed event:
When the shopper clicks a button to remove a product from the cart, the following fields appear in the BODL object for the bodl_v1_cart_product_removed event:
When the shopper clicks on the button to initiate a checkout process, the following fields appear in the BODL object for the bodl_v1_begin_checkout event:
Each time the shopper adds shipping information, the following fields appear in the BODL object for the bodl_v1_shipping_information_added event. This event can trigger multiple times for a single order.
Each time the shopper adds payment information, the following fields appear in the BODL object for the bodl_v1_payment_information_added event. This event can trigger multiple times for a single order.
When the shopper clicks a button to finalize a purchase, the following fields appear in the BODL object for the bodl_v1_order_purchased event:
The line_item object has many common fields for browser events, including the following fields:
You can use the Scripts API or control panel Script Manager to add scripts to a BigCommerce-hosted storefront.
Merchants must enable BODL in the store control panel for your script to subscribe to BODL events. Once BODL is enabled, BigCommerce checks every storefront page for the BODL object once per page render.
To view BODL properties in the browser console, use the following example script:
If a merchant enables cookie tracking consent, the shopper must provide consent to the category of consent (consent_category) to which the script is set. For more on consent categories, see the Script Manager support article.
The following is an example request that uses the Scripts API to associate the example script with pages on a storefront. Send a request to the Create a script endpoint. For more, see the Scripts API article.