Setting up Google Analytics is the most basic step for any marketing plan. If your account is already setup, feel free to mark this task as complete and move on.
If your theme allows it, inside your admin panel you can find Appearance -> Your Theme Options -> SEO or Tracking and directly enter your code there.
If your theme doesn’t allow it or you cannot find it, you will have to edit WordPress files.
From your web files directory, access wp-content\themes\YOURTHEME\header.php and paste your code directly under the body tag .
You can also use the WordPress Google Analytics plugin with default options using your tracking ID (UA-XXXXXXXX-X).
From your Joomla admin section, access Extensions (top menu) -> Template Manager -> Templates (side menu) -> YOUR TEMPLATE -> Edit Main Page Template OR Index.php -> paste your code under the body tag .
You can also use the Joomla Google Analytics plugin with default options using your tracking ID (UA-XXXXXXXX-X).
From your web files directory, access themes\YOURTHEME\templates\page.tpl.php and paste your code directly under the div id=”header” .
You can also use the Drupal Google Analytics plugin with default options using your tracking ID (UA-XXXXXXXX-X).
The tracking code must be found in the body of each page you wish to track.
It can easily be implemented using a PHP page. Simply create “analyticstracking.php” in your web directory and paste your Google Analytics script in it. Include “<?php include_once(“analyticstracking.php”) ?>” in the body of all the pages you wish to keep track of. Pay a special attention to your file path if analyticstracking.php is not in the same directory as your web page.
If you cannot have access to your web files, contact your web administrator so he can add the code for you.