Stay organized with collections
Save and categorize content based on your preferences.
User IDs are your own unique identifiers that you assign to individual users.
This guide explains how to send user IDs to Google Analytics, so you can connect
user behavior across different sessions, devices, and platforms.
Setting custom dimensions based on user IDs leads to dimensions with too many
unique values. Having too many unique values causes issues with Google
Analytics data and reporting accuracy. Learn more about best practices for
setting custom
dimensions.
Before you begin
Before you can send user IDs, make sure you've completed the following:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["\u003cp\u003eUser IDs, assigned by you, enable tracking user behavior across sessions, devices, and platforms in Google Analytics.\u003c/p\u003e\n"],["\u003cp\u003eTo send user IDs to Google Analytics, ensure you have a Google Analytics account, a web data stream, and the Editor role or higher.\u003c/p\u003e\n"],["\u003cp\u003eAvoid setting custom dimensions based on user IDs and sending user IDs when a user isn't signed in to maintain data accuracy.\u003c/p\u003e\n"],["\u003cp\u003eBefore implementing user IDs, review the best practices and guides linked in the document to avoid potential issues.\u003c/p\u003e\n"]]],["User IDs are unique identifiers assigned to users to track their behavior across sessions, devices, and platforms within Google Analytics. To ensure data accuracy, avoid using user IDs for custom dimensions and only send them when users are signed in; do not set placeholder values. Before sending user IDs, establish a Google Analytics account and web data stream, and ensure the Editor role is assigned.\n"],null,["User IDs are your own unique identifiers that you assign to individual users.\nThis guide explains how to send user IDs to Google Analytics, so you can connect\nuser behavior across different sessions, devices, and platforms.\n\nTo learn more about the User-ID feature, see [Measure\nactivity across platforms](//support.google.com/analytics/answer/9213390). To learn how to set a user ID for an app, see [Set a\nuser ID](//firebase.google.com/docs/analytics/userid).\n| **Warning:** Don't set custom dimensions based on user IDs.\n\nSetting custom dimensions based on user IDs leads to dimensions with too many\nunique values. Having too many unique values causes issues with Google\nAnalytics data and reporting accuracy. [Learn more about best practices for\nsetting custom\ndimensions](//support.google.com/analytics/answer/14240153#best-practices).\n\n\u003cbr /\u003e\n\n\ngtag.js Tag Manager\n\nBefore you begin\n\nBefore you can send user IDs, make sure you've completed the following:\n\n- [Create a Google Analytics account and property](https://support.google.com/analytics/answer/9304153#account).\n- [Create a web data stream for your website](https://support.google.com/analytics/answer/9304153#stream&zippy=%2Cweb).\n- Have the [Editor](https://support.google.com/analytics/answer/9305587) role (or above) to the Google Analytics account.\n\nSend user IDs\n\nThe value you send for `user_id` depends on the state of\nthe user:\n\n- **User has never signed in** : Don't send the `user_id` parameter.\n- **User is signed-in**: Send their user ID.\n- **User was signed-in, then signed out** : Send `null`."]]