Skip to content

[amp-analytics] Session analytics in AMP #33990

@micajuine-ho

Description

@micajuine-ho

To support GA4 in AMP (#24621), AMP will create the idea of a sessions per user per domain per vendor.
We will support the following session related information (see below). We can transmit this data via macros (information is in regards to the session) within our analytics requests. Session information should be able to be linked on navigation from Cache to Origin.

Goal is to create these macros in a generic and have them persist for the given session length (and until the next session).

  • Session_id: a low entropy value persisted for 30 minutes per domain per vendor
  • Session Creation Timestamp: a timestamp is seconds since epoch when the current session started
  • Session Count: starts at 1 and is incremented each time a new session starts
  • Engaged: 0 if there has not yet been user engagement and 1 once user engagement is achieved (signaling that this is not a bounced session)
  • last-event-timestamp: a timestamp in seconds since epoch when the most recent event was generated

With this support, GA4 should be able to receive the necessary data from AMP pages regarding user sessions.

Design doc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions