Google Analytics

August 15, 2009 by nuno costa no comments

Ext.fc.Analytics

Power up your google analytics

 

About

Have your google analytics code added with one line of code, and track file downloads, mailto links and external links

 

Features added to normal Google Analytics

  • Track downloads
  • Track mailto links
  • Track external links

 

Code

With default options

<script type="text/javascript">
        new Ext.fc.analytics().init("Your Google Analytics publisher id");
    </script>

With custom options

 <script type="text/javascript">
        new Ext.fc.analytics().init("Your Google Analytics publisher id", {
            trackLinks       : true
 
            //list of file extensions to track
            ,linksList       : "doc|eps|jpg|png|svg|xls|ppt|pdf|xls|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3"
 
            //make shure links start and end with a forward slash / 
            ,externalLinkUrl : "/external/"
            ,downloadLinkUrl : "/download/"
            ,mailtoLinkUrl   : "/mailto/"
        });
    </script>

 

Download

download-now  

 

How to see your links in google analytics

With the default options your links will appear in analytics like this :

  • external links:
    /external/[url] ex: /external/www.extjs.com
  • mailto links:
    /mailto/[email] ex: /email/foo@bar.com
  • download links:
    /download/[path] ex: /download/link/path/file.zip

More from francodacosta.com

© francodacosta.com - All rights reserved