One problem that you're likely to encounter if you use SSL on the server is that you will get a security error when your browser changes from http to https. To get around this, you use
https://ssl.google-analytics.com/urchin.js instead of the normal Google address when in SSL mode. To enable OSC to switch between the two, you delete the urchin call from the example above and insert this snippet immediately before the last ?>
PHP Code:
if ($request_type == 'SSL') {
echo '<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>';
} else {
echo '<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>';
}
I used the OSC variable $request_type in that example, if you want to do the same thing on another system, then use this more generic if statement in place of the one used above.
PHP Code:
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') {