Let me tell you how I can do so many sites so quickly ;-)
1. On every page on the site, I have added extra code at the top:
if ($_COOKIE["__utma"] or preg_match('/bot|crawl|spider/',$_SERVER[HTTP_USER_AGENT])) {
$fill[cookalert] = "";
} else {
$fill[cookalert] = "<tr><td class='pageName'> • This site uses cookies - ".
"see <a href=http://www.wellho.net/web2/cookies.php?which=chamber target=xss>".
"[here]<a> for details.<br> • If you proceed, we will take that as ".
"your consent to accept cookies<hr><td><tr>";
}
In other words, if there isn't a Google Analytics cookie present, and the browser is not an automata, we need to ask the user. We do not want to ask spiders and crawlers, as we don't want to damage our search engine placement by adding in cookie text.
3. Providing the information in the extra page at http://www.wellho.net/web2/cookies.php?which=chamber (this is the longest bit)
Since our site's well designed and uses common header scripts and templates, I haven't really had to change every page - just a single teplate and header file on each site. But if you've got a site that's not well structured, there could be an awful lot of work involved.
Here's the different home page on our training site displayed to a brand new visitor and a vistor who already has cookies set:
Here's the different home page on our hotel site displayed to a brand new visitor and a vistor who already has cookies set:
Here's the different home page on the Chamber of Commerce site displayed to a brand new visitor and a vistor who already has cookies set: