Website Optimizer Cross Subdomain Tracking

Discuss, and evaluate the latest news and innovations in Website Analytics

Moderator: Moderators

Website Optimizer Cross Subdomain Tracking

Postby jondyer » Wed Sep 16, 2009 10:34 am

Just wanted to post info on the steps necessary to setup cross subdomain tracking in a Google Website Optimizer experiment. Please note there is another solution required when crossing full domains

e.g. For an experiment where the test page is at http://www.techwyse.com and conversion page is at risetothetop.techwyse.com

Experiments will not work unless the following is carried out.

Step 1 - Add the following above the control script


Code: Select all
<!-- Google Website Optimizer Control Domain Cross START -->
<script>
_udn = ".techwyse.com";
_uhash = "off";
</script>
<!-- Google Website Optimizer Control Domain Cross END-->


Step 2 - Modify the Tracking Code with the Following Lines

Code: Select all
<!-- Google Website Optimizer Tracking Script -->
<script type="text/javascript">
if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
(document.location.protocol=='https:'?'s://ssl':'://www')+
'.google-analytics.com/ga.js"></sc'+'ript>')</script>
<script type="text/javascript">
try {
var gwoTracker=_gat._getTracker("UA-xxxxxxx-3");

ADD THESE TWO LINES
gwoTracker._setDomainName(".techwyse.com");
gwoTracker._setAllowHash(false);
END OF ADDITIONAL LINES

gwoTracker._trackPageview("/xxxxxxxxxx/test");
}catch(err){}</script>
<!-- End of Google Website Optimizer Tracking Script -->


Step 3 - Modify the Conversion Code with the Following Lines

Code: Select all
<!-- Google Website Optimizer Conversion Script Page-->
<script type="text/javascript">
if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
(document.location.protocol=='https:'?'s://ssl':'://www')+
'.google-analytics.com/ga.js"></sc'+'ript>')</script>
<script type="text/javascript">
try {
var gwoTracker=_gat._getTracker("UA-xxxxxxx-3");

ADD THESE TWO LINES
gwoTracker._setDomainName(".techwyse.com");
gwoTracker._setAllowHash(false);
END OF ADDITIONAL LINES

gwoTracker._trackPageview("/xxxxxxxxxx/goal");
}catch(err){}</script>
<!-- End of Google Website Optimizer Conversion Script -->


FYI
setdomainname - tells optimizer to use this field for the tracking cookie
setallow hash(false) - tells optimizer to use a 1 in the domain hash field rather than a hash of the URL domain.

Google Website Optimizer experiments, like Google Analytics can require a great deal of customization so beware before just implementing the code and walking away.

Cheers,
Jon
jondyer
 
Posts: 184
Joined: Mon Feb 02, 2009 11:16 am

Return to Web Analytics

Who is online

Users browsing this forum: No registered users and 3 guests

cron