keat63

Well-Known Member
Nov 20, 2014
1,963
267
113
cPanel Access Level
Root Administrator
I use an OS Commerce web site which has an area inside it's own admin panel to add my analytics code, so no programming skills required.
However, If I look at the final page source, I can see the actual php script.
I'm not sure if this will work, but its worth a try for nothing.

Paste the follwing code in to your PHP file, add your Google ID where it says 'Your Google ID'

Code:
<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', 'Your Google ID', 'auto'); // Replace with your property ID.
ga('send', 'pageview');
</script>
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Hello,


This needs to be set up with google, where they'll provide a code for you to add to your site data Redirecting...

Their prompts are pretty self-explanatory and step by step.