Mapping Cart Selectors to Your Site Using JSON Objects

If all of the items you want to collect data on are stored in the same JSON object, you can use the JSON object to map items on your site to Bronto cart selectors in order to pass customer data to Bronto.

About this task

Cart selectors are used to identify objects on your site that represent specific shopping cart items you would like to use to capture customer data. There are two ways to identify and map items on your site to Bronto cart selectors:
  • JQuery Selectors: You can use JQuery selectors to identify each relevant item in your site's code and once you have identified the item you can map it to its corresponding cart selector. For more information see Mapping Cart Selectors to Your Site Using jQuery Selectors.
  • JSON Objects: When all of the items you want to collect data on are stored in the same JSON object, you can use the JSON object to map items on your site to Bronto cart selectors. To do this, follow the instructions below.

Before your cart selector mappings will work you need to add the Web Integrations Manager code to your site.

To map cart selectors using a JSON object:

Procedure

  1. Go to Settings > Platform Settings > Commerce.
  2. Click on the name of a Cart View.
  3. Click the pencil icon associated with the shadowDiv1 cart selector.
    1. Enter the JSON object from your site into the jQuery Selector box.

      Make sure the JSON object you use contains the fields for all of the items you want to map to other cart selectors.

    2. Click Save Changes.
  4. Click the pencil icon associated with the cart selector you want to map.
    1. Enter div in the jQuery Selector: box.
    2. Enter the corresponding JSON object field in the Attribute: box.

      Make sure the JSON field you choose matches the description for the selector in Bronto

    3. Click Save Changes.
  5. Repeat step 4 until all of the relevant cart selectors are mapped.
  6. Optional: If your contacts can use third-party sites to buy products, map the cartLinkSelector to every link that takes you from your domain to the third-party checkout domain.

    Mapping the selector appends Bronto cookie information to these links. This allows Bronto to transfer cookies from your site to other domains and with these cookies Bronto can continue to collect order data if a contact shops on your site but uses a third-party site to check out.