Lets say you want to create a subdomain, and then route it to a completely different webpage after a predefined length of time, but you want it to execute the Google Analytic code to be able to then track the transaction. How do you do that?
One way to do that would be to use the META tags to refresh the page. A simple example is:
<html> <head><META HTTP-EQUIV=Refresh CONTENT="0; URL=http://newwebsiteurl/"></head> <title></title> <body> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E% 3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("XX-XXXXXX-XX"); pageTracker._trackPageview(); } catch(err) {}</script> </body> </html>
The variables in the above, you can change is