Everything you need to know about Google Analytics User ID

Reflective Data Google Analytics User ID

Need help?

Should you have any issues with your User-ID setup, feel free to ask for help in the comments below. One of our experts will reply in one day.

PS! Check if the question hasn’t been answered yet first.

Google Analytics, an analytics tool of choice for most of us, counts hits, page views, sessions and users.

That is clear, but did you know that users are not necessarily different users/people but could as well be the same person just using another device.

This will eventually mean that the number of users is actually less than what Google Analytics claims. You are also unable to match all of the actual visits and possible purchases that a single user has made.

Luckily, there is a feature called Google Analytics User ID.

Using User ID, you are able to unify the sessions that a single user is making using different devices, into one user in Google Analytics.

Not only does it make your user count more accurate, it will also help you understand how people really interact with your website. Imagine someone finding your website on a mobile device, then going to a desktop to finalize a purchase.

Topics covered in this article

  • Why do you need a User ID feature?
  • Who can use the User ID feature?
  • How to set up User ID tracking?
  • How to use collected User ID-s?

What does tracking User ID give us

First and foremost, you will become able to see actual users in your reports, rather than different devices.

Imagine this scenario:

A person using a smartphone is looking for a product, they find your store and interact with it, taking a look at different products and so on. Hopefully, they like what see.

After a few days,  they have decided to do some further research, ending up visiting your website again, this time using a tablet. Now, they really like the product and have decided to buy it.

Much like many of us, this person prefers to fill in the details etc. on their desktop device. So they grab a laptop and buy the product they found from your store, using their smartphone a few days earlier.

Without Google Analytics User ID feature you would see three different users visiting your website.

The first one is using a smartphone and is visiting many pages and products on your website.

The second user prefers a tablet and seems to be interested but then, suddenly leaves the site.

Now the third one is a perfect guy, going straight to the product and buying it like it was their job.

But that is not correct, it is actually the same person, a single user!

Using User ID you will see them as one, I think this is a pretty good reason.

Is my website eligible?

Probably all of you that don’t have the User ID feature on their website already, are now in hurry to get the feature installed.

Sadly, this feature is not for everyone. Your system must have some sort of unique ID in place already, something that would stay the same, cross device.

If your website provides a login option, you are good. If no login nor another way of identification is involved and you are not planning to add some, this feature is not for you.

Sites that almost always are eligible include e-commerce, social networks, applications, and anything with login, really.

How to set up Google Analytics User ID

As this is an extremely useful feature, enabling it takes a bit more than two clicks. But don’t worry, it’s doable.

Start by going to Admin view in your Google Analytics account.

In Property section click on Tracking Info and then on User-ID. There you can enable User ID tracking.

Session Unification

While setting up User ID you will need to choose whether you want to turn Session Unification ON or OFF.

Turning it ON will make sure that all of the hits that occurred before the User ID was assigned to a user, are also assigned to this user.

So, basically, it will make it possible to track what a user did before logging in, too.

Unless you have a good reason to do vice versa, turn it ON.

Google Analytics User ID Setup
Google Analytics User ID Setup

Modify your tracking code

To begin with, you need to figure out which value you are going to use as a User ID, we recommend using the same ID as does your identification system.

After you have figured out the ID, you need to pass it into a javascript variable (you might want to ask your developer’s help here)

When you have successfully passed the ID into a variable, you need to set is a User ID and send it to Google Analytics.

The easiest way to do so is to include userId attribute in your Property definition function.

Important!

The USER_ID value should be a unique, persistent, and non-personally identifiable string identifier that represents a user or signed-in account across devices.

In some cases, it can happen that you are not able to identify the user right away. This can happen in single page applications or with dynamic login forms.

Luckily, Google Analytics lets you set the User ID value later, too.

All you need to do is to call the following function, once the User ID is available.

Keep in mind that in this case, all of the hits (including pageview) will not have User ID attached to them automatically, unless you have Session Unification turned ON (which you should).

User ID View

In order to view User ID data, you need to create a separate view for it.

This view is going to include ONLY the visitors that have User ID value assigned to them, so expect to see less users, sessions and pageviews than in your main view.

This is important because some of the calculations are done differently from the non-userID views. For example counting the users.

You can create your User ID view at the same section where you turned ON the user ID tracking. Admin -> Property -> Tracking Info -> User ID

