session

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// GA1Regex is a compiled regular expression that matches GA1 cookie patterns with segments capturing numeric values.
	GA1Regex = regexp.MustCompile(`^GA1\.(\d+)\.(\d+)\.(\d+)$`)
	// GS1Regex is a compiled regular expression that matches GS1 cookie patterns with segments capturing numeric values.
	// GS1.<domain_level>.<session_id>.<session_count>.<engagement_session>.<timestamp>.<countdown>.<enhanced_client_id>
	GS1Regex = regexp.MustCompile(`^GS1\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)$`)
	// GS2Regex is a compiled regular expression that matches GS2 cookie patterns with segments capturing numeric values.
	// GS2.<domain_level>.s<session_id>$o<session_count>$g<engagement_session>$t<timestamp>$j<countdown>$l<undefined>$h<enhanced_client_id>
	GS2Regex = regexp.MustCompile(`^GS2\.(\d+)\.s(\d+)\$o(\d+)\$g(\d+)\$t(\d+)\$j(\d+)\$l(\d+)\$h(\d+)$`)
)

see https://www.bbccss.com/explanation-of-cookie-values-used-by-ga4.html/comment-page-1#comment-6684

Functions

func IsGTMDebug

func IsGTMDebug(r *http.Request) bool

func IsGTMPreview

func IsGTMPreview(r *http.Request) bool

func ParseGAClientID

func ParseGAClientID(r *http.Request) (string, error)

func ParseGASessionID

func ParseGASessionID(r *http.Request, id string) (string, error)

func ParseGASessionNumber added in v0.8.0

func ParseGASessionNumber(r *http.Request, id string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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