Tracking Preview Mode

What is Tracking Preview Mode?

You can check any tracking URL (ad impression, click, conversion, CAD) calling it in preview mode. A preview tracking request will be processed as closely as possible to the regular one. Some processing parts like the spider treatment are skipped. On the other hand, there are some additional checks such as the extended basket evaluation, especially in the preview mode.

No request processing results are stored or counted, so the same tracking URL can be called several times in preview mode. Processing results will be sent back as a JSON object containing all input parameters and calculated values like redirecting location URL or processing error information.

Working with Preview Mode

Preview mode is activated by adding of the query parameter preview_mode set to 1 or true to the regular URL (…&preview_mode=1)

Preview response always has the HTTP status 200 (OK), regardless of whether a processing error occurs.

Response content is a Json object containing

  • untracked_reason - object (in case of Untracked) containing code, alias and optional message

  • params - all request parameters like amc

  • validated parameter values like normalized basket

  • request specific calculated values like click channel or best matching voucher id on conversions

  • redirecting location URL

  • attribution information on conversions

  • explanation of why a click is filtered out due to custom click filters

The untracked_reason object is always present if processing was unsuccessful

Example CAD preview response:

 

{ "params": { "cfd": "2020-12-14 17:26:49", "cfs": "cnf", "cid": "186125995", "ctg": "New Customer", "mkey": "061e6833-d3b6-4fd4-af49-e92e3d99406f", "preview_mode": "1", "trc": "Tous les supports publicitaires", "tst": "1607963209", "typ": "d", "uniqid": "1bec1888-d157-379e-809e-5757d18818ec" }, "real_request_type": "ConversionAdditionalData", "request_subtype": "AdditionalData", "cfd": "14.12.20 17:26:49", "np_free": { "mkey": "061e6833-d3b6-4fd4-af49-e92e3d99406f", "preview_mode": "1" }, "conversion_id": "186125995" }

Preview Mode on onpage clicks / conversions

You can let onpage clicks and conversions be called in Preview Mode using an internal preview cookie, which can be set manually before testing and should be removed afterwards. All tracking requests with this cookie set are called as in Preview Mode, so you can just load the landing page to check onpage clicks, or make a test purchase to see the attribution results immediately.

Preview response with cookie looks different because the preview Json object cannot be sent directly in response body, which is always the one pixel image both on clicks and conversions. The preview Json object is transmitted in the custom http header x-preview-response, which can be found in http log of the browser.

Example:
x-preview-response: { "params" : { "bsk" : "{"pid":"X2HZA9W","prn":"Matratzenschoner weiss","pri":"22.64","qty":"1","trc":"MP"}" , "cid" : "B-R4D-ARF-YXY" , "csi" : "4fa728c5-fc92-46d4-be25" , "csn" : "true" , "ctg" : "NewCustomerVoucher" , "inv" : "31.94" , "orc" : "EUR" , "orv" : "22.64" , "pmt" : "paypal" , "sid" : "checkout" , "trc" : "basket" , "typ" : "f" , "uv1" : "4fa728c5-fc92-46d4-be25-7cfd72c36ca6"} , "real_request_type" : "ConversionEvent" , "request_subtype" : "Multi" , "response_content" : "<!DOCTYPE html><html><head><title></title><meta name="content-type" content="text/html; charset=UTF-8"></head><body></body></html>" , "untracked_reason" : { "code" : 91 , "alias" : "UnknownConversionTarget" , "message" : "unknown ctg <NewCustomerVoucher>"} , "tracking_category" : "basket"}

To set the preview cookie call the following URL:

https://[tracking_domain]/ts/[advertiser_ID]/tsv?settrackingpreviewmode=a

After you have replaced the tracking domain and the ID of the advertiser, the tracking URL will look more or less like this:

https://marketing.net.advertiser.com/ts/i1234567/tsv?settrackingpreviewmode=a

To remove the preview cookie call the following URL

https://[tracking_domain]/ts/[advertiser_ID]/tsv?resettrackingpreviewmode=a