Tracking Code

Where to Find Tracking Code?

Follow these steps to get a project specific tracking code:

1. Visit https://app.useitbetter.com and sign in to the application.
2. Select the project for which you want to obtain the tracking code.
3. Open the navigation bar in the top right corner and select “Get Tracking Code”.

tracking-code

Tracking Code Versions

The tracking code is available in two versions: for in-page placement and for use with tag managers. The only difference between the two versions is that the version for tag managers uses a single script (tag) which dynamically adds necessary scripts to the page.

Below are examples for each of the versions. Parts replaced with letters “X” are project specific and you will need to get the exact version of your tracking code as described above.

The highlighted lines are related to Triggers and Responses functionalities and are optional.

Version for In-Page Placement

<script src="https://XXXXX.l.useitbetter.com/sdk/XXXXX/uResponses.min.js" async></script>
<script src="https://XXXXX.l.useitbetter.com/sdk/XXXXX/udash.min.js" async></script>
<script> 
    function initUDash ( i ){
        if (typeof uDash === 'undefined') { if (i < 50) { setTimeout(initUDash,50, i+1);} return; }
        uDash.init({ uProjectName: 'XXXXX',uProjectApiPass: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX',uPort: XXXXX });
    }
    initUDash (0);
</script>

Version for Tag Managers

 <script type="text/javascript">
 (function() {
     var ur = document.createElement("script"); ur.type = "text/javascript"; ur.async = true;
     ur.src = "https://XXXXX.l.useitbetter.com/sdk/XXXXX/uResponses.min.js";
     document.getElementsByTagName("head")[0].appendChild(ur);
     var ud = document.createElement("script"); ud.type = "text/javascript"; ud.async = true;
     ud.src = "https://XXXXX.l.useitbetter.com/sdk/23938/udash.min.js";
     document.getElementsByTagName("head")[0].appendChild(ud);
     function initUDash ( i ){
         if (typeof uDash === 'undefined') { if (i < 50) { setTimeout(initUDash,50, i+1);} return; }
        uDash.init({ uProjectName: 'demo_1523',uProjectApiPass: 'd343f086a9765ac18d4725e974ca62a1',uPort: 23938 });
     }
     initUDash (0) ;
 })();
</script>

Serving The Scripts from Your Own Server

For performance or security reasons, you may want to load the scripts from your own servers. In such case, please contact your account manager.