קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
פלטפורמת Google Analytics Measurement Protocol מאפשרת לשלוח נתונים אופליין למקור נתונים של אתר או אפליקציה, בנוסף לנתונים שכבר נאספים באמצעות תיוג או Firebase SDK.
במדריך הזה מתוארים תרחישי שימוש נפוצים ב-Measurement Protocol של Google Analytics והדרישות שלהם.
סיכום הדרישות
בטבלה הזו מפורטות בקצרה הדרישות לגבי כל תרחיש שימוש. הנה כמה שיטות מומלצות שכדאי לזכור:
ערך ברירת המחדל שמוגדר לפרמטר timestamp_micros של האירועים ומאפייני המשתמשים הוא מועד הבקשה. כששולחים שינוי באירוע או במאפיין משתמש שהתרחש בעבר, צריך להחליף את חותמת הזמן כמו שמתואר במדריכים בנושאי שליחת אירועים ומאפייני משתמשים.
כדי לקבל דוחות 'פעילות בזמן אמת' ומדדי התעניינות מדויקים, צריך לכלול פרמטר אירוע engagement_time_msec שמוגדר לאלפיות השנייה שעברו מאז האירוע הקודם.
תרחיש לדוגמה
מזהה הסשן
דרישה לגבי מועד הבקשה
timestamp_micros דרישה
הקצאת User-ID לאירועים
חובה
<= סוף יום העסקים שבו הסשן התחיל
>= התחלת הסשן וגם <= סוף הסשן
שיוך (Attribution) הסשן
חובה
<= התחלת הסשן + 24 שעות
>= התחלת הסשן וגם <= סוף הסשן
ייצוא אירועים לפלטפורמות הפרסום
לא נדרש
<= יום העסקים של הסשן האחרון + 63 ימים
>= מועד הבקשה פחות שני ימי עסקים ו-<= מועד הבקשה
שליחת אירועים או מאפייני משתמשים כדי ליצור קהלים
לא נדרש
אתר: <= מועד האירוע האחרון אונליין + 30 ימים
אפליקציה: <= מועד האירוע האחרון אונליין + 42 ימים
>= מועד הבקשה פחות שני ימי עסקים ו-<= מועד הבקשה
הקצאת User-ID לאירועים
שימוש ב-Measurement Protocol כדי לספק לאירועים אונליין או אופליין User-ID.
הנה כמה תרחישים לדוגמה לשימוש ב-User-ID באירוע:
למדידה אונליין חסר המידע הדרוש כדי לחפש את מזהה המשתמש לאירועים אונליין, אבל יש לכם צינור לעיבוד אירועים שיכול לבצע את השיוך בין סשן אונליין לבין מזהה משתמש.
בתרחיש הזה, אתם משתמשים ב-Measurement Protocol כדי לספק אירועים אונליין עם User-ID.
אין לכם User-ID לאירועים שאתם שולחים באמצעות Measurement Protocol, אבל אתם רוצים שהאירועים האלה ישויכו ל-User-ID אם המשתמש התחבר אונליין במהלך הסשן.
בתרחיש הזה, אתם משתמשים באירועים אונליין כדי לספק אירועים של Measurement Protocol עם מזהה משתמש.
אלה הדרישות להוספת User-ID לאירוע:
כוללים את session_id ברשימת הפרמטרים של האירוע.
שולחים את אירועי Measurement Protocol באותו יום עסקים שבו התרחש הסשן אונליין.
אם אתם מבטלים את ברירת המחדל של timestamp_micros, אתם צריכים להגדיר אותו כחותמת זמן בין שעת ההתחלה לשעת הסיום של הסשן אונליין.
אם המטרה שלכם היא לספק User-ID לאירועים אונליין, צריך להגדיר את user_id בבקשה.
אם המטרה שלכם היא שלכל אירוע Measurement Protocol יהיה User-ID מהסשן התואם אונליין, אתם לא צריכים להגדיר את user_id.
שיוך (Attribution) הסשן
אירועי Measurement Protocol שעומדים בדרישות ספציפיות מופיעים בדוחות עם אותם מאפייני סשן (כמו מידע גיאוגרפי, מקור, אמצעי הגעה לאתר וקמפיין) כמו אירועים אונליין מאותו סשן.
אלה הדרישות לשיוך סשנים:
כוללים את session_id ברשימת הפרמטרים של האירוע.
צריך לשלוח את הבקשה תוך 24 שעות ממועד תחילת הפגישה באינטרנט.
לדוגמה, אם הסשן התחיל ב-11:15 בבוקר ביום שני באזור הזמן של הנכס, צריך לשלוח את הבקשה לפני 11:15 בבוקר ביום שלישי.
אם אתם מבטלים את ברירת המחדל של timestamp_micros, אתם צריכים להגדיר אותו כחותמת זמן בין שעת ההתחלה לשעת הסיום של הסשן אונליין.
ייצוא אירועים לפלטפורמות הפרסום
מערכת Google Analytics כוללת את האירועים שאתם שולחים באמצעות Measurement Protocol בייצוא למוצרי פרסום מקושרים כמו Google Ads או Campaign Manager 360.
הנה כמה תרחישים נפוצים שבהם זה שימושי:
לעסק שלכם יש אירועים אופליין שאתם רוצים לכלול בשיוך (Attribution) ובדיווח של הפרסום.
יש לכם אירועים נוספים במערכת שלא זמינה לתיוג או ל-Firebase SDK, אבל אתם עדיין רוצים לכלול את האירועים האלה במוצרים המקושרים.
אלה הדרישות לייצוא אירועים לפלטפורמות פרסום:
שולחים את הבקשה עד סוף יום העסקים ה-63 אחרי האירוע האחרון אונליין, גם אם חלון השיוך של האירוע המרכזי ארוך מ-63 ימים.
לדוגמה, אם האירוע האחרון אונליין של client_id או app_instance_id התרחש ב-1 במרץ, צריך לשלוח את האירוע של Measurement Protocol עד סוף יום העסקים ב-3 במאי.
אם אתם משנים את הערך של timestamp_micros, צריך להגדיר אותו כחותמת זמן בתוך שלושת ימי העסקים האחרונים.
שליחת אירועים או מאפייני משתמשים כדי ליצור קהלים
אירועים ומאפייני משתמשים שנשלחים באמצעות Measurement Protocol נכללים בהערכה של תנאי קהל אם עומדים בכמה דרישות.
אלה הדרישות לשליחת אירועים או מאפייני משתמשים לצורך יצירת קהלים:
שולחים את הבקשה לזרם נתונים מהאינטרנט לא יאוחר מסוף יום העסקים 30 ימים אחרי האירוע האחרון אונליין עבור אותו client_id.
לדוגמה, אם האירוע האחרון אונליין של client_id התרחש ב-1 במרץ, צריך לשלוח את האירוע של Measurement Protocol עד סוף יום העסקים ב-31 במרץ.
צריך לשלוח את הבקשה לזרם של אפליקציה עד סוף יום העסקים, 42 ימים אחרי האירוע האחרון אונליין של אותו app_instance_id.
לדוגמה, אם האירוע האחרון אונליין מסוג app_instance_id התרחש ב-1 במרץ, צריך לשלוח את האירוע של Measurement Protocol עד סוף יום העסקים ב-12 באפריל.
אם אתם משנים את הערך של timestamp_micros, צריך להגדיר אותו לחותמת זמן מ-3 ימי העסקים האחרונים.
[null,null,["עדכון אחרון: 2025-07-29 (שעון UTC)."],[[["\u003cp\u003eThe Google Analytics Measurement Protocol allows you to send offline data, supplementing your existing online data collection.\u003c/p\u003e\n"],["\u003cp\u003eThis protocol enables you to assign User IDs to events, attribute sessions, export events for advertising, and leverage data for audience creation within Google Analytics.\u003c/p\u003e\n"],["\u003cp\u003eSpecific requirements, including session IDs and timestamps, must be met for each use case to ensure data accuracy and integration with online data.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the provided tables and guidelines for detailed requirements and best practices for each use case, such as session attribution and audience creation.\u003c/p\u003e\n"],["\u003cp\u003eAdhering to these guidelines ensures accurate reporting, attribution, and audience creation based on both online and offline data within your Google Analytics property.\u003c/p\u003e\n"]]],["The Google Analytics Measurement Protocol allows sending offline data to web or app streams. Key actions include: assigning User-IDs to events (requiring a `session_id`, same-day processing, and specific `timestamp_micros`), attributing sessions (requiring `session_id` and submission within 24 hours of session start), exporting events to advertising platforms (no `session_id` required, must be sent within 63 days of the last online event), and using data for audience creation (no `session_id`, web data must be sent within 30 days and app data within 42 days of the last event).\n"],null,["# Measurement protocol use cases\n\nThe Google Analytics Measurement Protocol lets you send offline data to your Web or App stream, in\naddition to the data you're already collecting with tagging or the Firebase SDK.\n\nThis guide describes common Google Analytics Measurement Protocol use cases and their requirements.\n| **Key Term:** In this guide, \"business day\" is the business day of an event or session in the [time zone of your property](//support.google.com/adsense/answer/9830725).\n\nSummary of requirements\n-----------------------\n\nThis table provides a quick reference of the requirements for each use\ncase. Keep the following best practices in mind:\n\n1. The `timestamp_micros` of events and user properties defaults to the request\n time. When sending an event or user property change that occurred in the\n past, override the timestamp as described in the [sending events](/analytics/devguides/collection/protocol/ga4/sending-events) guide and\n the [user properties](/analytics/devguides/collection/protocol/ga4/user-properties) guide.\n\n2. For accurate Realtime reports and engagement metrics, include the\n `engagement_time_msec` event parameter set to the milliseconds elapsed since\n the preceding event.\n\n| Use case | Session ID | Request time requirement | `timestamp_micros` requirement |\n|------------------------------------------------------|--------------|-----------------------------------------------------------------------------------------|---------------------------------------------------------------|\n| Assign User-ID to events | Required | \\\u003c= end of the session start's business day | \\\u003e= session start and \\\u003c= session end |\n| Session attribution | Required | \\\u003c= session start + 24 hours | \\\u003e= session start and \\\u003c= session end |\n| Export events to advertising platforms | Not required | \\\u003c= last session business day + 63 days | \\\u003e= request time minus two business days and \\\u003c= request time |\n| Send events or user properties for audience creation | Not required | Web: \\\u003c= latest online event time + 30 days App: \\\u003c= latest online event time + 42 days | \\\u003e= request time minus two business days and \\\u003c= request time |\n\nAssign User-ID to events\n------------------------\n\nUse the Measurement Protocol to provide online or offline events with a\n[User-ID](//support.google.com/analytics/answer/9213390).\n\nHere are some example use cases for adding a User-ID to an event:\n\n1. Your online measurement lacks the information needed to look up the\n User-ID for online events, but you have an event-processing pipeline that\n is able to make the association between an online session and a User-ID.\n\n In this scenario, you are using the Measurement Protocol to provide\n *online* events with a User-ID.\n2. You don't have the User-ID for events you are sending with the\n Measurement Protocol, but you want those events to be associated with a\n User-ID if the user logged in online over the course of the session.\n\n In this scenario, you are using online events to provide\n *Measurement Protocol* events with a User-ID.\n\nHere are the requirements to add a User-ID to an event:\n\n- Include the `session_id` in the event's parameter list.\n- Send the Measurement Protocol events on the *same business day* as the online session.\n- If you override `timestamp_micros`, set it to a timestamp between the start and end time of the online session.\n- If your goal is to provide User-ID for online events, set the `user_id` in the request.\n- If your goal is for each Measurement Protocol event to have the User-ID from its corresponding online session, you don't need to set `user_id`.\n\nSession attribution\n-------------------\n\nMeasurement Protocol events that meet specific requirements appear in reports\nwith the same session attributes (such as geographic information, source,\nmedium, and campaign) as online events from the same session.\n\nHere are the requirements for session attribution:\n\n- Include the `session_id` in the event's parameter list.\n- Send the request no later than 24 hours after the start of the online\n session.\n\n For example, if the session started at 11:15 AM on Monday in your property's\n time zone, send the request before 11:15 AM on Tuesday.\n- If you override `timestamp_micros`, set it to a timestamp between the\n start and end time of the online session.\n\nExport events to advertising platforms\n--------------------------------------\n\nGoogle Analytics includes the events you send using Measurement Protocol\nin exports to linked advertising products such as Google Ads or Campaign Manager\n360.\n| **Tip:** This use case doesn't require `session_id`.\n\nA few common scenarios where this is useful include:\n\n- Your business has offline events that you want included in advertising attribution and reporting.\n- You have additional events in a system that is not available to tagging or the Firebase SDK, but you still want to include those events in linked products.\n\nHere are the requirements to export events to advertising platforms:\n\n- Send the request no later than the end of the business day 63 days after\n the latest online event, even if the key event's attribution window is more\n than 63 days.\n\n For example, if the latest online event for the `client_id` or\n `app_instance_id` occurred on March 1, send the Measurement Protocol\n event no later than the end of the business day on May 3.\n- If you override `timestamp_micros`, set it to a timestamp within the last\n three business days.\n\nSend events or user properties for audience creation\n----------------------------------------------------\n\nEvents and user properties sent using Measurement Protocol are included in\nthe evaluation of [audience conditions](//support.google.com/analytics/answer/9267572) if you adhere to a few requirements.\n| **Tip:** This use case doesn't require `session_id`.\n\nHere are the requirements to send events or user properties for audience\ncreation:\n\n- Send the request to a Web stream no later than the end of the business day\n 30 days after the latest online event for the same `client_id`.\n\n For example, if the latest online event for the `client_id` occurred on\n March 1, send the Measurement Protocol event no later than the end of the\n business day on March 31.\n- Send the request to an App stream no later than the end of the business day\n 42 days after the latest online event for the same `app_instance_id`.\n\n For example, if the latest online event for the `app_instance_id` occurred\n on March 1, send the Measurement Protocol event no later than the end of\n the business day on April 12.\n- If you override `timestamp_micros`, set it to a timestamp within the last 3\n business days."]]