Documentation
¶
Overview ¶
Package ga4 is a dumb analytics.Sink over the Google Analytics 4 Measurement Protocol. It maps each analytics event to a GA4 event and POSTs one gzipped batch per flush. Apps that need a different mapping can bring their own sink.
GA4 requires a client_id. This package uses the app-supplied identity from analytics.Tracker.Identify (Event.UserID) when present, falling back to the ephemeral session id — it never synthesises a device identifier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
Sink delivers events to GA4 via the Measurement Protocol.
func New ¶
New returns a GA4 analytics.Sink. measurementID is the "G-XXXX" stream id and apiSecret is a Measurement Protocol API secret.