Accessing Data from the API Request

This article explains how you can access tracked data from the JENTIS HTTP API in our platform. You will need access to your JENTIS Platform.

The main difference between tracking on your website and the JENTIS HTTP API is that the API has no direct connection to JENTIS and only sends information to our servers. Therefore, accessing and using this information in variables requires a different approach.

There are two possible approaches to this: creating a client-side variable or a server-side one. Please choose the one that best fits your needs:

Approach 1: Client-Side Variable

On web tracking, Client-Side Variables extract information from the browser using JavaScript functions.

circle-exclamation

On the JENTIS Platform, you can create a new variable by accessing Server Tag Manager > Add New Variable > Client Side Javascript Code. We recommend naming these variables with a prefix such as http_api_<name_of_variable>.

Once you type the variable name, the ID will be generated automatically. Please use this generated ID for the variables - Section of the JENTIS HTTP API Request. The JENTIS Platform will automatically assign the pushed value to the corresponding variable by pushing a dataset with this ID as the key.

Example

The following data is send through the JENTIS HTTP API:

...
 "variables": {
      "jtspushedcommands": ["api-order-mobile-pay", "submit"],
      "order_status" : "cancelled",
      "document_title": "Order Confirmation",
      "document_location_href": "https://www.test.co/",
      "order_brutto": "250.00",
      "order_id": "ORDERID",
      ...
...

Next, to access the value of the property order_status, create a client-side variable:

circle-info

The scope should be fixed to “Event

The JavaScript code can be left as generated by the JENTIS System.

Using this client-side variable in server-side tags will automatically retrieve the value from the data pushed by the JENTIS HTTP API and resolved to “cancelled” for this example.

Approach 2: Server-Side Variable

If you prefer not to use the previous approach, which involves creating client-side variables as placeholders to extract information from the JENTIS HTTP API, we offer an alternative option of creating a server-side variable. To access the JENTIS HTTP API variable property with server-side variables, we provide a template variable that allows direct access to a key in the variables section of the request.

The template variable can be found in the JENTIS Platform under Server Tag Manager > Add New Variable > Server Side, and by selecting the template “HTTP API Property”.

Example

The following data is pushed to the JENTIS App SDK data layer:

Next, to access the value of the property order_status, create a server-side variable using the template “HTTP API Property”:

By using this server-side variable in server-side tags, the value will automatically be retrieved from the data pushed by the JENTIS HTTP API and resolved to “cancelled” for this example.

Last updated

Was this helpful?