The MU forums have moved to WordPress.org

Google Analytics (56 posts)

  1. demonicume
    Member
    Posted 17 years ago #

    there are two plugins that i've found in my searchings. here's the one i know works. drop it in mu-plugins and make sure the themes you want to track have wp_footer in them. if some of your themes dont have a footer - some of mine dont -jst as the wp_footer into the header. this may cause a slow down and/or cause things that rely on the footer call to appear in weird places.

  2. cq
    Member
    Posted 17 years ago #

    if you are using virtual subs, does the _udn identifier work with analytics? I've tried and it only reports the permalinks at root level. so it seems like it's not picking up the subs.

  3. ladynada
    Member
    Posted 17 years ago #

    amanzi,
    your plugin code works for me for pmetrics

    thank you,
    nada

  4. BradWaite
    Member
    Posted 17 years ago #

    cq,

    I'm seeing the same thing. Here's what Analytics Help has to say:

    If you'd like to distinguish between your subdomains, you can create an Advanced filter for your profile with the following settings:

    Filter Type: Custom filter > Advanced
    Field A: Hostname
    Extract A: (.*)
    Field B: Request URI
    Extract B: (.*)
    Output To: Request URI
    Constructor: /$A1$B1

    I'll try it and report back.

  5. dgilmour
    Member
    Posted 17 years ago #

    Just tried Amanzi's Google Analytics Insert Plugin V 0.1 (see above) in mu-plugins with WPMU 1.2.5a. Had to back it out, though, as it broke the visual editor. Two tabs, Visual and Code were still there, editor window displayed code view, visual tab did nothing and neither visual nor code toolbars were displayed. :(

  6. demonicume
    Member
    Posted 17 years ago #

    that's odd that it broke the visual editor, all it does is hook into the footer.

  7. amanzi
    Member
    Posted 17 years ago #

    Hi - as the original poster of the code, I thought I'd just add a couple of comments.

    I'm still using this plugin on my site, running the latest MU and it's working fine for me.

    It's an extremely simple plugin that just adds the Analytics code in each theme as long as the theme calls the wp_footer() code. I can't see how this would have any effect on the admin pages.

    With the _udn section, it allows me to track visitors to each of the subdomains (blogs) on my site.

    This plugin doesn't allow blog owners to track their Google Analytics, this is purely for me (site owner) to track usage on the site. You can view hostnames by drilling down the Analytics menus: "Visitors --> Network Propeties --> Hostnames"

    Hope that helps...

    Stuart.

  8. dgilmour
    Member
    Posted 17 years ago #

    Thanks demonicume, amanzi. I'd emailed Stuart and he put his finger on it straightaway: I'd left a blank line at the end. Now deleted and it's working fine. Sorry for wasting your time.

  9. amanzi
    Member
    Posted 17 years ago #

    @dgilmour - it's a common mistake to make. And that's for all plugins too, any blank lines at the end breaks things.
    :)

  10. nando99
    Member
    Posted 17 years ago #

    I think this would work for what I need...

    Is there a way to add text/links to all themes then? If so, how would I go about doing that?

    Thanks in advance...

  11. hhuskies
    Member
    Posted 17 years ago #

    Thank you amanzi! It worked perfectly on my blogs.

  12. suleiman
    Member
    Posted 17 years ago #

    what if your users want to track their analytics though? Don't you think with the lack of a pretty graphic bars and pie charts utilizing stats plugin ala wordpress.com we should be providing our users with some analytics love?

  13. au8ust
    Member
    Posted 17 years ago #

    Amanzi's plugin is working, but it brokes the visual editor :(

    Any idea?

  14. Iron
    Member
    Posted 17 years ago #

    That code adds a function to a hook "wp_footer". This hook is far away from the visual editor as far away is Tokyo from Paris.

    The question is : What to do when the site admin want to track site wide statistics using google analytics and users want also get google analytics on their blog ?

    Is it logical to have two google analytics codes on the same page ?

    yes it's possible by using "_uff = false;"

  15. dgilmour
    Member
    Posted 17 years ago #

    @au8ust: You haven't left any blank lines at the end of the plugin code, have you? See here and here above.

  16. au8ust
    Member
    Posted 17 years ago #

    @dgilmour
    I'm quite sure that I didn't have any blank line at the end of plugin file. But to make sure, here is it http://laoblogger.com/google-analytics-insert.phps

  17. Iron
    Member
    Posted 17 years ago #

    first line before <?php you have : ""

  18. hhuskies
    Member
    Posted 17 years ago #

    Yeah, you have  before <?php like Iron mentioned...

    If you just copy and paste amanzi's exact code on the first page of this thread, it should work perfectly. Just remember to insert your own Analytics code into hers, and be sure to not include any extra lines before or after the code she posted.

  19. Iron
    Member
    Posted 17 years ago #

    I saw somewhere a wordpress mu plugin that let either blog admin and site admin have google analytics... 2 accounts on the same page.
    One site wide for site admin
    One for a specific blog, set up by the blog admin.

  20. au8ust
    Member
    Posted 17 years ago #

    Which editor should I use? I opened the file in Notepad++ and I couldn't find any blank line or  :(

    Thanks in advance!

  21. andrea_r
    Moderator
    Posted 17 years ago #

    Open it right up on the server in the file manager.

  22. hhuskies
    Member
    Posted 17 years ago #

    Is it possible you accidentally edited the file in Textpad? I believe Textpad is known for adding in extra characters. But yeah, when in doubt, I just use my file manager as well.

  23. au8ust
    Member
    Posted 17 years ago #

    Thanks andrea! That works great!

    @hhuskies, I use Notepad++

  24. theapparatus
    Member
    Posted 17 years ago #

    @hhuskies, I use Notepad++

    Do make sure that you're opening and saving files within an UTF8 format. That may be the reason why an issue appeared.

  25. enterpriseJM
    Member
    Posted 16 years ago #

    This really was a very simple solution to tracking all my pages. I am the one footing the bill for my member's blogs and taking the time to help them develop effective and memorable blogs. I plan to reap the rewards by tracking visitors and getting a little ad revenue. I carry no guilt about it.

    Thanks for the code, amanzi, I appreciate your effort.

    Jim

  26. Akashic
    Member
    Posted 16 years ago #

    As through analytics menus: "Visitors --> Network Propeties --> Hostnames" you can list all stats of subdomains,
    but I've been pondering if it's possible to list mapped domains as well?
    The problem seems to be with _udn parameter (as pointing to the main domain). But on the other hand AdSense is catching all stats (both subdomains and mapped domains).

    Anyone succeded in listing ALL blogs in Analytics?

About this Topic