Measurement protocol use cases (original) (raw)

The Google Analytics Measurement Protocol lets you send offline data to your Web or App stream, in addition to the data you're already collecting with tagging or the Firebase SDK.

This guide describes common Google Analytics Measurement Protocol use cases and their requirements.

Summary of requirements

This table provides a quick reference of the requirements for each use case. Keep the following best practices in mind:

  1. The timestamp_micros of events and user properties defaults to the request time. When sending an event or user property change that occurred in the past, override the timestamp as described in the sending events guide and the user properties guide.
  2. For accurate Realtime reports and engagement metrics, include theengagement_time_msec event parameter set to the milliseconds elapsed since the preceding event.
Use case Session ID Request time requirement timestamp_micros requirement
Assign User-ID to events Required <= end of the session start's business day >= session start and <= session end
Session attribution Required <= session start + 24 hours >= session start and <= session end
Export events to advertising platforms Not required <= last session business day + 63 days >= request time minus two business days and <= request time
Send events or user properties for audience creation Not required Web: <= latest online event time + 30 daysApp: <= latest online event time + 42 days >= request time minus two business days and <= request time

Assign User-ID to events

Use the Measurement Protocol to provide online or offline events with aUser-ID.

Here are some example use cases for adding a User-ID to an event:

  1. Your online measurement lacks the information needed to look up the User-ID for online events, but you have an event-processing pipeline that is able to make the association between an online session and a User-ID.
    In this scenario, you are using the Measurement Protocol to provide_online_ events with a User-ID.
  2. You don't have the User-ID for events you are sending with the Measurement Protocol, but you want those events to be associated with a User-ID if the user logged in online over the course of the session.
    In this scenario, you are using online events to provide_Measurement Protocol_ events with a User-ID.

Here are the requirements to add a User-ID to an event:

Session attribution

Measurement Protocol events that meet specific requirements appear in reports with the same session attributes (such as geographic information, source, medium, and campaign) as online events from the same session.

Here are the requirements for session attribution:

Export events to advertising platforms

Google Analytics includes the events you send using Measurement Protocol in exports to linked advertising products such as Google Ads or Campaign Manager 360.

A few common scenarios where this is useful include:

Here are the requirements to export events to advertising platforms:

Send events or user properties for audience creation

Events and user properties sent using Measurement Protocol are included in the evaluation of audience conditions if you adhere to a few requirements.

Here are the requirements to send events or user properties for audience creation: