Author Topic: Google Analytics  (Read 3152 times)

Offline hidden

  • Auxilary Member
  • *
  • Posts: 24
Google Analytics
« on: June 09, 2010, 10:16:09 PM »
Google Analytics provides a lot of info on who is visiting your site, how long they stay, etc.

I am trying to decide if I want to wade into it, or if it's just too much trouble, or if it even can be done.

Google Analytics requires putting a snippet of code on each page of your site. The instructions from their web site appear below. My question is, is it at all feasible to put these snippets on CSB-generated pages, and if so, how does one do it (a very brief description only).

Their instructions:

Basic installation - Copy and paste the code segment into the bottom of your content, immediately before the </body> tag of each page you are planning to track. If you use a common include or template, you can enter it there.

      <script type="text/javascript">
      var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
      document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
      </script>

      <script type="text/javascript">
      try{
      var pageTracker = _gat._getTracker("UA-xxxxxx-x");
      pageTracker._trackPageview();
      } catch(err) {}
      </script>

Offline hidden

  • Sami
  • Administrator
  • Senior Member
  • *****
  • Posts: 5924
  • Not a geek. Just a Nerd.
    • CSB Tutorials
Re: Google Analytics
« Reply #1 on: June 10, 2010, 10:04:50 AM »
I posted about website stats (including ga) in the Favorite Web Tools area of the forum:
 http://samisite.com/forum/index.php?topic=679.0
Most of them require you to place a piece of code at the very bottom of the page before /html closing code.

In CSB 5, we have the ability to insert code before the HTML, into the HEAD and after HTML.
And all versions of Trellix/CSB have custom internal fields to hold a repeating expression, sentence that can display throughout the website pages (perfect for copyright notice) . BUT we do not have a way to insert a repeating piece of code at the bottom of each page before the /html code. You must use insert HTML box to hold this on each page.

I have helped others implement Google Analytics.
And I choose to use StatCounter on a site (free level suits fine) for that site.

If your host offers awstats, you may not need the outside stats.
If your host offers less than the awstats package, then I recommend using one of the external analytic sites!
It IS worth it. The info is enlightening.
-Samantha
TNG: "Sometimes, you can make no mistakes, do everything right, and still lose" - Capt Picard to Data
(:turtle: In memory of Turtle: May 22, 1944 - Nov 24, 2007  GURU, mentor, and really nice guy! :turtleleft: )