Install the JENTIS Snippet

Integrating a JavaScript code snippet is necessary to begin collecting data with JENTIS on your website.

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 data stream.

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

// DO NOT COPY - JUST FOR VISUAL REFERENCE

(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
Description
Type
Example

<trackdomain>

Your JENTIS container DNS Domain. This will be replaced in your individual JTM container automatically when the code is generated in the UI.

string

https://hhd728ju.example.org

<trackid>

Your JENTIS container Identifier. This will be replaced in your individual JTM container automatically when the code is generated in the UI.

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 (default with your JTM container when created) stage on the staging and/or quality control systems

string

live

<version>

By default the code will fallback to the latest version, indicated by a _ value.

Optionally replace the placeholder with a string which defines the version you want to load to your setup, if no dynamic update is desired. The following setup will be used as a default:_for loading the last published version of the JENTIS Tag Manager container.

string

_

<filehash>

A unique identifier for a container source file. This will be replaced in your individual JTM container automatically when the code is generated in the UI.

string

hj8kds

Testing

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

The resource loaded looks like the following:

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

To ensure the JENTIS script is loaded correctly, the DNS A record must be set. For more information, read the article DNS Setup.

After these steps, the script will load and respond with a 200 status code. A secure connection can now be established, and your JavaScript is available.

Your configuration will also be automatically verified within up to 30 minutes after you set up the JENTIS tracking code snippet on your website. Alternatively, you can return to your container’s configuration and click Verify.

You can always check the status of your HTML Code on your containers' configuration:

Start Tracking

Implementing Pageview Tracking with JENTIS

To start tracking with JENTIS, use the following JavaScript function calls. These commands enable automatic tracking whenever a page is visited.

Add the following lines of code to your web application:

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

Alternative Method

Alternatively, under the Codes section, insert the code snippet as a custom element within your JENTIS account. This ensures that a pageview is tracked each time the basic JENTIS tracking code snippet is executed.


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

Last updated

Was this helpful?