Give your User ID view a nice descriptive name. We recommend naming it just “User ID View”.

How to use User ID data

The very first thing you should do is to make sure that your User ID tracking is actually working.

You can do so by choosing your User ID view and checking if it has any hits.

Then navigate to Audience section in your Reporting view and choose User Explorer.

If everything is working as it should, you can see the table where to first column is named User ID, as opposed to Client ID in your regular view. The values in that column should represent the User ID-s that you have sent to Google Analytics.

Eventually, you should see something like this:

Google Analytics User ID Success
Google Analytics User ID Success

To see how many of your users actually have User ID assigned to them VS how many don’t, switch back to your main view and navigate to Audience -> Behaviour and choose User ID Coverage report.

Now what?

Once you are sure your User ID setup tracking is actually working, switch to your User ID view and start analyzing how people in this segment behave and perform.

You can also create segments based if the user has an User ID assigned to them or not.

Most probably you will soon realize that users, that have User ID are converting better, now it’s time to figure out if it’s correlative or causative relationship. And then if and how you could get more people into this better converting segment.

Conclusion

Google Analytics is a powerful analytics platform. But by configuring based on your actual business, you make it super-powerful.

By turning on User ID tracking you will evoke a new level of data and accuracy in your reports. Use it right and it will bring you extremely valuable insights that will eventually bring you more money.

After you have gone through and implemented what we discussed in this article, you can be sure that

  • You are properly tracking User ID-s
  • You have session unification turned ON
  • User ID view is created and showing results
  • You are one step closer to being totally data-driven

This article is a part of series called Most common Google Analytics issues (in-depth overview)

If you find something missing or misleading, please let us know in the comments.

Feel free to share this valuable information with your friends and colleagues.

