How to know if the Trustev.js is implemented correctly & how to access the TrustevV2.SessionId?

The Trustev.js should be implemented in the head section or at the end of the body section within your page. The Trustev.js involves inserting 4 lines of JavaScript code onto as many pages of your Site as possible - as it will track your customer's behaviour as they move throughout your Site.

The Trustev.js needs to be hosted and launched in order to generate the TrustevV2.SessionId. Therefore, during testing, you cannot use a simple html file, but will need to host it, for example with Xampp or Wamp.

Once set up you can use the following information to see if it's implemented correctly.

Using the developer tools, included in your browser:

  • Hit F12 while using Google Chrome
  • Hit Ctrl+Shift+I while using Mozilla Firefox
  • Hit Command-Option-I while using Safari
  • Hit F12 while using Internet Explorer

Under the Network tab you should see your Public Key value in the URL, along with a 200 Response code:

If this is correct, then you should navigate to the Console window, also in the developer tools, and type in TrustevV2.SessionId, and press enter. This should print out your TrustevV2.SessionId, which is required when adding a Case. See below:

The variable TrustevV2.SessionId is a publicly accessible variable. As the TrustevV2.SessionId variable is generated within the client-side JavaScript code, you will need to pass this variable to your Server side code. This is up to the developer personally, on what method you prefer. Some options include passing it as a hidden field, with the click of a button, or by using cookies.




Have more questions? Submit a request


Powered by Zendesk