• We have a website set to logged in users only with just a few pages accessible to not logged in users. We’re wanting to install google analytics tracking codes so we can track what pages logged in users are using. I set up the tracking codes and added them to all pages, but it’s unable to track any of the “logged in users” only pages. Is there a way around this?

Viewing 1 replies (of 1 total)
  • Plugin Support Aswin Giri

    (@aswingiri)

    Hello @bencogandesign

    If you are only trying to add google analytics code for logged-in users only, you can try following code snippets:

    <?php
    add_action('wp_head',function(){
    if(is_user_logged_in()){
    ?>
    <script>
    //put your analytics codes here
    </script>
    <?php
    }
    },100);
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Google Analytics Tracking’ is closed to new replies.