Website statistics can be used to help determine how to best develop the website. Â PHP-Nuke includes its own tracking module- you can find more information on this module in
Using the PHP-Nuke Statistics. However, if you want a much better and complete solution, you should incorporate Google Analytics into the PHP-Nuke website. Â This will require that you have an account with Google Analytics, and also do a little editing to the site code. Â The following article reviews how to add Google Analytics to your PHP-Nuke website.
Â
Â
Â
Adding Google Analytics into your PHP-Nuke Website
Â
Create Google Analytics Account and Get Tracking Code
Â
You will first need to create a Google Analytics account, if you intend to use Google Analytics in your website. Â After your account has been created you will be able to obtain the tracking code. Â The code will be needed and should be on all pages that you intend to track. Â Since the HEADER.HTML for PHP-Nuke websites is typically on every page, you can place the Google Analytics code within that file. Â
Â
- Go to Google Analytics and setup your account.
- Google provides the code that you will need for tracking your website data. Save this code for later use (or leave the window with the code open so that you can access it later).
The Tracking Code will look like the following:
<script type=”text/javascript”>
Â
 var _gaq = _gaq || [];
 _gaq.push([‘_setAccount’, ‘UA-12345678-1’]);
 _gaq.push([‘_trackPageview’]);
Â
 (function() {
  var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
  var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
 })();
Â
</script>
Â
Open the Web Site File(s) That require the Code
Â
In order to access your files, we will be
using the Cpanel File Manager. Â You will need to know what theme you are using. Â If you know what theme you are using then skip the first two steps. Â
Â
- Login to the PHP-Nuke Administration Back-end and click on PREFERENCES.
- Scroll to the bottom of the page and go to the Web Site Configuration section. Â Click on the THEMES option menu. Â It will then display the theme being used in the line labeled “Default Theme for your site.”
- Login to your Cpanel as an Administrator
- Go the File manager and navigate to the installation files for PHP-Nuke.
- Look for the THEMES folder. Â Double-click on the theme folder (inside THEMES) that matches the theme that you identified earlier.Â
- Click to highlight the HEADER.HTML file. Â Click on CODE EDITOR (or EDIT) at the top of the File Manager in order to edit the file. Â
Obtain the code that you received from Google and paste it into the editor immediately before the comment that says “close header”. Â This is demonstrated in the screenshot at right.
Â
- Click on SAVE CHANGES in the top right hand corner to save your entries.
Â
This completes the addition of the Google Analytics code to your PHP-Nuke website. Â Check the Google Analytics website for further options to add the tracking code (there are several options) in case your website theme cannot use the above method. Â If you require information on learning how to use Google Analytics, please to go
Learn Google Analytics.