Google Analytics and SSL
Posted by: Joey Marchy on Monday July 30, 2007
Here’s a Google Analytics tip that might save you a few headaches. If you use SSL anywhere on your site, even on a single page, you must use the secure Google Analytics tracking code. I discovered this when, simultaneously, our SSL certificate broke and Analytics stopped tracking certain pages. For a comparison, the only thing that differs between the two tracking codes is the url of the Analytics tracking script. See below:
Secure tracking url
https://ssl.google-analytics.com/urchin.js
Regular tracking url
http://www.google-analytics.com/urchin.js
It’s easy to select the secure tracking code during the site profile set up. Here are instructions on getting the secure page tracking code. Two interesting things to note:
- You must follow the instructions above. You can’t just add the secure code to an existing site. It won’t work.
- Google will serve you the correct tracking code during the Analytics profile setup if you use the “https://” protocol.
If your pages are set up properly Analytics can provide you with powerful ecommerce reporting. You can even use Analytics to track 3rd-party shopping carts and return buyers.
Filed under: Code, Resources

No comments