Skip to:
Content
Pages
Categories
Search
Top
Bottom

No Analytics for Admins

  • @adventurecanoe

    Member

    What if I wanted to only display my Google Analytics code for everyone but me…

    I know this is probably simple but I don’t want to mess it up and loose tracking. I need something that says

    if <> admin then

    display google tracking code

    end if

    The problem is I am an old ASP guy and trying to learn this php stuff.

    -James

    Adventure Canoe Forum

Viewing 5 replies - 1 through 5 (of 5 total)
  • @kawauso

    Member
    <?php if ( !bb_current_user_can('manage_options') ) : ?>
    GOOOOOGLE :)
    <?php endif; ?>

    or

    <?php if ( !bb_current_user_can('manage_options') ) { ?>
    GOOOOOGLE :)
    <?php } ?>

    bbPress/WordPress have a boolean function for pretty much everything

    @finalwebsites

    Participant

    why so difficult? just filter IP addresses within GA

    @kawauso

    Member

    @Olaf: Some of us aren’t lucky enough to have static IPs ;P

    @finalwebsites

    Participant

    @kawauso,

    how about filtering hostnames?

    @kawauso

    Member

    Hostnames will just be the public-facing DNS entry for your IP, which in my case at least is just a nice text-and-numbers version of my IP :P

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar