[SalesForce] Javascript redirect with Google Analytics cross-domain link

I have a visualforce site, running the Google Analytics asynchronous tracker. So that a customer can log in, we have a redirect from the unsecure, branded site (www.something.com) to the company.secure.force.com domain.

Works fine, but breaks our Analytics source tracking (cookie set by custom domain can't be read by the cookie on secure.force.com). So we use the GA cross-domain tracking method _link('url').

Works for Chrome, but not for IE. In this, a controller is supplying the value of {https} based on a custom setting.

<script>
      var registerRedir = '{!https}';         
      _gaq.push(['_link', '{!https}']);              
      window.location.href = registerRedir;        

Best Answer

Just glancing here: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite

I think the cross-domain tracking is breaking because your actually not directing them to another top-level domain (secure.force.com is a sub-domain of force.com), and it seems they intended this for use in tracking sub-domains within the same space as a top-level domain, or two-top level domains. Not a top-level and the sub-level of another?

Related Topic