How to use Google Analytics with HTTPS

October 1st, 2007 by Mike Shannon

After you’ve spent the last 30 minutes shopping online for that new movie DVD or gift idea for ma’s birthday and you’ve got your credit card ready in hand, you end up at a payment/checkout page that says “warning: this page contains secure and non-secure items. Select yes to continue”. Still feel like giving out your credit card info? Yea, me neither. This is usually the case when an HTTPS web page references items from the HTTP protocol - or more specifically - when the web master has placed the standard Google Analytics code onto the HTTPS page.

Google has analytics tracking code specifically for HTTPS pages, and to my surprise, the same HTTPS code will work when placed on non secure pages:

You can add this secure code to both secure and non-secure pages of your site

Straight from their website. Pretty nifty, so why even bother with the non secure (HTTP) analytics tracking code? I asked a Google representative that very same question and they said it was from a time before HTTPS tracking was in demand and a new version of the tracking was in development… ok, so we’ll have to change it again some day? Happy tracking until then!

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Netscape

One Response to “How to use Google Analytics with HTTPS”

  1. Google using New Analytics code: One Size Fits All | Best Rank Blog Says:

    […] thought it was interesting that I mentioned the potential fix some months back on my post of how to use https with analytics… I’m sure others were asking and it looks […]

Leave a Reply


Entries (RSS) and Comments (RSS).