Google Analytics Link Reference (html5)

Discussion in 'Web Design and Development' started by miknos, Nov 20, 2010.

  1. miknos Suspended


    Mar 14, 2008
    It is possible to use reference link in Google Analytics?

    Let's say <link rel="javascript" href="analytics.js"> instead of:

    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-912730-5']);

    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

  2. kingthias macrumors member

    Feb 11, 2009
    Yes I did this. It works perfectly fine and I linked it to all of my pages and it identifies them as different pages in analytics still.
  3. miknos thread starter Suspended


    Mar 14, 2008
    Thanks for answering.

    Nice to know code can get even cleaner that way.

Share This Page