Since I was embedding the Astronomy Calculator calculations (ASP.NET running on Windows) inside a Clear Sky Tonight web page (HTML on Linux), I wanted a way to track the number of people who ran the calculations.  My long term goal is to convert the ASP.NET to a web service but in the short term, I figured I would just add Google Analytics now.  So, I added the necessary code and waited a day to check my Google Analytics account.  There was no results.  I then remembered the new real-time feature and set up a test.  If I went directly to the ASPX page, a visitor was recorded.  However, nothing was recorded with iframe.

I started doing some research and Google Analytics mentioned that you have to modify the code for cross tracking multiple domains.    However, I noticed that a visitor was recorded when using my iPhone.  More research lead me to a figure out it was an Internet Explorer only issue related to P3P.  I found P3P was a W3C privacy initiative.  So, I started researching this and trying to add the necessary code but I still couldn’t get Google Analytics to work.  I also found out that most web browsers don’t even look for P3P, except for IE.  So, I embarked on a challenge to figure it out.

Cutting to the end, the solution was in two forum posting:  http://stackoverflow.com/questions/3547449/iframes-google-analytics-cookies-p3p-rocket-science-mess-i-cant-figure and http://productforums.google.com/forum/#!topic/analytics/x9wSHHAsVGE.  The solution was to add a custom HTTP header to my Windows hosting account.


Below are the articles I used in my research:

http://stackoverflow.com/questions/1423128/google-analytics-iframe
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite
http://productforums.google.com/forum/#!topic/analytics/LEie8Lx69oI
http://stackoverflow.com/questions/8896572/iframe-subdomain-tracking-with-google-analytics
http://stackoverflow.com/questions/9566496/tracking-displays-of-iframe-component-in-google-analytics

http://www.w3.org/P3P/usep3p.html
http://www.p3ptoolbox.org/tools/resources1.shtml
http://webdesign.about.com/od/p3p/a/aa040802a.htm
http://www.iubenda.com/en
http://www.w3.org/P3P/validator.html
http://www.codeproject.com/Articles/43053/Make-Standard-use-of-Cookie-with-Cookie-Compact-Pr
http://www.webentrust.com/p3ptools/editor/templates.html
http://msdn.microsoft.com/en-us/library/ms537341(v=vs.85).aspx
http://shrimpwagon.wordpress.com/2008/09/23/compact-privacy-policy-p3p-in-two-easy-steps/
http://www.nmda.or.jp/enc/privacy/eindex.html