mpv2

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consent string
const (
	ConsentDenied  Consent = "DENIED"
	ConsentGranted Consent = "GRANTED"
)

func ConsentText added in v0.6.0

func ConsentText(v bool) Consent

type ConsentData added in v0.4.0

type ConsentData struct {
	AdStorage              *Consent `json:"ad_storage,omitempty"`
	AdUserData             *Consent `json:"ad_user_data,omitempty"`
	AdPersonalization      *Consent `json:"ad_personalization,omitempty"`
	AnalyticsStorage       *Consent `json:"analytics_storage,omitempty"`
	FunctionalityStorage   *Consent `json:"functionality_storage,omitempty"`
	PersonalizationStorage *Consent `json:"personalization_storage,omitempty"`
	SecurityStorage        *Consent `json:"security_storage,omitempty"`
}

type Payload

type Payload[P any] struct {
	ClientID           string            `json:"client_id,omitempty"`
	UserID             string            `json:"user_id,omitempty"`
	TimestampMicros    int64             `json:"timestamp_micros,omitempty"`
	UserProperties     map[string]any    `json:"user_properties,omitempty"`
	Consent            *ConsentData      `json:"consent,omitempty"`
	Events             []sesamy.Event[P] `json:"events,omitempty"`
	UserData           *UserData         `json:"user_data,omitempty"`
	DebugMode          bool              `json:"debug_mode,omitempty"`
	SessionID          string            `json:"session_id,omitempty"`
	EngagementTimeMSec int64             `json:"engagement_time_msec,omitempty"`
}

https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference?client_type=gtag#payload_post_body

func NewPayload added in v0.6.0

func NewPayload[P any]() *Payload[P]

type SHA256Hash

type SHA256Hash string

func NewSHA256Hash

func NewSHA256Hash(s string) SHA256Hash

func (SHA256Hash) String

func (s SHA256Hash) String() string

type UserData

type UserData struct {
	SHA256EmailAddress []SHA256Hash      `json:"sha256_email_address,omitempty"`
	SHA256PhoneNumber  []SHA256Hash      `json:"sha256_phone_number,omitempty"`
	Address            []UserDataAddress `json:"address,omitempty"`
}

UserData https://developers.google.com/analytics/devguides/collection/ga4/uid-data

type UserDataAddress

type UserDataAddress struct {
	SHA256FirstName SHA256Hash `json:"sha256_first_name,omitempty"`
	SHA256LastName  SHA256Hash `json:"sha256_last_name,omitempty"`
	SHA256Street    SHA256Hash `json:"sha256_street,omitempty"`
	City            string     `json:"city,omitempty"`
	Region          string     `json:"region,omitempty"`
	PostalCode      string     `json:"postal_code,omitempty"`
	Country         string     `json:"country,omitempty"`
}

UserDataAddress https://developers.google.com/analytics/devguides/collection/ga4/uid-data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL