SSL Certificate Errors with Google Analytics

I recently found that using https://www.google-analytics.com/urchin.js will cause SSL certificate errors when pointing your browser to https://. Here are the correct URLs to use for Google Analytics:

Http:
http://www.google-analytics.com/urchin.js

Https:
https://ssl.google-analytics.com/urchin.js

<?php
  $prefix = isset($_SERVER['HTTPS']) ? "https://ssl" : "http://www";
?>
  <script src="<?php echo $prefix; ?>.google-analytics.com/urchin.js" type="text/javascript">
  </script>
  <script type="text/javascript">
    _uacct="UA-xxxxxxx-x";
    urchinTracker();
  </script>
<?php } ?>

| Tags:

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options