Deprecation Notice: Concierge Page Load Method for Transactional Data

Updating Transactional Data Passing from Page Load to JSAPI Method

Concierge previously provided two integration methods for passing transactional data for reporting purposes; the Page Load method, and the JavaScript API (JSAPI) method. The Page Load method is now deprecated and was removed from the Concierge documentation (Adding Concierge to a Website) in October of 2016 because the JSAPI method affords greater accuracy and now includes Concierge client state checking for passing data/events to Concierge.

Although the Page Load method still functions and is still supported, we strongly encourage all customers still using the Page Load method to update to the JSAPI method described in the latest documentation. At the time of this notice, that document is titled Concierge 1.1 Website Integration Guide and is available on the Moxie support portal.

This article includes information about transitioning from using the deprecated Page Load method for passing transactional data to using the current JavaScript API (JSAPI) method.

If you integrated Concierge with your website after October 2016, you should already be using the JSAPI method because the Page Load method was previously removed from the documentation.

Prior to updating the transactional data passing, please download the latest version of the Concierge Website Integration Guide on the Moxie support portal and read the section titled “Using the JSAPI to Pass Transactional Data to Concierge”.

 

Example: Updating the cart value and items

The following examples illustrate the difference between using the deprecated Page Load method and the current JSAPI method for updating the current cart value and items, which typically occurs when a visitor adds or removes items from the cart.

Deprecated Page Load Method

<script type="text/javascript">

    window.MoxieData = window.MoxieData || {};

    //This is the current value in the visitor shopping cart.  

    MoxieData.currentCartValue = 200.50;

    //This is the list of cart items

    MoxieData.currentCartItems = [{

        name: 'BlackBerry Bold 9000 Phone',   //User friendly name for the item

        skuOrId: 31,                          //An ID or SKU recognizable for the company

        value: 280,                           //The cost of an individual item

        quantity: 1,                          //How many of this item

        description: '',                      //A friendly description for the item

        uom: 'each'                           //The 'Unit of Measurement' for the item

    }];

 </script>

 

Current JSAPI Method

<script type="text/javascript">

 var myCurrentCartTotal = 200.50; // Current cart value, updated throughout the journey

 var myCurrentCartItems = [{

        name: 'BlackBerry Bold 9000 Phone',   //User friendly name for the item

        skuOrId: 31,                          //An ID or SKU recognizable for the company

        value: 280,                           //The cost of an individual item

        quantity: 1,                          //How many of this item

        description: '',                      //A friendly description for the item

        uom: 'each'                           //The 'Unit of Measurement' for the item

 }];

 /**

  * Allows client code to call into Concierge and update a transaction.

  * @method updateSession

  * @param session {Object} may include the following attributes:

  * - currentCartItems: {Array}

  * - currentCartValue: {Number}

  */

         conciergeReady.then(function() { 

   window.GoMoxie.concierge.updateSession({

     currentCartValue: myCurrentCartValue,

     currentCartItems: myCurrentCartItems

   });

 });

 </script>

 

Example: Passing completed transaction data

The following example illustrates the difference between using the deprecated Page Load method and the current JSAPI method for indicating the transaction is complete, which typically occurs when a visitor completes a purchase.

Deprecated Page Load Method

<script type="text/javascript">

    window.MoxieData = window.MoxieData || {};

    // This example assumes no cart contents or value updates are needed.

    // This indicates that the visitor completed their purchase.

    MoxieData.transactionComplete = true;

</script>

 

Current JSAPI Method

<script type="text/javascript">

 // If everything was previously updated via updateSession and no changes are needed:

 conciergeReady.then(function() { 

   window.GoMoxie.concierge.transactionComplete();

 });

 </script>