1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

In Google Analytics, is it possible to track users separately by whether or not theyre logged in?

Discussion in 'Google Analytics' started by aldiokenih, Nov 7, 2019 at 1:03 PM.

  1. #1
    For example, a logged in user will always reach my /customer/info page after logging in, so can i separate my Google analytics result based on whether or not users of my site reached that page?
    I've contacted google support many times, and they all said this is impossible. But i feel like they were just trying to not help me. they always said i need to redirect the customer to some kind of thankyou.hmtl page before they're brought to their profile page, but why do i need this thankyou.html page when a user is always brough to their profile page after logging in and my user profile page is also an html page (cshtml) and start the tracking there?
    a few result from google says this is the code i want but im not sure where to impement that.

    if (isset($userId)) { $gacode = "ga('create', 'UA-XXXX-Y', { 'userId': '%s' });"; echo sprintf($gacode, $userId); } else { $gacode = "ga('create', 'UA-XXXX-Y');"; echo sprintf($gacode); }

    i expect a way for Google Analytics to give me two separate data based on whether or not a user is logged in. i want to see the different pages a logged in users might visit vs non logged in users
    aldiokenih, Nov 7, 2019 at 1:03 PM IP