Base Tracking Code

To start tracking from the visitors browser to the orchestration server, insert the following base tracking code to every page of your website.

We recommend to insert this code as early as possible, at least to the header (<head></head>) of your html structure.

IMPORTANT - The Basis-Tracking-Code needs to be inserted directly (native) on your website - not via Tag-Managers or Injection-Tools.

<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>","_");		

</script>
JS


PlaceholderDescriptiontypeexample
<trackdomain>Replace the placeholder with strings which are given from JENTIS to you!string"//jts.example.org"
<trackid>Replace the placeholder with strings which are given from JENTIS to you!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 system
  • stage
    • for the domain including the staging / QC system
string"live"

Testing

If you setup this base tracking code you should find a network http(s) stream in your browser developer tools.

https://<trackdomain>/get/<trackid>/live/_/jts.js
CODE

Example

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

As long as no setup at JENTIS side is made for you, you will load the following javascript snippet as result of the HTTP(s) stream

(function(){

    //Config
    var aJtsUrlStorageMap = {
        "jtsw"  : "jentis_cdn_workspace",
        "jtsv"  : "jentis_cdn_vers",
        "jtsp" : "jentis_cdn_project"
    };
    var sJtsTypePar = "jtst";

    //First: fast check if we are in preview
    var sSearchString = document.location.search;
    var bJtsPreview = false;
    for(var sKey in aJtsUrlStorageMap)
    {
        if(sSearchString.indexOf(sKey) !== -1)
        {
            bJtsPreview = true;
            break;
        }
    }

    ...
CODE