Enable SSL for Google Analytics

Unsecure Google Analytics Warning

If you use the unsecure Google Analytics code on one of your secure web pages your web browser will warn that there is some page content that is not secure. This problem can be easily solved by slightly changing the code used to load Google Analytics.

Instead of:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>

Use:

<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"> 
</script>

If you still get the "page contains secure and nonsecure items" after changing that code you should check for other page elements that are using http instead of https.

Google's information about using SSL with Google Analytics is also available.

Update: Google has now updated the Google Analytics code to use ga.js instead of the urchin.js file. In the process, they have implemented code that will automatically detect whether http or https needs to be used. The new code will also enable new features so it is recommended that you upgrade. This will solve the SSL problem so you won't need to worry about the solution above. The upgrade instructions can be found here.

 Digg  del.icio.us  Reddit

Posted on October 08, 2007
computer security
Posts: 1
Comment
checking the code
Reply #1 on : Wed November 14, 2007, 08:46:09
Once the analytics code is on your pages, you can check to make sure tracking is working by going to the Google Analytics Management Screen and looking at the Status of your site profile. If the status is unknown, there will be a link to Check Status. When you click on that link, Google Analytics will test your site to see if the code is present and working. If your status is Waiting for Data, your code is working properly and Google Analytics is gathering information. When your status becomes Recieving Data, Google Analytics has gathered information long enough to start creating reports.

Added by www.securiour.com

Write a comment


If you have trouble reading the code, click on the code itself to generate a new random code.
Security Code:
 
Post Comment