The Orders tab in the Script Builder now allows you to attribute online purchases to your contacts who have clicked through from your email campaign to the web site.  The purchases passed to the web tracking script here will be stored in the Product/Revenue database.

When you view this tab for the very first time, you will see that the purchase information is passed to the web tracking script as a JSON-formatted data structure.  You’ll also note that the data structure is similar to that used by the Product/Revenue API.

The JSON-formatted data structure passed as an order is strictly used by the Product/Revenue database and is not available for personalization within the body of an email.  For that, you will either need to pass the cart data as a web funnel, or store them in Relational Tables and use the relational table personalization tags in the body of your email content.

The way that web tracking for orders works is your web page will declare universal variables and set their values that encapsulate the order data.  The Javascript you write here in this section reads those variables and transforms them into the required JSON-formatted data structure.

View an example of Javascript for tracking web orders.

  • Page URL – this URL should be that of your “Success” page that is displayed when the payment has been completed and all details of the order have been finalized.
  • [Add More] – click this button for any additional “Success” pages in case you have additional purchase funnels on your web site.

The elements of the JSON-formatted data structure are defined as follows:

  • order_unique (optional) – by default, this value is set to “false”.  If you want to enforce a rule that no two orders for the same contact can have the same “original_order_id”, then set this flag to “true.”
  • list_ids (optional) – allows you to subscribe the contact to any of your mailing lists at the same time you are recording the person’s purchase order in the database.
  • order_date (required) – provide the date in YYYY-MM-DDTHH:MM:SS format.
  • order_status (required) – any keyword that you provide.  There is no restriction as to which keywords you want to use.  All orders regardless of status are captured as orders and the order amount is calculated for each contact’s Lifetime value.  The keyword(s) that you provide will appear in the “Purchased with Status” segmentation rule.
  • original_order_id (required) – an alphanumeric sequence of characters.  If you have set “order_unique” to “true”, then the platform will not accept any orders that have duplicate values of “original_order_id” for the same contact.
  • grand_total (required) – a float value.  The grand total for the order is used to calculate the contact’s Lifetime value.
  • order_items (required) – The order_items array allows you to pass in multiple line items that constitute the entire order.
    • item_id (required) – an alphanumeric sequence of characters.  Typically, the Item ID represents the product SKU.  The Item ID is displayed when selecting any product-related segmentation rule.
    • price (required) – a float value.  Is the extended cost (not the unit cost) of the order line item
    • quantity (required) – an integer value.  Is the quantity purchased of this particular product.
    • description (required) – a short description of the product.  The description is displayed when selecting any product-related segmentation rule.
    • adcode (optional) – an optional identifier for the item purchased.
    • category (optional) – the category of the product purchased.  The category you provide here is used by the Product Category segmentation rule.