mirror of
https://github.com/foomo/sesamy-go.git
synced 2025-10-16 12:35:43 +00:00
28 lines
649 B
Go
28 lines
649 B
Go
package event
|
|
|
|
import (
|
|
mp "github.com/foomo/sesamy-go/measurementprotocol"
|
|
mpv2 "github.com/foomo/sesamy-go/measurementprotocol/v2"
|
|
)
|
|
|
|
/*
|
|
Login - Send this event to signify that a user has logged in to your website or app.
|
|
|
|
gtag('event', 'login', {
|
|
method: 'Google'
|
|
});
|
|
|
|
Reference: https://developers.google.com/tag-platform/gtagjs/reference/events#login
|
|
*/
|
|
type Login struct {
|
|
Method string
|
|
}
|
|
|
|
func (e *Login) MPv2() *mpv2.Event {
|
|
eventParameter := map[string]string{}
|
|
mp.AddStringMap(eventParameter, mpv2.EventParameterMethod.String(), mp.SetString(e.Method))
|
|
return &mpv2.Event{
|
|
EventParameter: mp.SetStringMap(eventParameter),
|
|
}
|
|
}
|