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.
 
NOTE: Before making the following changes, be sure that you make a complete backup of your website. If you require information and you used Softaculous to load your site, see the following article: Backing Up and Restoring Your Website using Softaculous.  You can also make a backup using FTP - see How to Create a Backup Using FTP.
 
 

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.  
 
  1. Go to Google Analytics and setup your account.
  2. 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;
    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>
 

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.  
 
  1. Login to the PHP-Nuke Administration Back-end and click on PREFERENCES.
  2. 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."
  3. Login to your Cpanel as an Administrator
  4. Go the File manager and navigate to the installation files for PHP-Nuke.
  5. Look for the THEMES folder.  Double-click on the theme folder (inside THEMES) that matches the theme that you identified earlier. 
  6. 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.  
  7. Highlighted code indicates Google Analytics codeObtain 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.
     
  8. 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.
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!