Server-to-Server Order Tracking for E-Commerce
    • 2 Minutes to read
    • Dark
      Light

    Server-to-Server Order Tracking for E-Commerce

    • Dark
      Light

    Article summary

    Server-to-server tracking is a very effective method for online shops to get 100% tracking accuracy of orders in Mapp Intelligence. Especially when using external payment providers (PayPal, banks) where the end user leaves your website for payment, server-to-server tracking is the recommended method to achieve a high accuracy of tracking data.

    The method described below is explicitly and only recommended for submitting orders and not for general page tracking. The recommendation also only applies in the event that the pixel cannot successfully submit the orders to Mapp Intelligence.

    Process Overview

    The basic process involves the use of the Mapp Intelligence pixel (standard tracking) on all pages of the site, with the exception of the order confirmation page. All orders would be sent with server-to-server tracking.

    Example process

    The Mapp Intelligence tracking pixel is implemented on sub.domain.tld.

    1. The end user reaches the last page of the checkout process before leaving your site to pay with a third-party payment provider.
      For example, https://sub.domain.tld/cart_checkout would be the last page before the user leaves your site. On this page, you must implement a special code to store the EID. The EID is crucial for the subsequent analysis of the visitor and his order information, such as customer journey, processes/funnels for checkout, analyses such as "users who bought product X also bought product Y," etc. The EID is also used for the analysis of the visitor's order information.

    2. The end user goes to the third-party's website.

    3. The third-party website sends the confirmed order as a server-to-server request to Mapp.

    4. The EID can be obtained from the Mapp Intelligence cookie for use with Server-to-Server tracking.

      Name of the cookie

      wt3_eid

      Cookie content

      [track ID]|[ever ID]#[last visit]

      Example

      ;111111111111111|2138210064900146323#2138210027300810268

      Cookie domain

      *.domain.tld (without subdomain)

      Cookie path

      /

      Cookie runtime

      6 months

    5. As soon as the user proceeds to the checkout, the EID is saved in a session for later use.

      Example

      // ...
      if (arg(0) == 'cart_checkout' && !isset($_SESSION['webtrekk_eid'])) {
       $webtrekk_eid_cookie = $_COOKIE['wt3_eid'];
       $webtrekk_eid_1 = explode('|', $webtrekk_eid_cookie);
       if (!empty($webtrekk_eid_1)) {
       $webtrekk_eid = explode('#', $webtrekk_eid_1[1]);
       $_SESSION['webtrekk_eid'] = $webtrekk_eid[0];
       }
      }
      // ...
    6. The resulting EID is as follows and will be forwarded to the Server-to-Server request.

      $_SESSION[webtrekk_eid] => 2138210064900146323;

    Unique User Identification without Cookies

    For users who do not accept cookies, Mapp Intelligence uses the following fields to identify a unique user and to create an EID:

    • REMOTE_ADDR

    • HTTP_USER_AGENT

    We therefore recommend that you also send the following information for each server-to-server request:

    • ###webtrekk_ip### >> $_SERVER['REMOTE_ADDR']

    • ###webtrekk_user_agent### >> $_SERVER['HTTP_USER_AGENT']

    Example Server-to-Server Request

    For visitor/visit recognition, the following parameters must be sent with each request:

    Parameter

    Description

    eid

    Ever ID

    X-WT-IP

    IP address

    X-WT-UA

    User agent

    If the EID is empty, we use the combination of X-WT-IP and X-WT-UA to create an EID internally on our site. This allows to create customer journeys and processes for users who do not accept cookies.

    Example request for an order

    https://track.webtrekk.net/111111111111111/wt?p=300,cart.checkout.complete
    &eid=2138210064900146323&ba=BlueShoes%3BVacation%3BWork&co=18.00%3B408.00%3B4.50
    &qn=1%3B1%3B1&st=conf&oi=242453&ov=430.5&X-WT-IP=###webtrekk_ip###
    &X-WT-UA=###webtrekk_user_agent###

    The following parameters are mandatory for an e-commerce order:

    Parameter

    Description

    ov

    Order value

    oi

    Order ID

    For product information (such as the best-selling products), the following parameters are obligatory:

    Parameter

    Description

    ba

    Product name

    co

    Product cost

    qn

    Product quantity

    st

    Product status (with server-to-server requests for orders "conf" always has to be passed)

    We recommend giving the content ID for these requests a unique name, which means that it is not a content ID that is already used elsewhere on the website. This will later help you to analyze/evaluate the traffic to this page.


    Was this article helpful?