Adding Google Analytics

  • Author
  • #728627


    Is there a way I can ad the Google Analytics code to my site?

    <script type=”text/javascript”>

    var _gaq = _gaq || [];
    _gaq.push([‘_setAccount’, ‘UA-26308515-1’]);

    (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);


    The blog I need help with is


    No, you cannot use GA here at since first off we cannot access the underlying theme files, and secondly the code that GA uses is not allowed for security reasons (javascript). (2nd paragraph from bottom)



    I was at a blogging conference just yesterday Oct. 13 where the bloggers said they used google analytics on a blog. They said you add google analytics via the GA site. I specifically asked if they said you could use GA on blogs and they said yes.
    I am so confused, because it looks like that is not true.
    I don’t want to switch from to a site, but I would like to know more about my readers.
    Can you tell me the difference between number of views as seen on the stats provides. and “visitors” or “unique visitors”?
    Maybe if I understood the difference I wouldn’t be so disappointed that GA is not available on my site. Thanks. Lynn from Decor Arts Now



    You can not use Google Analytics with now. They might be telling you about ‘Google Webmaster Tools’. has its own stats. Read more about it:


    Google Analytics can be used on self-hosted wordpress sites using the software from wordpress.ORG and hosted on third-party hosting such as bluehost, dreamhost, etc., but it cannot be used here on the wordpress.COM hosting service.

    The differences between and sites.



    @decorarts – since you are on WordPress.COM you can get a lot of info from Quantcast about your traffic.



    This question is answered in the support documentation for stats. Scroll down to the second last entry on this page to confirm. It has also been asked and answered many times on the support forums.



    I hope you didn’t pay a lot for the conference. There are too many “pros” out there who don’t know what they’re talking about.

    On TT’s site you’ll find many stats packages that CAN be used here that will give you more information about your readers. Not as much as GA, but lots.



    Thanks for the quantcast suggestion auxclass. Really handy. Just did it and found out 40% of my traffic is from San Fran, and only 24% from London. (Haven’t lived there for 25 years but I guess although you can take the girl out of the valley but you can’t take the valley-speak out of the girl…;-)

    It’s also very easy to add Google Webmaster tools, as wpguarav suggests. I’ve been meaning to do it for ages, and I just did it just now, in 2 minutes.

    At a basic level Google’s Webmaster tools don’t seem to give you a shedload of stuff over and above what WordPress gives you stat-wise, but one thing that might be valuable to some of us (but not to others!) is to ability to suggest geographic targeting. Although at the end of the day of course Google will do as it sees fit.



    I think I found a way to insert javascript I successful installed google analytics script into my blog page.

    This maybe a security bug. I don’t know who I should report to?


    What page on your site?



    I left it on my blog page, bottom right panel. Even though remove the <script> tag, my google analytics status of that script shows “Analytics has been successfully installed and data is being gathered now.”.

    I thought about it, it could be a google analytics’s bug. It maybe only tracking the account ID in the source code.


    If the javascript is not there, then nothing will be sent back to GA. It has to have the javascript to perform that action when a page is viewed.




    I know I’m joining in late in the game. Its clear that blogs are only limited to what WP already offers in Stats but I wanted to know if I there is simple 3rd party website that I can insert into my site that tracks
    1. Unique visitors and
    2. Their location.
    Its frustrating that WP only provide # of views but that can be the same person viewing different pages thus bringing up the number. Its a false number



    @nguadalupe – Quantcast will give you the number of visitors as well as the page views per person – a bit of geographic data by country – there are other 3rd party sites such as Clustermaps, Flag Counter and Site Meter that will also give location information.



    And Timethief has done posts on several other stats counters. Search on



    Wow…Thanks @auxclass!! I know a stupid question..does that mean with the quantcast there is no uploading, just insert my site address anytime I want to see the stats?

    Thanks @raincoaster! its a great website for resources



    @nguadalupe – Quantcast is built in – just go to the link I gave you and see the stats. No upload, nothing more you need to do other than check the stats.


    Sorry, I’m still a bit confused. Quantcast is generating a tag for me to insert the same way Google Analytics does. Do I have to do it that way and if so, how do I insert the tag? Thanks



    You need to ask Quantcast to add your blog to their stats – since you are hosted on WordPress.COM you don’t need to add anything (you can’t add code) – it can take a week or two for your blog to have stats if things go well – you have a mapped domain so that is why you need to ask for the stats.

The topic ‘Adding Google Analytics’ is closed to new replies.