Best way to add google analytics code in a wordpress site.

Joined
Mar 20, 2013
Messages
12
Reaction score
0
I have been trying my level best to add analytics code and i was able to succeed after i used a plugin (All In One Webmaster) and i was able to check the details on real time basis.. it shows the no of visitors on the site but it doesn't reflect total number of visits under audience...
can anyone out there help me... its important i have to do this by today EOD...
 
try to add the code after the end of </head> and the start of <body> tag in the header.php or u can fins that in index.php


example

</head>
;
;code here
;
<body>
 
You need to add analytics code just after header tag on your site.
If you added your analytics now, then it will take some time to calculate total audience count. Atleast you should wait for 24hrs.
 
I use the Google Analyticator plugin. Works for me.
 
Agreed, there are a lot of good Wordpress plugins out there. Analyicator is good. That is the one is use.
 
i used the Plugin day before yesterday... for yesterday it shows the data i dont know what happened today since morning its not pulling data for the site...
 
Hearing this for the first time. You can better delete your analytics account and add it again. You can delete it by going to "My Analytics Account" in the drop down menu select "Analytics settings" and click "Edit Account". There you can find an option to deleteyour account.
Hope it helps.
 
well dude i deleted the account...
what should i do next... shall i wait for some time before adding it again... and whats the best way to do it with a plugin or direct paste... Any Recommendation
 
paste your analytic code into your footer.php theme file, place it before the end of body tag </body>
 
Placing the code directly in your theme file would be better, like between <head> and end of </body> tags.
 
Putting it directly in the theme saves you one MySQL query per page load so just open theme editor in wordpress and look for footer.php file in the theme you are using and put analytics code right above </body> tag.
 
if you are using Windows, use Notepad and open this file wp-content/themes/your-theme-name/footer.php and place your GA code inbetween below two tags

</body>
YOUR CODE HERE
</html>
 
I put mine in header.php and it works like a charm :) i used a plugin but had no success
 
putting in header will be a good option that will allow you to track all activities & get the results ready in real time.
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock