Add JENTIS to Your Website
  • 21 Jun 2022
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

Add JENTIS to Your Website

  • Dark
    Light

JENTIS Tracking Code Snippet

To start data collection with JENTIS on your website you must integrate a JavaScript code snippet.

We recommend to insert this code as high as possible in the HTML-head section of your website. Thus creating the best precondition for a stable and reliable data stream.

IMPORTANT – The tracking code snippet needs to be inserted directly (native) on your website – not via third party tag manager or injection tools (piggyback-containers).


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 code in your JENTIS account (homepage).



<script>

(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/"+sCDNProject+"/"+sCDNWorkspace+"/"+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+"jts.js";
    f.parentNode.insertBefore(j, f)
})("<trackdomain>","<trackid>","<environment>","<version>");        

</script>

Placeholder

PlaceholderDescriptionTypeExample
<trackdomain>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.stringexample-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
stringlive
<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_




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.

_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.

Testing

If you setup this tracking code snippet correctly you will find a network log entry (https stream) in your browsers developer tools.

https://jts.example.at/get/my-track-id/live/_/jts.js

As long as no version is published in your account you will receive a 404 HTTP status code.


Was this article helpful?