Home | Features | Demo | Downloads | About Us | Support | Purchase

Using Google Analytics

Google Analytics is a very popular service many merchants use to do tracking on their sites. Typically this involves inserting a small amount of javascript into your site. This is very easily accomplished with CFWebstore by pasting the code into your layout page (such as layouts/lay_default.cfm).

What you may find though is that you get an error during checkout due to the code not using an https: link. Switching the code to use strictly the https link will often work, but here is a more elegant solution. Use this javascript instead to switch between the http: and https: links (modify the link as needed for whatever analytic service you are using):

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/urchin.js' type='text/javascript'%3E%3C/script%3E"));
</script>

Now your site won't throw any errors!

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Greg Bray's Gravatar Are there any plans to integrate the more advance Google Analytics ecommerce
tracking code into CFWebstore? This would be really useful.

-greg
# Posted By Greg Bray | 12/23/09 10:12 AM
Mary Jo's Gravatar Not at this time. They appear to be pretty limited in terms of what ecommerce functions they support.
# Posted By Mary Jo | 12/24/09 3:31 PM
 
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.