Cross-post from Stackoverflow
Here's the problem I am having:
Currently, we need to track across www.chess.com and secure.chess.com. However, I cannot set the domain to .chess.com because the cookie causes some problems on another domain, live.chess.com.
So, to work around this, in code - I do something like this:
<? if (HTTPS) { ?>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-01']);
_gaq.push(['_setDomainName', 'secure.chess.com']);
_gaq.push(['_trackPageview']);
</script>
<? } else { ?>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-02']);
_gaq.push(['_setDomainName', 'www.chess.com']);
_gaq.push(['_trackPageview']);
</script>
<? } ?>
However, this forces us to maintain 2 analytics accounts (UA-XXXXX-01 and UA-XXXXX-02) and creates a separation between HTTPS and HTTP traffic.
How can I set this up so that ONE analytics account will track both secure.chess.com and www.chess.com without setting a top level cookie (.chess.com)?