mirror of
https://github.com/foomo/sesamy-go.git
synced 2025-10-16 12:35:43 +00:00
fix: don't use tft timestamp
This commit is contained in:
parent
2770d4f32f
commit
fe5b8c9f0f
@ -151,9 +151,16 @@ func (l *Loki) Write(payload mpv2.Payload[any]) {
|
||||
l.l.Warn("buffer size reached", zap.Int("size", l.bufferSize))
|
||||
}
|
||||
|
||||
var timestamp time.Time
|
||||
if payload.TimestampMicros > 0 {
|
||||
timestamp = time.UnixMicro(payload.TimestampMicros)
|
||||
} else {
|
||||
timestamp = time.Now()
|
||||
}
|
||||
|
||||
l.entries <- logproto.Entry{
|
||||
Line: string(lineBytes),
|
||||
Timestamp: time.UnixMicro(payload.TimestampMicros),
|
||||
Timestamp: timestamp,
|
||||
StructuredMetadata: push.LabelsAdapter{
|
||||
{
|
||||
Name: "event_name",
|
||||
|
||||
@ -13,7 +13,7 @@ type SST struct {
|
||||
GCSub *string `json:"gcsub,omitempty" gtag:"gcsub,omitempty"`
|
||||
// Example: DE
|
||||
UC *string `json:"uc,omitempty" gtag:"uc,omitempty"`
|
||||
// Example: 1708250245344
|
||||
// Session start time, time first seen. Example: 1708250245344
|
||||
TFT *string `json:"tft,omitempty" gtag:"tft,omitempty"`
|
||||
// Example: 13l3l3l3l1
|
||||
GCD *string `json:"gcd,omitempty" gtag:"gcd,omitempty"`
|
||||
|
||||
@ -29,9 +29,6 @@ func MPv2(source gtag.Payload, target any) error {
|
||||
"non_personalized_ads": source.NonPersonalizedAds,
|
||||
"debug_mode": source.IsDebug,
|
||||
}
|
||||
if source.SST != nil && source.SST.TFT != nil {
|
||||
targetData["timestamp_micros"] = gtag.Get(source.SST.TFT) + "000"
|
||||
}
|
||||
|
||||
// combine user properties
|
||||
targetUserProperties := map[string]any{}
|
||||
|
||||
@ -3,5 +3,6 @@ package params
|
||||
// PageView https://developers.google.com/analytics/devguides/collection/ga4/views?client_type=gtag#manually_send_page_view_events
|
||||
type PageView struct {
|
||||
PageTitle string `json:"page_title,omitempty"`
|
||||
PageReferrer string `json:"page_referrer,omitempty"`
|
||||
PageLocation string `json:"page_location,omitempty"`
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user