Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a site, www.example.com, that displays some secure content from forms.example.com in iframes. To enable cross-frame navigation, pages on both sites use JavaScript to set the document.domain to just "example.com".

I am using Google Analytics on www.example.com, but the GA site is not showing any data. It indicates that the tracking code is found (the status icon is a green checkmark), but no data is reported.

The GA profile lists the website as "www.example.com".

Is this a supported scenario? Is my script interfering with the GA code in some way?

share|improve this question
    
Has your question not been answered yet? –  Christopher Feb 14 '11 at 19:21
add comment

1 Answer 1

A search of ga.js would suggest that the string "document.domain" (or the minified variant "E.domain") does not, in fact, appear.

It would appear as though Google Analytics uses window.location.hostname (encoded as b.hostname) to get the domain.

share|improve this answer
    
I know that setting the doc domain has security implications for scripts, so I was really wondering if doing so would create an error condition that would prevent the GA script from "phoning home" to the stats server. Thanks for the answer though, it might be helpful. –  Seth Petry-Johnson Nov 7 '10 at 1:51
    
@Seth_Petry-Johnson - You can get all the information Google has by watching the traffic in your browser when the ga.js script phones home and by looking over the ga.js script itself - the Live HTTP Headers and Firebug extensions for FireFox should help with debugging... all that's left is to test :) –  danlefree Nov 7 '10 at 2:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.