קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ל-Google Analytics יש קריאה ל-setUserID, שמאפשרת לכם לאחסן מזהה משתמש עבור האדם שמשתמש באפליקציה שלכם. הקריאה הזו היא אופציונלית, ובדרך כלל משתמשים בה ארגונים שרוצים להשתמש ב-Analytics בשילוב עם BigQuery כדי לשייך נתונים מ-Analytics לאותו משתמש בכמה אפליקציות, בכמה מכשירים או בכמה ספקי ניתוח נתונים.
יש הרבה דרכים ליצור מזהי משתמשים תקינים. אחת הגישות היא להשתמש במזהה שאתם מקצים, ורק אתם יכולים לעקוב אחריו כדי לזהות משתמש ספציפי. לדוגמה, נניח שמפתח משחקים לנייד, AwesomeGameCompany, יוצר AwesomeGameCompanyID משלו לכל משתמש. אם ארגון חיצוני לא יכול לעקוב אחרי AwesomeGameCompanyID עד למשתמש המקורי, הוא יכול להשתמש ב-AwesomeGameCompanyID בתור ערך מזהה המשתמש עבור Analytics, או אפילו טוב יותר, בגרסה מגובבת של AwesomeGameCompanyID.
כך הם יוכלו לחשב ערכים כמו ההוצאה הכוללת של משתמש בכל המשחקים שלו.
הגדרה של מזהה משתמש אף פעם לא נדרשת כדי ש-Analytics יפעל כמו שצריך.
אם אתם רוצים למצוא אירועים ששייכים לאותו משתמש באותה אפליקציה במכשיר יחיד, אתם יכולים להשתמש ב-user_pseudo_id.
הערך הזה נוצר באופן אוטומטי על ידי Analytics ונשמר ב-BigQuery לכל אירוע.
אחרי שמגדירים מזהה משתמש, כל האירועים העתידיים יתויגו באופן אוטומטי בערך הזה, ותוכלו לגשת אליו על ידי שליחת שאילתה לערך user_id ב-BigQuery. הוספה של מזהה משתמש לא תשפיע על אירועים שכבר תועדו על ידי Google Analytics.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-08-30 (שעון UTC)."],[],[],null,["Google Analytics has a `setUserID` call, which allows you to\nstore a user ID for the individual using your app. This call is optional, and\nis generally used by organizations that want to use Analytics\nin conjunction with BigQuery to associate analytics data for the same user across\nmultiple apps, multiple devices, or multiple analytics providers.\n| **Note:** You are responsible for ensuring that your use of the user ID is in accordance with the [Google Analytics Terms of Service](https://www.google.com/analytics/terms/). This includes avoiding the use of impermissible personally identifiable information, and providing appropriate notice of your use of identifiers in your Privacy Policy. Your user ID must not contain information that a third party could use to determine the identity of an individual user. For example, you cannot use a user's email address or social security number as a user ID.\n\nThere are many ways you can construct valid user IDs. One approach is to use an\nidentifier you assign and only you can track back to an individual user. For one\npossible example, consider a hypothetical mobile game developer,\nAwesomeGameCompany, that has their own internal `AwesomeGameCompanyID` that they\ncreate for every user. If it isn't possible for an outside organization to track\nthat `AwesomeGameCompanyID` back to the original user, they might consider using\nthat `AwesomeGameCompanyID` --- or, better yet, a hashed version of\n`AwesomeGameCompanyID` --- as the user ID value for Analytics.\nThis would then allow them to calculate values such as a user's total spend\nacross all of their games.\n\nSetting a user ID is never required for Analytics to work correctly.\nIf you're only interested in finding events belonging to the same user for the\nsame app on a single device, you can use the `user_pseudo_id`.\nThis value is generated automatically by Analytics and is\nstored within BigQuery for each event.\n\nSetting the user ID\n\nYou can set a user ID with the following method: \n\nSwift\n\n\n**Note:** This Firebase product is not available on the macOS target. \n\n```swift\nAnalytics.setUserID(\"123456\")\n```\n\nObjective-C\n\n\n**Note:** This Firebase product is not available on the macOS target. \n\n```objective-c\n[FIRAnalytics setUserID:@\"123456\"]\n```\n\nAndroid \n\n```java\nmFirebaseAnalytics.setUserId(\"123456\");\n```\n\nWeb \n\n```java\nimport { getAnalytics, setUserId } from \"firebase/analytics\";\n\nconst analytics = getAnalytics();\nsetUserId(analytics, \"123456\");\n```\n\nWeb \n\n```java\nfirebase.analytics().setUserId(\"123456\");\n```\n\nDart \n\n```dart\nawait FirebaseAnalytics.instance.setUserId(id: '123456');\n```\n\nUnity \n\n```c#\nFirebase.Analytics.FirebaseAnalytics.SetUserID(\"123456\");\n```\n\nC++ \n\n```c++\nanalytics::SetUserId(\"123456\");\n```\n\nAfter setting a user ID, all future events will be automatically tagged\nwith this value, and you can access it by querying for the `user_id`\nvalue in BigQuery. Adding a user ID will not affect any\nevents previously recorded by Google Analytics.\n\nTo find out more about accessing Analytics data in BigQuery, please see\nthis [development guide](https://cloud.google.com/solutions/mobile/mobile-firebase-analytics-big-query)."]]