Ryan Carver - fss

Ryan Carver's blog at fivesevensix.com

URL

XML feedBlogLines Subscription
http://www.fivesevensix.com/

Last update

49 weeks 5 days ago

July 11, 2007

11:30

Say you're creating a purely static website on a regular old php-enabled webhost. Let's say you're doing this with iWeb on Dreamhost for some reason. Don't ask.

Now say you want to track the site with Google Analytics. iWeb has no way to insert raw code, and definitely no way to do it across all pages.

Try this...

.htaccess

# Interpret html as php AddHandler application/x-httpd-php .html # Required so the xml prolog isn't intepreted as php php_flag short_open_tag false # Wrap all requests and add google analytics tracking code php_value auto_prepend_file '_prepend.php' php_value auto_append_file '_append.php'

_prepend.php

_append.php

_google_analytics.txt

Hey, it works.

Categories: Planet Ruby

May 8, 2007

14:12

Today we launched a new version of Google Analytics.

It's been a long and difficult road, but I'm really happy with the result. Hey, I even wrote some Flash again!

Hope you enjoy it.

Categories: Planet Ruby