Google analytics tool for multiple domains in wordpress

Discussion in 'Google Analytics' started by talentscouter, Feb 23, 2011.

  1. #1
    Hey guys. I want to use google analytics on multiple blogs that i have set up in my Wordpress 3.0 installation. I'd like to hear your recommendations for the best plugin to handle this across my 50 or so sites. My goal is ease of use and administration.
     
    talentscouter, Feb 23, 2011 IP
  2. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Here's a sample code that you can track multiple domains with 1 analytics account.

    
    <script type="text/javascript">
        var _gaq = _gaq || [];
        
        _gaq.push(['_setAccount', 'UA-xxxxxxxx-1']);
        _gaq.push(['_setDomainName', 'none']);
        _gaq.push(['_setAllowLinker', true]);
        _gaq.push(['_trackPageview']);
        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
        })();
    </script>
    
    Code (markup):
    Note that the "setDomainName" is set to none. So you can track different domains under 1 account.
     
    imperialDirectory, Feb 25, 2011 IP