I am a big fan of ClientExec as it is easy to install and very easy to use. Over the years it has always been easy to upgrade and the support is prompt. If you want to add Google Analytics to your ClientExec installation you simply need to add it in two locations if you are using the default template and if you are using a custom ClientExec template then you need to add it in one more location.
The Google Analytics tracking JavaScript can be added anywhere but a good place to place the code is right above the closing HTML HEAD tag. Below there is an example of the Google Analytics tracking code followed by the files where it needs to be added to have ClientExec hits start displaying on the Google Analytics website (you must already have signed up for a Google Analytics account).
Example Google Analytics Tracking Code:
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-XXXXXXX-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);
- })();
- </script>
The only bit that would change in the above example output is the UA-XXXXXX-X code part. Once you have the correct JavaScript to put in place simply add it right before the </head> tag in the below two files.
ClientExec Files To Add Google Analytics JavaScript Code:
- clientexec-root/templates/admin/index.tpl.php
- clientexec-root/templates/default/index.tpl.php
- clientexec-root/templates/TEMPLATE-NAME/index.tpl.php
That is it. You should be able to verify fairly quickly by visiting the site to see if the hits are displaying in Google Analytics.