Skip to main content
Skip table of contents

JENTIS Data Layer: Push Data

JENTIS offers two primary approaches for integrating your website with its tag management system: PUSH and PULL. You can choose the method that best suits your needs:

  1. PUSH: Your website actively sends data to JENTIS, enabling real-time delivery of specific parameters.

  2. PULL: JENTIS retrieves data parameters directly from your website without additional input.

If you choose the PUSH method, it’s essential to understand how it works to set up the integration correctly. In this article, you will find everything you need to know about this method.

Automatic Tracking vs. Active Data Pushing

JENTIS automatically tracks a wide range of data out of the box, including basic parameters and data from browser APIs. However, active data pushing becomes necessary when you want to send dynamic information from your Content Management System (CMS) or other information systems, such as product or user data.

In such cases, you can manually transfer this additional data as needed. The JENTIS platform is designed to be flexible, allowing you to extend the PUSH setup with custom arguments and values to match your specific requirements.

Syntax

The basic syntax of pushing data to JENTIS is to submit an object of key:value pairs to a predefined global scope array: window._jts

Example:

JS
window._jts = window._jts || []; // you can go ahead and create this safety call to instantiate an empty array, if JENTIS is not yet loaded

_jts.push({
    "track"  : "<trackcommand>",
    "prop-1" : "<prop-1-value>",
    "prop-2" : "<prop-2-value>",
    "prop-n" : "<prop-n-value>"
});

There are reserved names in that object that are treated special in the JENTIS data model:

The push function call will add data to the JENTIS Data Layer. The data layer holds all data so it can be submitted to the server when an event occurs (e.g., a click, pageview, or any other interaction in a web browser).

Pushing Data: What, When, and How

Whenever a relevant event occurs, all the data must be submitted to the server. But what is “all the data” and how do you determine the right moment to submit it?

The core principle is to add as much data and as many objects as you need by pushing them to the _jts API using push function calls. This data can be sent either in a single push or across multiple asynchronous push calls.

Data is actually submitted to the server only when a specific track value is submitted to the API. This predefined moment is referred to as a State. When pushing data, you can control when the data is transmitted to the server by including a “submit” or an “event” call in your push function.

Example:

JS
_jts.push({
    "track" : "submit"
});

Example:

JS
_jts.push({
    "track" : "event"
});

It is either track: "submit" or track: "event" that will always pack all data submitted and translate it into a state. In a state, all further actions will happen: data transmission to the server side, checking trigger conditions and activating tags.

If you want to create a custom state, you can, too. It's all customizable!

Tracking dependencies and properties

There are different dependencies on tracking commands. In the previous section, we mentioned the reserved properties "track" and "type". Now, there are important dependencies that you must know when working with that API.

Queue Based Dependencies

When multiple push function calls are submitted, all data becomes available in that state. Pushing a pageview interaction and next a product (in the context of that page, i.e. as a “product detail view”) will make both objects available to work with. Additionally, we must define the context in which that product was part. Its property "type" references this information; in our example below, that is "detailview".

Example:

JS
_jts.push({
    "track"  : "pageview",
    "title"  : "Detailpage"
});

_jts.push({
    "track"     : "product",
    "type"      : "detailview",
    "name"      : "T-Shirt"
});

_jts.push({
    "track"     : "detailview"
});

Here, we have a page on which a product was submitted with the type "detail view" and we also submitted a track command for that type: "detail view". With this queue, we define what happened (a pageview and a detail view), and part of that detail view was a product. Hence, the "type" is the same as the "track" command, making the product part of that interaction. We call this a queue-based dependency, as the data is all part of one single queue (until that data is submitted in a state).

Finally, you just need to call _jts.push({"track":"submit"}) – and off it goes to the server to handle the rest.

Track Command-Based Dependencies

When pushing a certain track command (i.e. "event", "pageview", "product", etc.) all properties of that push are related to that object. This is the command-based dependency that we will look into more deeply here.

Let's see what that means in practice:

Example:

JS
_jts.push({
    "track"     : "pageview",
    "title"     : "Homepage"
});


_jts.push({
    "track"     : "product",
    "type"      : "listview",
    "name"      : "T-Shirt"
});

_jts.push({
    "track"     : "product",
    "type"      : "listview",
    "name"      : "Jeans"
})

The track command is a special operation. It defines what kind of object is pushed with it, making all properties part of exactly that pushed object. So, each object that should be tracked must be pushed separately, not as an array or list. Multiple products are pushed one by one. All properties pushed in that call are the properties of that single property.

Data submit

We have already touched on this topic several times: When will the data be submitted to the server? It always depends on the States, which define the moment to start the tracking. There are several ways to activate this process.

Auto Sending

Two track commands send directly all previously pushed data to the server.

  • submit

  • event

Both calls are directly connected to a default state (jts_push_submit) that exists in all JTM accounts and to which all default triggers are connected.

Use the Submit Command

Every time you are done pushing data to the JENTIS API (_jts), you should call the command submit. With this command, you create a state and start the HTTP(s) network stream to transmit the data to the JENTIS system sitting server-side.

All other tracking commands must be executed before the submit command. Otherwise, they will not be picked up by that state.

Example:

JS
_jts.push({"track":"submit"});

Usage of the Push’s Second Parameter

By handover true as a second parameter while pushing something to the array, all the data that was so far pushed will be sent to the server immediately. Creating the same state as with submit or event calls.

Example:

JS
_jts.push({
    "track"       :"addtocart",
    "productid"   :"1234",
},true);

Data Reset

If you would like to reset the JENTIS Data Layer manually, you can use the following command. This functionality can be used to reset the Data Layer within a state. The JENTIS Data Layer SEND State integrates this by default.

CODE
window.jentis.tracker.resetDatalayer()

Read next

JENTIS States Framework


If you have any questions or suggestions, contact us through our Helpdesk.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.