Orders

Order tracking enables the client to evaluate media spending and creative designs on the basis of generated orders or even ROI.

Additionally when the order tracking is in place clients are able to target customers with specific advertising.

Order variables

The following tables contain implementation details about variables supported when using the Delta Projects tracker scripts.

All variable names and values are case sensitive.

Variable Definition Importance Notes
action The string representing an action that should trigger. Required Value must be "order" to register an order.
orderId A unique order identifier that connects several line items to a complete order. Required Example value: "o29235382". Usually the internal order identifier in the client's online order system. If the client's order system does not create a unique order identifier it is possible to use a mathematical random value. However the possibility to cross reference orders between Delta Projects and the client's order system will then be lost.
totalPrice Combined value of all items requested in this order. Recommended Example value: "1250.30". For conformity you should ensure the value is always excluding consumer tax (VAT).
currency ISO 4217 currency code for totalPrice. Allowed values are SEK, NOK, DKK, EUR, USD, GBP. Recommended Example value: "SEK". This would supplement totalPrice in determining the value.
items Array of additional item variables for the parent order. Recommended See the Order item variables for detailed information.
pageId Unique reference string to identify the current page. Optional Example value: "p1234".

Order items object variables

Definition for the objects in the items array of the order action.

Variable Definition Importance Note
sku Should be a unique reference string from your system to identify the product. Recommended Example value: "V4C3D5R2Z6".
unitPrice Value of the item(s). Recommended Example value: "45.50".
currency ISO 4217 currency code for unitPrice. Allowed values are SEK, NOK, DKK, EUR, USD, GBP. Recommended Example value: "DKK". This would supplement unitPrice in determining the value.
quantity Number of ordered products of this sku. Recommended Example value: 2.
productName Name of the product. Optional Example value: "Milk".
productCategory Category of the product. Optional Example value: "Dairy".

Tracker implementation guidelines

General conventions

String encoding

All strings going in or out of Delta Projects must be in UTF-8.

Secure pages

The Delta Projects javascript tracker automatically adjusts for secure pages. You can use it on either protocol.

Tracker placement

There are no restrictions on where to put the javascript tracker, our recommendation is to put the script at the end of body as per yahoos best practices for speeding up your web site. But since the script is asynchronous and every measure has been taken not to block your page from loading the choice of placement is in your hands.

Placeholders

The tracker script added to pages should never contain the placeholder values, please remove the variable entirely if not used/needed. See examples below. Note that YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID will be replaced by Delta Projects.

YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID

In the examples in this document YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID is a placeholder string. In the trackers shipped from Delta Projects this placeholder is replaced with the id of your account in Delta Projects systems.

YOUR_PAGE_ID

The pageId variable is used to track specific pages. If the tracker script is wrapped in an iframe the pageId is mandatory for tracking that specific page. Tracking of pages can also be accomplished without the pageId by using either the title, the referrer or the URL of the page.

YOUR_ORDER_ID

The orderId variable is specific to the order action, in the shipped scripts from Delta Projects it is recommended that you replace this placeholder with your internal orderId. If you do not replace the placeholder then the script will generate a random orderId for each registered order.

YOUR_TOTAL_PRICE

The totalPrice variable is specific to the order action, in the shipped scripts from Delta Projects it is recommended that you replace this placeholder with the actual totalPrice for each registered order. If it is omitted then both totalPrice and currency will be ignored.

YOUR_CURRENCY

The currency variable is specific to the order action, in the shipped scripts from Delta Projects it is recommended that you replace this placeholder with the currency (ISO 4217, 3 letter code) of totalPrice. If it is omitted then both totalPrice and currency will be ignored. Allowed values are SEK, NOK, DKK, EUR, USD, GBP.

Format Options

Our tracker may be implemented in a number of ways. The most common implementation is a small javascript placed on the client web page where one or more actions should be tracked.

The tracker scripts used for the implementation may be downloaded from the Delta Projects UI or sent to you by email from Delta Projects staff.

Sample implementations of our different tracker formats.

Order tracker example

A sample order registration with all recommended variables, excluding optional variables:

<script type="text/javascript">
  var _d7=_d7||[];

  _d7.push({
    action:"order",
    orderId:"o23452431",
    totalPrice:"299",
    currency:"USD"
  });

  (function(){
    var d=document.createElement("script"),s=document.getElementsByTagName("script")[0];
    _d7.id="YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID";_d7.p=("https:" == document.location.protocol ? "https://" : "http://");
    d.src=_d7.p+"tb.de17a.com/d7.js";d.type="text/javascript";d.async=1;s.parentNode.insertBefore(d,s);
  })();
</script>

A sample order registration with all recommended variables and pageId definition, excluding optional variables:

<script type="text/javascript">
  var _d7=_d7||[];

  _d7.push({
    action:"order",
    orderId:"o23452431",
    totalPrice:"299",
    currency:"USD",
    pageId:"YOUR_PAGE_ID"
  });

  (function(){
    var d=document.createElement("script"),s=document.getElementsByTagName("script")[0];
    _d7.id="YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID";_d7.p=("https:" == document.location.protocol ? "https://" : "http://");
    d.src=_d7.p+"tb.de17a.com/d7.js";d.type="text/javascript";d.async=1;s.parentNode.insertBefore(d,s);
  })();
</script>

A sample order registration with all recommended and optional variables

<script type="text/javascript">
  var _d7=_d7||[];

  _d7.push({
    action:"order",
    orderId:"o29235382",
    totalPrice:"818.9",
    currency:"USD",
    items: [
      { sku:"B00CMQTVQO",
        productName:"PlayStation 4: Standard Edition",
        productCategory:"Video Games",
        unitPrice:"699",
        currency:"USD",
        quantity:"1"
      },
      { sku:"B00BGA9X9W",
        productName:"PlayStation 4 Dualshock 4 Wireless Controller",
        productCategory:"Video Games",
        unitPrice:"59.95",
        currency:"USD",
        quantity:"2"
      }
    ]
  });

  (function(){
    var d=document.createElement("script"),s=document.getElementsByTagName("script")[0];
    _d7.id="YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID";_d7.p=("https:" == document.location.protocol ? "https://" : "http://");
    d.src=_d7.p+"tb.de17a.com/d7.js";d.type="text/javascript";d.async=1;s.parentNode.insertBefore(d,s);
  })();
</script>

A sample order that is triggered on a click event

<a id="clickevent" onclick="pushOnClick()" href="#">Click event</a>

<script type="text/javascript">
  var _d7=_d7||[];

  (function(){
    var d=document.createElement("script"),s=document.getElementsByTagName("script")[0];
    _d7.id="YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID";_d7.p=("https:" == document.location.protocol ? "https://" : "http://");
    d.src=_d7.p+"tb.de17a.com/d7.js";d.type="text/javascript";d.async=1;s.parentNode.insertBefore(d,s);
  })();
</script>

<script type="text/javascript">
  function pushOnClick() { _d7.push({action:"order", pageId:"ClickEvent",orderId:""})
  }
</script>

Last modified: Wed Apr 27 2016 11:20:06 GMT+0200 (CEST)