Problems calling Analytics through external Javascript File

Discussion in 'Google Analytics' started by solarpanelsdirect, Nov 24, 2009.

  1. #1
    I am trying to reduce page code by have ga.js in an external file and calling it.

    Problem is, it's not working.

    Is there any special tricks to getting Analytics working in an external Javascript file?

    
    <script src="ga.js"></script>
    </body>
    
    Code (markup):
    Then the external file is all the Javascript, with the <script></script> tags stripped of course.
     
    solarpanelsdirect, Nov 24, 2009 IP
  2. dipali

    dipali Peon

    Messages:
    450
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i dont think so its possible to call external java script for Google analytics tracking. its possible in case if you are using wordpress as cms on your website. bz there are some plug ins avail for GA tracking.

    for reducing code size of website, now you can use asynchronous tracking for speeding up your website. how to use it ? see below link this will help you.

    http://analytics.blogspot.com/2009/12/google-analytics-launches-asynchronous.html
     
    dipali, Dec 4, 2009 IP