• Hi,
    could you help me to exclude the code of google analytics if admin or some users who write the blog are curretly logged in and browse the site.

    Thanks,
    bart.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter barelief

    (@barelief)

    sorry 4 my laziness, scanned codex, and here is the solution

    <?php
    global $userdata;
    get_currentuserinfo();
    if ($userdata->user_login!="admin"):
    print "<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "UA-42393-3";
    urchinTracker();
    </script>";
    endif;
    ?>

    http://codex.wordpress.org/get_currentuserinfo

    Thank you for posting back the solution!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘exclude analytics code if admin is logged in’ is closed to new replies.