Mobile app version of vmapp.org
Login or Join
Candy875

: How do I segment logged in users in GA using GTM? I would like to segment logged in and not-logged-in users using GA. The idea I have in mind is to create a Data Layer Variable (logged_in),

@Candy875

Posted in: #GoogleAnalytics #GoogleTagManager

I would like to segment logged in and not-logged-in users using GA. The idea I have in mind is to create a Data Layer Variable (logged_in), and then ask my developers to push a value for that variable into the Data Layer on every page (either ‘yes’ or ‘no’). So the code would look something like:

var loggedIn = checkIfLoggedIn(); //returns ‘yes’ if logged in
dataLayer.push ({ ‘logged_in’ : loggedIn})


Now I assume there will be some server-side scripting involved using PHP and that this cannot be accomplished using pure Javascript. I am not aware of the details, but I guess my developers will be able to take care of it. As a not-so-technical marketer, all I need to tell them is to push so-and-so data into the dataLayer, right?

Next, I’ll create a GTM Google Analytics Custom Dimension tag that is fired on every Pageview event, and update a Custom Dimension on the logged-in status.

Will this approach work? Please let me know, thanks!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Candy875

1 Comments

Sorted by latest first Latest Oldest Best

 

@Hamm4606531

Yes, that's how it should happen. You tell the devs to populate, from the backbend, if a user is logged in or not, and then you populate your custom dimension with that value for every page.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme