Michael O Klett
posted this on May 10, 2011 08:41 pm
Some of our users figured out how to use our Hosted Product Signup pages with Google Analytics.
I've attempted to integrate our hosted payment page with our Google Analytics account by specifying the following (actual token obscured) in the "Custom Javascript Field" of our "Hosted Page Settings":
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"));
try{
var pageTracker = gat.getTracker("UA-xxxxxxxx-1");
pageTracker._trackPageview();
} catch(err) {}
Unfortunately we're not registering any hits on the hosted payment page, even though I know we've hit it ourselves, for testing purposes. Is the above configuration correct?
For the old analytics code (which you're using) you need to include the following lines to your code:
pageTracker.setDomainName("none");
pageTracker.setAllowLinker(true);
If you're using the newer script it'd be this:
gaq.push(['setAllowLinker', true]); gaq.push(['setDomainName', 'none']);
The pages will look they're from YOUR domain unless you set up filters to show it as a different site. I guess that is personal prefernce.
If you're setting up funnels, you'll need to do some linking between your sites...see here -->
http://www.google.com/support/analytics/bin/answer.py?hl=en&ans...
I haven't completely set mine up yet, but I have successfully gotten a couple of pageviews with the above method.
Comments
Anyone tried using Clicky? I've included the async version of the code, which apparently is supposed to automatically toggle between http and https pages, but I am also not getting any visits to register.