Educational ICT Virtualisation Specialist

Twitter LinkedIn E-mail
Precedence Technologies Ltd
Technology House, 36a Union Lane
Cambridge, CB4 1QB, United Kingdom
T: +44 (0)8456 446 800 / +44 (0)1223 359900
F: +44 (0)8456 446 899 / +44 (0)1223 359459
E: enquiries@precedence.co.uk
CustomCode

Jump To: Support > KB > SurfYourOwn > CustomCode

Adding custom code, e.g. Google Analytics

Google Analytics requires you to add code like the following on each page:
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-12345678-1', 'auto');
  ga('send', 'pageview');

</script>

With SurfYourOwn, this is easily done. Look in cms/templates for your HTML templates. There will be a .html file for each template on your site (many sites will use only one template). Edit each .html file and add your custom code at the bottom.

From the admin pages, clear your site cache and each page will be automatically regenerated.

© Copyright Precedence Technologies 1999-2017
Page last modified on November 03, 2014, at 03:49 PM by sborrill