How to use Google Analytics tracking code in WordPress?
First you need to Create Google Analytics account.
You’ll need to create a new profile in your Google Analytics account, then you can use free Google Analytics tool.
You can also login with your gmail account (if you already have one) into Google Analytics Official Website and get your website’s tracking ID and embed the code into your website’s header.
To do so login Google Analytics account, in the Admin page click on Create/Edit/Delete Profile
To create a profile:
Click + New Profile.
Enter the general information (Name, country/territory, time zone).
Click Create Profile.
Select that new profile from the Profile Settings menu and copy the Profile I.D
All WordPress themes has header.php page. You can put the into your header and Google can track your website visitors.
var _gaq = _gaq || ;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’); s.parentNode.insertBefore(ga, s);
< /script >
Once you find the code snippet, copy and paste it into your web page, just before the closing < /head> tag.
Adding Google Analytic tracking code manually:
- Login to your WordPress website admin panel
- Goto Appearance > Editor (theme editor)
- Select the header.php or index.php
- Find the html tag ; < head> < /head>
- Copy and page the Google Analytics code after the < head> tag, before the < /head> tag.
- Then click Update File to save changes.
Whatever WordPress theme you use, there is always a header.php page.
You can find header.php page under theme folder.
There you could include the Analytics tracking code in the header.php file like this:
< !DOCTYPE html >
< !– This is the header file for the site — >
< html >
< head >
< meta http-equiv=”content-type” content=”text/html; charset=utf-8″ >
Click the image to see how to add the code below:
If this is too complicated for you, then might use a plugin to do the job, such as;
google-analyticator WordPress plugin
When you use Google Analytics you will be able to track all your site visitors moves. You can see at Google Analytics website dashboard:
Which site they came from to arrive at your site
Which country and state they come from
Which browser they use to view your site
Where they went when they left your site
Which links they clicked on your site
How long they stayed on your site
Which pages they viewed on your site
What keywords they used to find your content
What time they viewed your site
Google Web Analytics & Reporting
Analytics lets you measure your advertising ROI as well as track your Flash, video, and social networking sites and applications.
google.com/analytics/ Google Analytics Official Website