Migrate From Legacy Conversion Tracking

An account must use Order Service in order to use several of Bronto's new features. If your account uses Legacy Conversion Tracking, then it does not use Order Service and will need to be migrated.

About this task

You can check if Order Service is enabled by going to Home > Settings > Commerce. If Order Service is enabled, you will see the text Status: Order Service is enabled.

If you are currently using Legacy Conversion Tracking without Order Service, you will need to set up the Script Manager and Order and Cart Capture JavaScript scripts and remove your legacy embed code.

This process involves building a Order and Cart Capture JavaScript Snippet and adding it to the code on your site in order to allow Bronto to collect cart and order data. Once you're sure order data is being collected, Bronto support will work with you to migrate your old order data to order service.

You will complete some parts of orders migration yourself and some steps will be performed by customer support. We'll walk you through the full steps below.
Note: This process involves significant JavaScript changes as well as a possible migration from Bronto's SOAP Orders API to the Bronto Orders REST API. We recommend you're comfortable with JavaScript before starting this migration. If you use Data Loader you will also have to update your Data Loader imports after customer support starts the orders migration process.

To migrate using the Order and Cart Capture JavaScript Snippet conversion process:

Procedure

  1. Go to Home > Settings > Script Manager.
  2. Copy all of the code in the black box. Do not edit the code.
  3. Add the Script Manager code to your site by placing it under your existing embed code:
    1. Locate your existing embed code.
      It should look similar to
      <script type="text/javascript">
                        document.write(unescape("%3Cscript src='"
                        + ((document.location.protocol == "https:") ? "https:" : "http:")
                        + "//p.bm23.com/bta.js' type='text/javascript'%3E%3C/script%3E"));
                        </script>
                        <script type="text/javascript">
                        var bta = new __bta('somevalue');
                        bta.setHost("app.bronto.com");
                        </script>
    2. Copy the Script Manager code from Home > Settings > Script Manager.
    3. Paste the copied code below your existing embed code.

    It's very important that you do not replace your existing embed code. Using both methods to collect order data will ensure no order data is lost until your account is set up properly with Order Service. Make sure each code snippet is enclosed in its own script tags.

  4. Copy the Order and Cart Capture JavaScript Snippet and modify it to capture the appropriate data from your site.
    Note: You cannot simply copy and paste this script onto your site. The script must be modified so that it is passes in order data from your site.
    Configure fields to pass data from Bronto. For example, 35.98 could become <?= $order_data[grandTotal] ?> in your code.
    <script type="text/javascript">
      bronto('cart:send', {
            "customerCartId": "cart_ABC123", // Set for testing. This value will be auto-generated when not set. 
            "phase": "ORDER_COMPLETE", // Set as SHOPPING for Cart Recovery
            "currency": "USD",
            "subtotal": 35.98,
            "discountAmount": 0,
            "taxAmount": 0,
            "grandTotal": 35.98,
            "customerOrderId": "123ABC", // Not necessary for Cart Recovery
            "emailAddress": "example@example.com",
            "cartUrl": "http://brontogear.com/",
            "shippingAmount": 7.99, // Not necessary for Cart Recovery
            "shippingDate": "05 - 18 - 2018", // Not necessary for Cart Recovery
            "shippingDetails": "FedEx", // Not necessary for Cart Recovery
            "shippingTrackingUrl": "http://fedex.com/tracking/NIeX3KYLcPhgRzKy", // Not necessary for Cart Recovery
            "lineItems": [{
                    "sku": "576879",
                    "name": "Shirt",
                    "description": "A super great description of the product",
                    "category": "Shirts > T-Shirts > Blue",
                    "other": "This can be any string value you like",
                    "unitPrice": 11.99,
                    "salePrice": 11.99,
                    "quantity": 2,
                    "totalPrice": 23.98,
                    "imageUrl": "http://brontogear.com/a/p/shirt.jpeg",
                    "productUrl": "http://brontogear.com/index.php/shirt.html"
                  },
                 {
                     "sku": "1112296",
                     "name": "Fleece Jacket",
                     "description": "A well appointed Fleece jacket",
                     "category": "Jackets > Winter > Fleece",
                     "other": "This can be any string value you like",
                     "unitPrice": 65.99,
                     "salePrice": 55.50,
                     "quantity": 1,
                     "totalPrice": 55.50,
                     "imageUrl": "http://brontogear.com/a/p/fleece.jpeg",
                     "productUrl": "http://brontogear.com/index.php/fleece.html"    
                }
            ]
        });
    </script>

    Adding the Order and Cart Capture JavaScript Snippet includes removing any fields you do not want to collect and send to Bronto and updating the JavaScript snippet to properly collect the order data you do want to pass from your site. emailAddress and grandTotal are both required fields. For line item data, quantity and totalPrice are also required.

  5. Add your modified Order and Cart Capture JavaScript Snippet to your site below the existing code your site uses to capture order data.

    The existing order capture code snippet should have bta.addOrder in it. It's very important that you do not replace your existing code. Using both methods to collect order data will ensure no order data is lost until your account is set up properly with Order Service. Make sure each code snippet is enclosed in its own script tags.

  6. In Bronto, configure your order settings.
  7. Test that the order data is being captured correctly:
    1. After you have completed the previous steps, place a test order on your site.
    2. In Bronto, navigate to Tables > Orders.
    3. Click Show Advanced Options.
    4. Use the Order Date fields to search for orders from the current day.
    5. Find your test order in the list and compare the order details in Bronto to the order details on your site.

      We recommend exporting your order data from both Bronto and your commerce platform and running a comparison. Roughly 90% of the data from your site should be represented in your Bronto export file. If the data does not match, check the formatting of the Order and Cart Capture JavaScript Snippet.

    6. If the order is missing in Bronto or the order details do not match, make sure your Order and Cart Capture JavaScript Snippet is constructed properly and both the snippet and the embed code and included in your site code appropriately. Make any necessary adjustments and test again.
  8. Click the Enable Order Service button on the Home > Settings > Commerce page to transfer historical orders from Legacy Conversion Tracking to Order and enable Order Service.
  9. Note: Depending on how many orders you have in Legacy Conversion Tracking, it could take up to 2 days to all historical orders to Order Service. You will receive an alert in Bronto and an email notification when your orders are fully migrated and Order Service is enabled.
    You can verify that Order Service is enabled at Home > Settings > Commerce. You will see the text Order Service is enabled with a green checkmark. Reporting will also display as an item on the Bronto navigation menu.
  10. If you currently use Bronto's SOAP API to import order data, update your API process to use Bronto's REST API.
  11. If you use Data Loader to import order data, update your Data Loader imports after Bronto customer support has started the order data migration process.

    You will receive a prompt in Data Loader when it can be updated.

    We recommend using either Bronto's API or Data Loader as a backup method of importing order data. JavaScript has browser and configuration dependencies so we cannot guarantee the accuracy of order data when it is sent by this method alone.

  12. When support contacts you to verify the migration process is complete, use the Tables > Orders page to verify your order data looks accurate.
  13. Finally, remove the old embed and conversion tracking code.