title: How to include Javascript on every Salesforce Page(for tracking/analytics) Home page component vs. Custom Button vs. Controller vs
body: <p>To run analytics javascript on every salesforce page I want to insert Javascript in every page.</p>
  
  <p>So far I read about a couple of different methods:</p>
  
  <h2><a href="http://www.tehnrd.com/show-and-hide-buttons-on-page-layouts/" rel="nofollow">home page component</a></h2>
  
  <ul>
  <li>a HTML Home page component (need to customize UI to show the components on every page)</li>
  <li>limitations: does not work for Chatter, Reports and Setup</li>
  <li>possible issue: <a href="http://www.tehnrd.com/show-and-hide-buttons-on-page-layouts/comment-page-1/#comment-66702" rel="nofollow">these comments</a> indicate problems with 'winter 13'</li>
  </ul>
  
  <h2><a href="http://www.interactiveties.com/b_execute_javascript_button.php" rel="nofollow">Custom Button with Javascript</a></h2>
  
  <ul>
  <li>(don't know much about this yet) sound like one has to create/assign the buttons to object-types)</li>
  </ul>
  
  <h2>Custom APEX controller?</h2>
  
  <p>How would this work?</p>
  
  <h2><a href="http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=pages_js_remoting.htm%7CStartTopic=Content/pages_js_remoting.htm%7CSkinName=webhelp" rel="nofollow">Visualforce page</a> ??</h2>
  
  <p>How would this work?
  To my understanding it would be possible to replace everything with visualforce pages, but this is obviously not very elegant/maintainable.</p>
  
  <p>I'm curious to see what other methods there are, in partciular by modifying the controller?
  What other things to consider (downsides, risks) with the presented methods?</p>