mirror of
https://github.com/foomo/sesamy-go.git
synced 2025-10-16 12:35:43 +00:00
fix: session id
This commit is contained in:
parent
0c0f3be0a2
commit
f8908a6dd1
@ -61,10 +61,11 @@ func MiddlewarClientID(next ClientHandler) ClientHandler {
|
||||
}
|
||||
}
|
||||
|
||||
func MiddlewarSessionID(measurementID string) ClientMiddleware {
|
||||
func MiddlewarSessionID(trackingID string) ClientMiddleware {
|
||||
trackingID = strings.Split(trackingID, "-")[1]
|
||||
return func(next ClientHandler) ClientHandler {
|
||||
return func(r *http.Request, event *Event) error {
|
||||
if value, _ := r.Cookie("_ga_" + measurementID); value != nil {
|
||||
if value, _ := r.Cookie("_ga_" + trackingID); value != nil {
|
||||
if value := strings.Split(strings.TrimPrefix(value.Value, "GA1.1."), "."); len(value) > 0 {
|
||||
event.SessionID = &value[0]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user