Contents

Google Analytics

Google Analytics allow you to track users and monitor activity on your site.

 


 

Using Google Analytics tracking code

Google Analytics can be used with the Payment Pages by using custom JavaScript code. Follow the example below to use this feature.

Upload a file using the MyST File Manager called default.js containing the following code:


// Adding Google Analytics to Secure Trading Payment Pages.
var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-X']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

 

Replace the text “UA-XXXXX-X” to be your Google Analytics web property ID.

 

Info
For merchants customising their Payment Pages using custom stprofiles, upload this JavaScript file separately for each profile, with the filename [stprofile].js

 

Google Analytics will set cookies on the customer’s browser. Click here further information on Google Analytics.