0

I have Analytics set up where I am also sending The User ID. This is set when a user logs in, and is undefined when not logged in.

I am trying to track administrators of the site. When an admin logs into the admin section of the site a Custom Dimension is set with the scope being User.

My understanding of dimensions with a user scope is that it should persist between sessions - almost like a permanent cookie.

However, studying the analytic data, the Custom Dimension does not persist when the admin logs out.

I would have thought that it should persist as the Analytics Client ID remains the same?

Could someone please advise as to wether this is normal behaviour?

If it is, what would be the appropriate method to create a dimension that would persist?

1

If your User ID is user scoped, then whatever the last value was set at, will be the value applied to all hits for that user, across all sessions. If it changes in the next session, then the value, again across all hits, across all sessions, will be changed to that latest value.

So what you probably shouldn't be doing is setting the value when the user logs out. Put in some logic to only define the user ID custom dimension when the User ID value is valid (ie. not "logged out" or "undefined" or whatever).

  • thanks for the reply. I'm not entirely sure that I was clear with my question so I have edited it. The custom Dimension isn't the UserID. It appears that when the user ID changes (ie the admin user logs out), the custom dimension disappears - I would have thought that this shouldn't be the case and it would persist. – noelmcg Dec 6 '16 at 21:26
  • What do you mean the "custom dimension disappears"? How are you sending in your custom dimension? It is set with whatever hit you are sending. – nyuen Dec 7 '16 at 18:22
  • By disappeared I mean that when I check if the dimension has been set it isn't set. I do this by looking at events that should be filtered by the dimension. The custom dimension is sent on a pageview - any page in the administration area of the site – noelmcg Dec 7 '16 at 20:15
  • What would be the best method to debug this? webmasters.stackexchange.com/questions/101735/… – noelmcg Dec 7 '16 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.