index.php - in my theme i tried to add google analytics code. google is asking me to copy the code before </body> tag in the index file but i dont have any HTML tag in my index.php file. what to do? where should i add the code? is it good to add analytics or just leave without that?
Are you using WordPress by any chance. If you are just go the your theme folder and add the code to the file called footer.php
Ya, you have to add the code to footer because in the structure you might be having header.php where <body> tag starts, index.php where there is the code for your content page and footer.php where there is </body> i.e. end of body tag. Just put it in footer. In fact you can put the analytics code anywhere in your code, right in index.php. But Google asks it to put before end of body tag because, then the analytics will count the pageview only when the complete page is loaded Some people put the analytics code in header, so that though someone opens and closes the page, still it is counted by analytics
im having trouble setting up for my DP account, how do i set it up, ive followed the process by clicking analytics at the top of my page but the actual tracking system says its not installed, where would i place the tracking code so i can see visits for my profile page??
no, isnt the analytics thing at the top next to the private messages meant for you can see how many visitors you get on your profile page for DP
HI, You may have the separate header and footer file so add this google script in footer file. - Vipin
What CMS are you using ? Usually, I add Google Analytics code in header.tpl file, this is php template . You can try it out. Path: yoursite.com/smarty/templates
I am having some of the same issues. In fact, my blog is hosted on Blogger (or blogspot). I installed the google code on my blog and when I click confirm, it says it is installed and is able to retrieve the analytics. However, I am getting zero traffic--and I don't think this is possible. I have had traffic before and now I have many links on Twitter and many posts on my blog. I also ping my blog after I make a post...so this is NO way I should be getting zero traffic. Help please?
Yeah it's a real simple setup. Just copy the code from when you signed up for Analytics and put it immediately before the </body> tag. Your site may be split up into different PHP files depending on the Content Management System (CMS) you're using, in which case it may take a little searching to find that tag but it's the same deal. Just put the code before the </body> tag and you're golden.
I went ahead and added the code to before the body in the template. But, even before I did that, next to "tracking status", it said it was "receiving data". Is there anything else that could be screwing up? I'll let you know in a day or 2 if my stats change at all.
If you are using WP, add it in the index.php or footer.php in your theme folder. If you are using Blogger, add it in your edit HTML section.