Google Analytics place code

Hello all!

I have quick question. I want to use the Google Analytics code and it says to place just before the </body> tag on the page or pages you want to track. I am guessing but I am also asking since I changed a uni file before and I screwed up a PHP page. When you make a change via DW and upload a coding change to Dolphin it doesn't exactly match with uni files. So I am not going there again. I am using Dolphin 6.1.6.

 

I see 2 files where I can add the Google Analytics code. In templates - index.html file or, not likely, templ - uni, index.html file. I just want to track how many hits my homepage gets with Google's tracking code.

 

I have limited knowledge with PHP & MySQL. On the tap to start learning that later this week.  

 

If you have an answer, please let me know. Thanks!

Quote · 29 Sep 2009

templates/tmpl_uni/page_1.html

But why not put in in templates/tmpl_uni/_header.html  or templates/tmpl_uni/_footer.html  and keep track of every page on your site....

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 29 Sep 2009

Ok, that may make more sense to have the Google tracking code in the header/footer file. But the instructions say to add the code before the </body> tag.

 

Also, since I am gun shy about uploading changes to any uni files via Dreamweaver because I screwed up a page before, can I add the code thru Dolphin's admin panel? Or anywhere else that's safe. I am going to check on that now.

 

Thanks, Houston!

Quote · 29 Sep 2009

Dreamweaver makes things more complex than they need to be.  You really should use an FTP program.  It makes storing a backup copy of a file a lot easier.  The google code will work just fine in any of the files I mentioned..... don't worry about the body tag stuff

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 29 Sep 2009

Drop it at the end of templates/tmpl_{tmpl}/page_1.html

Place it at the very end of the file.

This will work to get tracking of all who land on the home page of your site.  It will not show the exit pages or so on, rather it will show all hits as bounces (meaning they left after viewing one page) and give your site a 100% bounce rate, not a good thing to have.


 

templates/tmpl_{tmpl}/_header.html

Place it at the very end of the file.

This is a great place to drop the code and it will show every single page that even starts to load, again bounce rate will be high for those who kill a page before it finishes loading, but it will be lower than if you place it in page_1.html file.

 


templates/tmpl_{tmpl}/_footer.html

Place it at the very beginning of the file.  This is where you will find the </body> tag your looking for. 

Placing it in this file will display every page that fully displays the body of the page.  If they kill the page while the footer is finishing loading it will still count as a hit since it's in the body & not the footer.  Great way to place the code in the body of every single page with just one edit.  I recommend this way as it will give you the lowest bounce rate and the best overall results. 

Quote · 29 Sep 2009

the google analytics system still says that its not installed.. any suggestions?

Quote · 29 Sep 2009

Google has to re-index your site after you insert the code, which may take a few days.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 29 Sep 2009

I went with mydatery's suggestion to put the code in the footer file, but Google has yet to pick up the data. Been a day, guess it takes a few days for Google to index even though on Google it says it can't find the code. We'll see.

Quote · 3 Oct 2009

You should put in /templates/base/_footer.html

Then open the file with a text editor of some kind, and add your google analytics code before:
</body>
</html>

So it would look something like:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-your-analytics-id";
urchinTracker();
</script>
</body>
</html>


If you put it in some other location then it won't cover all pages of your site only the page that it is on. If you put in the /base/_footer.html it will cover all pages on your site as the _footer.html is called up on all pages some one would navigate to on your site.

After that google analytics updates every 24 hours. So after proper placement and active in your analytics account you should see some data after 24 hours. Providing someone has at least visited a page on your site.

DialMe.com - Your One and Only Source For Boonex Dolphin Tutorials and Resources
Quote · 3 Oct 2009

Put it in the footer before the closing of body tag.

----
Quote · 3 Oct 2009

I will put the Google tracking code in the base file. I haven't received any data from Google trying it in the other file I mentioned. I will let you know if placing the code there works. Yes, I have visitors everyday to my site, just don't know how many. Thanks! 

Quote · 4 Oct 2009

That worked to put the code in the /templates/base/_footer.html file. Dummy me should have checked the page source after I put the code in. That way if I see the js code for the Google tracking,  I know it's ready for Google to anaylze the data. FYI I have ver 6.1.6. Thanks for everyone's help!

Quote · 4 Oct 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.