Skip to main content
Skip table of contents

JENTIS Code Snippet

JENTIS Tracking Code Snippet

In order to begin collecting data with JENTIS on your website, it is necessary to integrate a JavaScript code snippet.

We suggest inserting this code snippet as high as possible within the HTML head section of your website. This will create the optimal conditions for a stable and reliable stream of data.

It is essential to insert the tracking code snippet directly on your website and not via third-party tools.

Do not Copy Paste 

The following code is just a visual example. Do not copy-paste the code or parts of it.
You will find your individual code in your JENTIS account (homepage).

JavaScript

JS
// DO NOT COPY

(function (sCDN, sCDNProject, sCDNWorkspace, sCDNVers) {
  if (
    window.localStorage !== null &&
    typeof window.localStorage === "object" &&
    typeof window.localStorage.getItem === "function" &&
    window.sessionStorage !== null &&
    typeof window.sessionStorage === "object" &&
    typeof window.sessionStorage.getItem === "function"
  ) {
    sCDNVers =
      window.sessionStorage.getItem("jts_preview_version") ||
      window.localStorage.getItem("jts_preview_version") ||
      sCDNVers;
  }
  window.jentis = window.jentis || {};
  window.jentis.config = window.jentis.config || {};
  window.jentis.config.frontend = window.jentis.config.frontend || {};
  window.jentis.config.frontend.cdnhost =
    sCDN + "/get/" + sCDNWorkspace + "/web/" + sCDNVers + "/";
  window.jentis.config.frontend.vers = sCDNVers;
  window.jentis.config.frontend.env = sCDNWorkspace;
  window.jentis.config.frontend.project = sCDNProject;
  window._jts = window._jts || [];
  var f = document.getElementsByTagName("script")[0];
  var j = document.createElement("script");
  j.async = true;
  j.src = window.jentis.config.frontend.cdnhost + "<filehash>.js";
  f.parentNode.insertBefore(j, f);
})("<trackdomain>","<trackid>","<environment>", "<version>");

Placeholder

Placeholder

Description

Type

Example

<trackdomain>

Your DNS Domain. Replace the placeholder with the value from your JENTIS account.

string

//hhd728ju.example.org

<trackid>

Replace the placeholder with the value from your JENTIS account.

string

example-id

<environment>

Replace the placeholder with a string defined for your environment. The following setup should be used as a default:
live for the domain including the productive systems
stage on the staging and/or quality control systems

string

live

<version>

Replace the placeholder with a string defined the version you want to load to your setup. The following setup should be used as a default:
"_" for loading the last published version of the JENTIS Tag Manager

string

_

<filehash>

File Hash is generated when your container is created.

string

hj8kds

Testing

If you have correctly set up the JENTIS tracking code snippet, you will be able to find a network log entry (HTTP stream) in your browser's developer tools.

The resource loaded looks like the following:

NONE
https://<hash>.example.at/get/live/_/<filehash>.js

To make sure, the JENTIS script is loaded correctly, the DNS A Record has to be set. You can check our documentation on DNS Setup here.

After these steps, the loading of the script will respond with a 200 status code. Now a secure connection can be established and your Javascript is available.

Start Tracking

To implement the very first call and therefore tell JENTIS what to do you might use the following call. This will instruct JENTIS to track a pageview, which is the most common first step to start tracking.

JavaScript

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

This call can be implemented in your web application and thus activate tracking whenever a page is navigated.

A different idea might be to use this two lines of code and add it in your JENTIS account as a custom element in the Codes section. So JENTIS will automatically track a pageview every time the JENTIS basic tracking code snippet is loaded up.

Next Steps

Now that we have JENTIS up and running on your website - how about the tracking map? Do you have already a clear plan on further implementation to meet certain goals?

Let's look into the Architecture Guideline - Push OR Pull for the options we have to meet all those objectives on tracking.

JavaScript errors detected

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

If this problem persists, please contact our support.