39 thoughts on “Everything you need to know about Google Analytics User ID

  1. Hello,

    I’ve set up userID tracking with Google Tag Manager. I’ve noticed that now Google Tag Assistant shows that a new session is created each time user logs in.

    Is that how it is supposed to be? Google Analytics creates a new, separate session when we send userID?

    1. Hello Jakob,

      No, it should not create a new session. Do you have session unification turned on in the User-ID settings?

  2. Great and useful article for me!

    Currently, I am having GA with User ID.
    Next, I am planning to engage with my users with login data by signing up with simple personal information such as name, email address and phone number.

    I would like to ask, after these steps, can I know who visit my side from GA and can i interact with them like call them up or by email?

    Thanks.

    Regards,
    John

    1. Hello John

      Thank you for your question. You can definitely see which visitor did what in GA and you can call them by their name and email on your website but for the latter, you don’t really need to pull the data from GA. A simple cookie would do exactly the same.

      So, GA should be used for analytics and the rest is doable using a few lines of Javascript.

      Let me know if you have any further questions.

      Silver

  3. How much time it should take to show user-id data.
    I wanted to verify if everything has been set up correctly, I did it 3 days back but still, it is not showing.
    i have below code in google-analytics-tracking file.
    ga(‘create’, ‘UA-******-3’, ‘auto’);
    ga(‘send’, ‘pageview’);
    ga(‘create’, ‘UA-******-2’, ‘auto’, ‘gwTracker’);
    ga(‘gwTracker.send’, ‘pageview’);

    I don’t have userid here so that I am setting userid in the further code after loading JS.
    ga(‘set’, ‘userId’, ‘”.$user->id.”‘);
    ga(‘gwTracker.send’, ‘pageview’);
    Please guide me for correct implementation. Sepcially how to test runtime wheather userid is being sent or not.

    1. It’s working now. I have changed a bit my code.
      ga(‘create’, ‘UA-******-2’, ‘auto’, ‘gwTracker’,{
      userId: USER_ID
      });
      ga(‘gwTracker.send’, ‘pageview’);

      1. Hello Harpal

        I’m glad you got it fixed. What was wrong with your first snippet, though, was that you set the userId on the default tracker but sent a pageview with a custom tracker (gwTracker). So the other possible fix would have been this:

        ga(‘gwTracker.set’, ‘userId’, ‘”.$user->id.”‘);
        ga(‘gwTracker.send’, ‘pageview’);

        As GA does have some delay (up to 24 hours), it is always a good idea to test your setup using the “GA Debug” Chrome plugin, this shows you exactly what kind of data is being sent with your pageviews and other hits.

        Let me know if you have any further questions.

        Silver

  4. Silver, I appreciate your article and invite to ask further questions about User ID. I have two related questions:
    1. Can the Google ID (the persistent ID that Google uses for signed in users of their properties-apps, be tracked and assigned as the User ID and sent to Google Analytics? My understanding is that with the new Cross-Device Reporting that Google uses their persistent ID for those visitors who have registered as a Google user and assigned a persistent Google ID. And my question is using this Google ID, assigning it to User ID…creating a Custom Dimension that enables me to stitch together Client IDs into their unique User IDs (where possible)…and then download unique User IDs and unique customer journeys.
    2. Can third-party persistent IDs, such as LiveRamp’s IdentityLink (ID) be tracked (with LiveRamp’s license) and assigned as the User ID and sent to Google Analytics?

    I appreciate whatever information you can provide.

    Cheers,

    Karl Lendenmann

    1. Hello Karl and thank you for your question.

      1. It can definitely be tracked and assigned as the User ID. Otherwise, how would you connect the logged in user with your backend and database across different devices?
      2. Sure, although these ID-s are sometimes not available during the first page view as they are requested form a 3rd party server. Although, you might be able to get them from cookie value or send with a custom event once they’re available.

      Let me know if I understood your questions correctly or if you have any further questions.

      Silver

  5. This is a very good article. I have setup UserID on my website using this. Thank You. I have one question though. In Audience > User Explorer, I am only seeing client ID generated by google and not the user id i am sending for each user. I have tested with ga debugging tools that user id is being sent on each page view and also in Audience -> Behaviour -> User ID Coverage report I am seeing many users as assigned but I am not able to see their user ids in any report Any help will be appreciated.
    Thanks

    1. Hello Sahil!

      I’m glad you liked the article.

      User-ID is only available in the specific User-ID view, if you haven’t created one yet, you can do so by navigating to Admin -> Tracking Info -> User-ID.

      Let me know if that fixed it for you or if you need further help.

      Silver

  6. Pingback: Google Analytics views you should add to your setup - Reflective Data
  7. Dear Silver,

    Great post. I have one question though. I want to track user names instead of IDs, I could easily do that through custom variables but fetching this data might violate google policy and lead to termination of my account. Is there any other way of fetching this data securely?

    Thank you in advance.

    Regards,
    Isha

    1. Hello Isha,

      Sorry for the delayed reply. You are correct, storing personal information in Google Analytics is not allowed and may lead to the termination of your account.

      The best way for doing this might be storing a UID in Google Analytics and using some other tool for analysis (Microsoft BI, Tableau etc) and connecting this UID to the real username later in the tool.

      I hope this helps,

      Silver

  8. Dear Silver,

    I want to track all my users who filled my inquiry form. After filling form they will land on thank you page with userid in url. This userid is unique and randomly generated numeric code.
    After this thank you page, users sometimes visit my website. And I want to track all these customers because obviously, they are more interested than others.

    please suggest the best solution.

    1. Hey Ankit,

      As I understand, this user ID is present only once? Meaning when they visit the site again on a different device, they won’t have that same user ID again? They usually would if there’s a login feature.

      Other than that, you don’t really need the user ID feature here. I’d recommend sending a custom event once a user submits the form. Then you can use that event to create user-based custom segments in GA and see how these users behave.

      You could also send that user ID into a custom dimension and see reports for every unique user if you wanted to. Using custom reports.

      Let me know if this answers your question and feel free to ask another one.

      Best wishes,

      Silver

  9. Pingback: Why CPRU is the new metric in Performance Marketing – Exponentially - SaaS Growth And Metrics.
  10. Awesome article! First time I heard about UserIDs is your website! Loving it.

    I am trying to think of custom reports I could use for my website with this UserID feature, and Im not sure how to actually create them :blush:

    Would it be possible to create user report where I would be able to only see users with 5 or more sessions? I would then take their IDs and use the in my remarketing campaigns.

    Thanks
    Mike

    1. Hey Mike,

      Yes, you can definitely do this with custom segments in GA. Create a new segment -> Choose Behaviour tab -> set the rule “Sessions > 4”.

      Hope this was helpful. Let me know if you have any further questions.

      Silver

      1. One more thing:

        Is it possible to create a report for users that have logged in (at least once) in the last 30 days?

        Thanks a ton!!!

        1. Well, that is not doable with the default setup. You could store the “last login” date in a custom dimension every time user logs in, though. And then use that value for your custom segments.

  11. Hi, it’s possible to get data from analytic (maybe trought the API) for an specified user ID on the web site. When a customer visit my website I want to get the past analytic data of that customer to cutomize the website for him. For example… if the customer visited a product page in the past, I want to show a discount over that product on the home page.

    Thanks in advance and sorry because my poor english.

    1. You could see such data in Google Analytics reports, pulling it to the website would be an overkill, though. Why not use cookies or some personalization platform?

  12. Hi – good article! Does implementing the user-id allow you to report on conversion rate of signed in customers vs non-signed in customers? If so, how? Does “session unification” get in the way?
    Thanks!

    1. You could do so easily by storing logged-in status in a custom dimension. Then create custom segments based on that custom dimension value.

      Let me know if you have any further questions.

      Silver

      1. Silver –
        To make sure that custom dimension works well with User ID (as described in this article), should the scope of that custom dimension be hit, session, user or product? Thanks!

        PS “Silver” – Very cool name BTW!

        1. Hey Peter,

          For the sake of accuracy, I would go with the scope “session”. That’s because in a single session a visitor can be logged out and later they might log in.

          Hope this helps, let me know if you have any other questions.

          And thanks, I like my name, too 🙂

  13. Nice!
    I have one question.
    Does works with cordova google-analytics-plugin?
    Because i have this property in cordova ( $cordovaGoogleAnalytics.setUserId(“user_id_here”) )
    I’m use Ionic Framework v1.

  14. Great article! You very succinctly capture all the nuances to the hurdles of setting up User-Id. What I can’t seem to find out there is a definitive answer as to whether results tracked prior to configuring User-Id (tracked with Client ID) would eventually be connected to the User-Id. For instance: We are seeing considerably less data in the User-Id view for a given day then we are on the default all traffic view. In our case, we don’t expect users are using multiple devices. We instead suspect that the results of returning users are being grouped into the Client ID bucket, as we did not have user-id configured when they first visited.

    1. User-id view shows only the sessions that had user-id defined (usually only the logged in users). Everyone else will be excluded from that view.

      Let me know if that might be the case for you or if there has to be something else.

      Anyway, it is totally normal to see a lot smaller numbers in User-id views. Right now I am looking at one of our client’s website and the number of sessions is 700,000 vs 16,000.

      1. Thank you. I understand what you are saying, but that is not what I am asking. Let me try to say it differently: Before I configured User ID tracking, I had started collecting results in the all traffic view. Each of those results had different client IDs and were all from different people. (our environment is somewhat controlled.) Now that we have enabled user ID tracking, we would like to be able to associate the client ids tracked previously to the user, going forward. — The reason we ask is that we know we have had the same users come back, and we dont ever see them in the User-id view, however we do see brand new users. We have confirmed that for both user types that the user id is being sent in the transaction. We do have unification on.

  15. I’ve been working with Google Analytics for more than 3 years now, as a marketer though. But we never really installed User ID, although we had a discussion, will contact my developers right now. Sounds really important for any ecommerce, really. So thanks!

  16. We’ve been collecting User id for quite a long time now but I believe there must be something wrong. Only ~1% of visitors have it attached to them in Google Analytics.

    Í am quite sure that about 20% actually logged in.

    Any idea what could be off here?

    1. There can be multiple reasons here. Do you send User ID on specific pages only? Does your Javascript have an access to the value on every page you are trying to send it? It can happen that User ID is available only on user-related pages or on login-success page only, and not on the product pages etc, even if they’re actually logged in. I recommend looking into it with your developer.

      Silver

  17. Okay, now this is one really useful article, especially for me. We are just setting up User ID tracking for our ecommerce website. Thanks.

    Oh, and nice cover image 😉

    Julia

    1. Hi Julia,

      Glad you liked it. And of course, good luck with setting up the User ID tracking, feel free to ask us if you have any questions!

Leave a Reply

Your email address will not be published. Required fields are marked *

Sign up for Reflective Data

5,000 sessions / month ×

Please enter your email

Submit

After submitting your email, we will send you the registration form.