Wednesday, February 25, 2009

Privacy Policy for Blogger

There are probably a many gadgets that could be used to add a Privacy Policy for Blogger (or any other piece of text that applies to the whole site.

Here's one:
Check out the Privacy Policy link at the foot of the page - Click it.

And that's it. - It even adds a _trackPageView for the Privacy Policy so you can tell how many have checked it out to if it works.

Here's the code below - Add it as an HTML/Javascript widget where you want it on the page.

What do you think?

<!-- START: Analytix Specifix Privacy Policy Div Quick and Dirty Gadget-->

<a id="a_priv" href="" onclick="javascript:document.getElementById('div_priv').style.display='block'; document.getElementById('a_priv').style.display='none'; pageTracker._trackPageview('/Blogger GA Privacy Policy/');return false;"><u>Privacy Policy</u></a>

<div id="div_priv" style="display: none; text-transform: none; text-align: justify;">
Privacy Policy

We comply with Google Analytics Terms of Service, clause 7 of which reads:
7. PRIVACY . You will not (and will not allow any third party to) use the Service to track or collect personally identifiable information of Internet users, nor will You (or will You allow any third party to) associate any data gathered from Your website(s) (or such third parties' website(s)) with any personally identifying information from any source as part of Your use (or such third parties' use) of the Service. You will have and abide by an appropriate privacy policy and will comply with all applicable laws relating to the collection of information from visitors to Your websites. You must post a privacy policy and that policy must provide notice of your use of a cookie that collects anonymous traffic data.

<a id="a_hidepriv" href="" onclick="javascript:document.getElementById('div_priv').style.display='none'; document.getElementById('a_priv').style.display='block'; ;return false;">
<u>Hide Privacy Policy</u></a>

<!-- END: Analytix Specifix Privacy Policy Quick and Dirty -->

Monday, December 8, 2008

Simple Machines Forum Software and Google Analytics

Simple Machines provides free Forum software that works, is flexible, easy to install and use.

Applying design themes is one of its most powerful features because it uses templates processed by PHP.

But therein lies the stumbling block that trips up forum owners wanting to install Google Analytics code.

The approach followed here is the least invasive, most flexible and allows for more advanced functionality, if and as required.

3 steps:

Step 1: Create an include file for your Google Code.

Paste the following code in an empty text file and save it in /smf/Sources as /smf/Sources/ga_script.html
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "' type='text/javascript'%3E%3C/script%3E"));
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-#######-#");
} catch(err) {}</script>

Replace UA-#######-# with your Web Property ID from your web analytics account.

Step 2: Find the correct index.template.php

Find your theme directory. Typically it will be the theme folder beneath /smf/Themes.

Open the file /smf/Themes/<your theme>/index.template.php

In my case, I've been totally original in going with the "classic" theme so I'm using

Step 3: Insert on line of code before the closing </body> tag
Open index.template.php in a text editor.

Search for </body>
You will find the following lines of code:

echo '

Before the echo statement insert the following comment and one line of code:
// Add in google analytics
require_once 'ga_script.html';

Save the file and you're done.

  • Go to your forum.
  • Delete your cookies for your forum's domain.
  • Refresh the page.

View your cookies. You should have, amongst others, the following 4:
  • __utma,
  • __utmb,
  • __utmc and
  • __utmz
For more on GA's cookies, see:
Cookies Set By Google Analytics
or, for the real geeks:
Slicing and Dicing Google Cookies - Part 1

After 2 hours, log into your Google Analytics account and check your reports - you should be seeing some data.

No doubt you have questions - I'll probably have answers or know someone who has.
No doubt you want more - ask and you may very well receive.

Questions us forum owners should be asking include:
  • Why do I have a forum and what stats will tell me if its meeting those objectives?
  • What do I want visitors to do on my forum and how do I know if and how much they are doing of it?
  • What do I want more of on my forum? What stats will point me to getting more of that?