WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics
How to disable tracking visits for Admins? (3 posts)

  1. korvas
    Member
    Posted 9 months ago #

    What do you need to add/modify to the code in order to disable tracking traffic by logged in users/Administrators?

    http://wordpress.org/plugins/googleanalytics/

  2. kasamalee
    Member
    Posted 7 months ago #

    I have the same question, where do we go to disable administrator's tracking. I cannot find it. Help! Thank you.

  3. Sim2K
    Member
    Posted 6 months ago #

    Swap .....

    <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', '<?php echo $web_property_id ?>']);
    _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';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>

    ... for ...

    <?php
    if ( !is_super_admin() ) {
    ?>
    <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', '<?php echo $web_property_id ?>']);
    _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';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>
    <?php
    }
    ?>

    in file ...

    googleanalytics/googleanalytics.php

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.