v2

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParameterItem = "pr"
)

Variables

View Source
var (
	RegexProduct = regexp.MustCompile(`pr([1-9]|[1-9][0-9]|1[0-9]{2}|200)`)
)

Functions

func Decode added in v0.1.8

func Decode(input url.Values, output interface{}) error

func DecodeMapValue

func DecodeMapValue(k string, v []string, data Data) (bool, error)

func DecodeObjectValue

func DecodeObjectValue(s string) (map[string]any, error)

DecodeObjectValue e.g. `idSKU_123456` = map["id"]="SKU_123456"

func DecodeRegexValue

func DecodeRegexValue(k string, v []string, r *regexp.Regexp, data Data, key string) (bool, error)

DecodeRegexValue e.g. `pr1=idSKU_123456` = map["pr"][]map["id"]="SKU_123456"

func Encode added in v0.1.8

func Encode(input *Event) (url.Values, io.Reader, error)

func EncodeObjectValue

func EncodeObjectValue(s map[string]any) string

EncodeObjectValue e.g. `idSKU_123456` = map["id"]="SKU_123456"

func EncodeValues added in v0.1.8

func EncodeValues(values url.Values) string

EncodeValues NOTE: `richsstsse` seems to be last parameter in the query to let's ensure it stays that way

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(l *zap.Logger, host, trackingID string, opts ...ClientOption) *Client

func (*Client) HTTPClient

func (c *Client) HTTPClient() *http.Client

func (*Client) Send

func (c *Client) Send(r *http.Request, event Marshler) error

func (*Client) SendEvent added in v0.1.22

func (c *Client) SendEvent(r *http.Request, event *Event) error

func (*Client) SendRawEvent added in v0.1.22

func (c *Client) SendRawEvent(r *http.Request, event *Event) error

type ClientHandler added in v0.1.7

type ClientHandler func(r *http.Request, event *Event) error

func MiddlewarClientID added in v0.1.20

func MiddlewarClientID(next ClientHandler) ClientHandler

func MiddlewarDebug added in v0.1.20

func MiddlewarDebug(next ClientHandler) ClientHandler

func MiddlewarDocument added in v0.1.20

func MiddlewarDocument(next ClientHandler) ClientHandler

func MiddlewareRichsstsse added in v0.1.20

func MiddlewareRichsstsse(next ClientHandler) ClientHandler

type ClientMiddleware added in v0.1.7

type ClientMiddleware func(next ClientHandler) ClientHandler

func MiddlewarIgnoreReferrer added in v0.1.20

func MiddlewarIgnoreReferrer(v string) ClientMiddleware

func MiddlewarProtocolVersion added in v0.1.20

func MiddlewarProtocolVersion(v string) ClientMiddleware

func MiddlewarSessionID added in v0.1.24

func MiddlewarSessionID(measurementID string) ClientMiddleware

func MiddlewareTrackingID added in v0.1.20

func MiddlewareTrackingID(v string) ClientMiddleware

type ClientOption

type ClientOption func(*Client)

func ClientWithCookies added in v0.1.7

func ClientWithCookies(v ...string) ClientOption

func ClientWithHTTPClient

func ClientWithHTTPClient(v *http.Client) ClientOption

func ClientWithMiddlewares added in v0.1.7

func ClientWithMiddlewares(v ...ClientMiddleware) ClientOption

func ClientWithPath added in v0.1.22

func ClientWithPath(v string) ClientOption

type Data

type Data map[string]any

type Event

type Event struct {

	// Defines que current protocol version being used.
	// Example: 2
	ProtocolVersion *string `json:"v,omitempty" mapstructure:"v,omitempty"`
	// Current Stream ID / Measurement ID
	// Example: G-THYNGSTER
	TrackingID *string `json:"tid,omitempty" mapstructure:"tid,omitempty"`
	// If the current hit is coming was generated from GTM, it will contain a hash of current GTM/GTAG config
	// Example: 2oear0
	GTMHashInfo *string `json:"gtm,omitempty" mapstructure:"gtm,omitempty"`
	// Is a random hash generated on the page load.
	// Examole: 456193680
	RandomPageLoadHash *string `json:"_p,omitempty" mapstructure:"_p,omitempty"`
	// Browser screen resolution in format width x height
	// Example: 2560x1440
	ScreenResolution *string `json:"sr,omitempty" mapstructure:"sr,omitempty"`
	// Browser active locale.
	// Example: es-es
	UserLanguage *string `json:"ul,omitempty" mapstructure:"ul,omitempty"`
	// Current Document Hostname
	// Exampple: www.analytics-debugger.com
	DocumentHostname *string `json:"dh,omitempty" mapstructure:"dh,omitempty"`
	// Google Analytics Client Id
	// Example: 281344611.1635634925
	ClientID *string `json:"cid,omitempty" mapstructure:"cid,omitempty"`
	// Current hits counter for the current page load
	// Example: 1
	HitCounter *string `json:"_s,omitempty" mapstructure:"_s,omitempty"`
	// This is supposed to be to enrich the GA4 hits to send data to SGTM, at this point is always set as an empty value...
	Richsstsse *string `json:"richsstsse,omitempty" mapstructure:"richsstsse,omitempty"`

	// Example: x86
	UserAgentArchitecture *string `json:"uaa,omitempty" mapstructure:"uaa,omitempty"`
	// The "bitness" of the user-agent's underlying CPU architecture. This is the size in bits of an integer or memory address—typically 64 or 32 bits.
	// Example: 32 | 64
	UserAgentBitness *string `json:"uab,omitempty" mapstructure:"uab,omitempty"`
	// The brand and full version information for each brand associated with the browser, in a comma-separated list
	// Example: Google Chrome;105.0.5195.127|Not)A;Brand;8.0.0.0|Chromium;105.0.5195.127
	UserAgentFullVersionList *string `json:"uafvl,omitempty" mapstructure:"uafvl,omitempty"`
	// Indicates whether the browser is on a mobile device
	// Example: 1
	UserAgentMobile *string `json:"uamb,omitempty" mapstructure:"uamb,omitempty"`
	// The device model on which the browser is running. Will likely be empty for desktop browsers
	// Example: Nexus 6
	UserAgentModel *string `json:"uam,omitempty" mapstructure:"uam,omitempty"`
	// The platform or operating system on which the user agent is running
	// Example: Chromium OS | macOS | Android | iOS
	UserAgentPlatform *string `json:"uap,omitempty" mapstructure:"uap,omitempty"`
	// The version of the operating system on which the user agent is running
	// Example: 14.0.0
	UserAgentPlatformVersion *string `json:"uapv,omitempty" mapstructure:"uapv,omitempty"`
	// Whatever Windows On Windows 64 Bit is supported. Used by "WoW64-ness" sites. ( running 32bits app on 64bits windows)
	// Example: 1
	UserAgentWOW64 *string `json:"uaw,omitempty" mapstructure:"uaw,omitempty"`

	// Actual page's Pathname. It does not include the hostname, quertyString or Fragment
	// Example: /hire-me
	DocumentLocation *string `json:"dl,omitempty" mapstructure:"dl,omitempty"`
	// Actual page's Title
	// Example: Hire Me
	DocumentTitle *string `json:"dt,omitempty" mapstructure:"dt,omitempty"`
	// Actual page's Referrer
	// Example:
	DocumentReferrer *string `json:"dr,omitempty" mapstructure:"dr,omitempty"`
	// Unknown. Value ccd.{{HASH}}. The hash in based on various internal parameters. Some kind of usage hash.
	// Example: ccd.AAB
	Z *string `json:"_z,omitempty" mapstructure:"_z,omitempty"`
	// This is added when an event is generated from rules (from the admin). Actually is hash of the "GA4_EVENT" string
	// Example: Q
	EventUsage *string `json:"_eu,omitempty" mapstructure:"_eu,omitempty"`
	// Unknown
	// Example:
	EventDebugID *string `json:"edid,omitempty" mapstructure:"edid,omitempty"`
	// If an event contains this parameters it won't be processed and it will show on on the debug View in GA4
	// Example: 1
	IsDebug *string `json:"_dbg,omitempty" mapstructure:"_dbg,omitempty"`
	// If the current request has a referrer, it will be ignored at processing level
	// Example: 1
	IgnoreReferrer *string `json:"ir,omitempty" mapstructure:"ir,omitempty"`
	// Traffic Type
	// Example: 1
	TrafficType *string `json:"tt,omitempty" mapstructure:"tt,omitempty"`
	// Current Google Consent Status. Format 'G1'+'AdsStorageBoolStatus'`+'AnalyticsStorageBoolStatus'
	// Example:  G101
	GoogleConsentStatus *string `json:"gcs,omitempty" mapstructure:"gcs,omitempty"`
	// Will be added with the value "1" if the Google Consent has just been updated (wait_for_update setting on GTAG)
	// Example: 1
	GoogleConsentUpdate *string `json:"gcu,omitempty" mapstructure:"gcu,omitempty"`
	// Documented values, 1 or 2, no more info on the meaning
	// Example: 2
	GoogleConsentUpdateType *string `json:"gcut,omitempty" mapstructure:"gcut,omitempty"`
	// Will be added with the value "1" if the Google Consent had a default value before getting an update
	// Example: G111
	GoogleConsentDefault *string `json:"gcd,omitempty" mapstructure:"gcd,omitempty"`
	// Will be set to 1 is the current page has a linker and this last one is valid
	// Example: 1
	IsGoogleLinkerValid *string `json:"_glv,omitempty" mapstructure:"_glv,omitempty"`

	// Campaign Medium ( utm_medium ), this will override the current values read from the url
	// Example: cpc
	CampaignMedium *string `json:"cm,omitempty" mapstructure:"cm,omitempty"`
	// Campaign Source ( utm_source ), this will override the current values read from the url
	// Example: google
	CampaignSource *string `json:"cs,omitempty" mapstructure:"cs,omitempty"`
	// Campaign Name ( utm_campaign ), this will override the current values read from the url
	// Example: cpc
	CampaignName *string `json:"cn,omitempty" mapstructure:"cn,omitempty"`
	// Campaign Content ( utm_content ), this will override the current values read from the url
	// Example: big banner
	CampaignContent *string `json:"cc,omitempty" mapstructure:"cc,omitempty"`
	// Campaign Term ( utm_term ), this will override the current values read from the url
	// Example: summer
	CampaignTerm *string `json:"ck,omitempty" mapstructure:"ck,omitempty"`
	// Campaign Creative Format ( utm_creative_format ), this will override the current values read from the url
	// Example: native
	CampaignCreativeFormat *string `json:"ccf,omitempty" mapstructure:"ccf,omitempty"`
	// Campaign Marketing Tactic ( utm_marketing_tactic ), this will override the current values read from the url
	// Example: prospecting
	CampaignMarketingTactic *string `json:"cmt,omitempty" mapstructure:"cmt,omitempty"`
	// Random Number used to Dedupe gclid
	// Example: 342342343
	GclidDeduper *string `json:"_rnd,omitempty" mapstructure:"_rnd,omitempty"`

	// Current Event Name.
	// Example: page_view
	EventName *EventName `json:"en,omitempty" mapstructure:"en,omitempty"`
	// It's the total engagement time in milliseconds since the last event. The engagement time is measured only when the current page is visible and active ( ie: the browser window/tab must be active and visible ), for this GA4 uses the window.events: focus, blur, pageshow, pagehide and the document:visibilitychange, these will determine when the timer starts and pauses
	// Example: 1234
	EngagementTime *string `json:"_et,omitempty" mapstructure:"_et,omitempty"`
	// Defines a parameter for the current Event
	// Example: ep.page_type: checkout
	EventParameter map[string]string `json:"ep,omitempty" mapstructure:"ep,omitempty"`
	// Defines a parameter for the current Event
	// Example: epn.plays_count: 42
	EventParameterNumber map[string]string `json:"epn,omitempty" mapstructure:"epn,omitempty"`
	// If the current event is set as a conversion on the admin interacted the evfent will have this value present
	// Example: 1
	IsConversion *string `json:"_c,omitempty" mapstructure:"_c,omitempty"`
	// External Event
	ExternalEvent *string `json:"_ee,omitempty" mapstructure:"_ee,omitempty"`

	// Current User ID
	// Example: 1635691016
	UserID *string `json:"uid,omitempty" mapstructure:"uid,omitempty"`
	// Current Firebase ID
	// Example: HASHSAH
	FirebaseID *string `json:"_fid,omitempty" mapstructure:"_fid,omitempty"`
	// GA4 Session Id. This comes from the GA4 Cookie. It may be different for each Stream ID Configured on the site
	// Example: 1635691016
	SessionID *string `json:"sid,omitempty" mapstructure:"sid,omitempty"`
	// Count of sessions recorded by GA4. This value increases by one each time a new session is detected ( when the session expires )
	// Example: 10
	SessionCount *string `json:"sct,omitempty" mapstructure:"sct,omitempty"`
	// If the current user is engaged in any way, this value will be 1
	// Example:
	SessionEngagment *string `json:"seg,omitempty" mapstructure:"seg,omitempty"`
	// Defines an user Propery for the current Measurement ID
	// Example: up.is_premium_user: yes
	UserProperty map[string]string `json:"up,omitempty" mapstructure:"up,omitempty"`
	// Defines an user Propery for the current Measurement ID
	// Example:
	UserPropertyNumber map[string]string `json:"upn,omitempty" mapstructure:"upn,omitempty"`
	// If the "_ga_THYNGSTER" cookie is not set, the first event will have this value present. This will internally create a new "first_visit" event on GA4. If this event is also a conversion the value will be "2" if not, will be "1"
	// Example: 1|2
	FirstVisit *string `json:"_fv,omitempty" mapstructure:"_fv,omitempty"`
	// If the "_ga_THYNGSTER" cookie last session time value is older than 1800 seconds, the current event will have this value present. This will internally create a new "session_start" event on GA4. If this event is also a conversion the value will be "2" if not, will be "1"
	// Example: 1|2
	SessionStart *string `json:"_ss,omitempty" mapstructure:"_ss,omitempty"`
	// This seems to be related to the ServerSide hits, it's 0 if the FPLC Cookie is not present and to the current value if it's coming from a Cross Domain linker
	// Example: bVhVicbfiSXaGNxeawKaPlDQc9QXPD6bKcsn36Elden6wZNb7Q5X1iXlkTVP5iP3H3y76cgM3UIgHCaRsYfPoyLGlbiIYMPRjvnUU7KWbdWLagodzxjrlPnvaRZJkw
	FirstPartyLinkerCookie *string `json:"_fplc,omitempty" mapstructure:"_fplc,omitempty"`
	// If the current user has a GA4 session cookie, but not a GA (_ga) client id cookie, this parameter will be added to the hit
	// Example: 1
	NewSessionID *string `json:"_nsi,omitempty" mapstructure:"_nsi,omitempty"`
	// You may find this parameter if using some vendor plugin o platform ( ie: using shopify integration or a prestashop plugin )
	// Example: jdhsd87
	GoogleDeveloperID *string `json:"gdid,omitempty" mapstructure:"gdid,omitempty"`
	// Added to report the current country for the user under some circumstanced. To be documented.
	// Example: ES
	UserCountry *string `json:"_uc,omitempty" mapstructure:"_uc,omitempty"`
	// Example: DE-BY
	UserRegion *string `json:"ur,omitempty" mapstructure:"ur,omitempty"`

	// Currency Code. ISO 4217
	// Example: JPY
	Currency *string `json:"cu,omitempty" mapstructure:"cu,omitempty"`
	// Example:
	Items []*Item `json:"pr,omitempty" mapstructure:"pr,omitempty"`
	// Promotion Impression/Click Tracking. Promotion Id
	// Example: summer-offer
	PromotionID *string `json:"pi,omitempty" mapstructure:"pi,omitempty"`
	// Promotion Impression/Click Tracking. Promotion Name
	// Example: summer-offer
	PromotionName *string `json:"pn,omitempty" mapstructure:"pn,omitempty"`
	// Promotion Impression/Click Tracking. Creative Name
	// Example: red-car
	// CreativeName *string `json:"cn,omitempty" mapstructure:"cn,omitempty"`
	// Promotion Impression/Click Tracking. Promotion Slot / Position
	// Example: slide-3
	// CreativeSlot *string `json:"cs,omitempty" mapstructure:"cs,omitempty"`
	// Google Place ID: Refer to: https://developers.google.com/maps/documentation/places/web-service/place-id . Seems to be inherited from Firebase, not sure about the current use on GA4
	// Example: ChIJiyj437sx3YAR9kUWC8QkLzQ
	LocationID *string `json:"lo,omitempty" mapstructure:"lo,omitempty"`

	// --- Uncategorized / Missing Info ---
	// Example: 1
	GTMUp *string `json:"gtm_up,omitempty" mapstructure:"gtm_up,omitempty"`
	// Documented values, 1,2,3: Not sure when it's added.
	EuropeanConsentModeEnabledID *string `json:"_ecid,omitempty" mapstructure:"_ecid,omitempty"`
	// Example:
	UEI *string `json:"_uei,omitempty" mapstructure:"_uei,omitempty"`
	// It's set when a Google Join is created/imported. Google Signals
	// Example: 1
	CreateGoogleJoin *string `json:"_gaz,omitempty" mapstructure:"_gaz,omitempty"`
	// Example: Redact Device Info. Need Investigation about functionality
	RedactDeviceInfo *string `json:"_rdi,omitempty" mapstructure:"_rdi,omitempty"`
	// Geo Granularity. Need Investigation about functionality
	GeoGranularity *string `json:"_geo,omitempty" mapstructure:"_geo,omitempty"`
	// Sent on sites that implement the US Privacy User Signal Mechanism, sent if window.__uspapi is present and returning a value.
	// Example: 1YNY
	USPrivacySignal *string `json:"us_privacy,omitempty" mapstructure:"us_privacy,omitempty"`
	// Sent on sites that implements IAB GDPR-Transparency-and-Consent-Framework( TCFv2 ) Mechanism. sent if window.__tcfapi is present and returning a valid value.
	// Example: 1
	GDPR *string `json:"gdpr,omitempty" mapstructure:"gdpr,omitempty"`
	// Sent on sites that implements IAB GDPR-Transparency-and-Consent-Framework( TCFv2 ) Mechanism. sent if window.__tcfapi is present and returning a valid value.
	// Example: CPfPdAAPfPdAAAHABBENCgCsAP_AAAAAAAAAI_tf_X__b3_j-_5___t0eY1f9_7__-0zjhfdl-8N3f_X_L8X_2M7vF36tq4KuR4Eu3LBIQdlHOHcTUmw6okVrzPsbk2cr7NKJ7PEmnMbeydYGH9_n1_z-ZKY7_____77__-____3_____-_f___5_3____f_V__97fn9_____9_P___9v__9__________3___gAAAJJQAYAAgj-GgAwABBH8VABgACCP5SADAAEEfx0AGAAII_kIAMAAQR_CQAYAAgj-IgAwABBH8ZABgACCP4A.f_gAAAAAAAAA
	GDPRConsent *string `json:"gdpr_consent,omitempty" mapstructure:"gdpr_consent,omitempty"`
	// Example: sypham
	NonPersonalizedAds *string `json:"npa,omitempty" mapstructure:"npa,omitempty"`
	// Example: 1
	ARE *string `json:"are,omitempty" mapstructure:"are,omitempty"`
	// Example: 1
	DigitalMarketAct *string `json:"dma,omitempty" mapstructure:"dma,omitempty"`
	// Example: sypham
	DigitalMarketActParameters *string `json:"dma_cps,omitempty" mapstructure:"dma_cps,omitempty"`
	// Example: noapi | denied
	PrivacySandboxCookieDeprecationLabel *string `json:"pscdl,omitempty" mapstructure:"pscdl,omitempty"`
	// A timestamp measuring the difference between the moment this parameter gets populated and the moment the navigation started on that particular page.
	TFD *string `json:"tfd,omitempty" mapstructure:"tfd,omitempty"`
	SST *SST    `json:"sst,omitempty" mapstructure:"sst,omitempty"`
	PAE *string `json:"pae,omitempty" mapstructure:"pae,omitempty"`

	Unknown map[string]any `json:"-" mapstructure:",remain"`
}

See https://www.thyngster.com/ga4-measurement-protocol-cheatsheet/

type EventName

type EventName string
const (
	EventNameAddPaymentInfo     EventName = "add_payment_info"
	EventNameAddShippingInfo    EventName = "add_shipping_info"
	EventNameAddToCart          EventName = "add_to_cart"
	EventNameAddToWishlist      EventName = "add_to_wishlit"
	EventNameBeginCheckout      EventName = "begin_checkout"
	EventNameEarnVirtualMoney   EventName = "earn_virtual_money"
	EventNameGenerateLead       EventName = "generate_lead"
	EventNameJoinGroup          EventName = "join_group"
	EventNameLevelEnd           EventName = "level_end"
	EventNameLevelStart         EventName = "level_start"
	EventNameLevelUp            EventName = "level_up"
	EventNameLogin              EventName = "login"
	EventNamePostScore          EventName = "post_score"
	EventNamePurchase           EventName = "purchase"
	EventNameRefund             EventName = "refund"
	EventNameRemoveFromCart     EventName = "remove_from_cart"
	EventNameSearch             EventName = "search"
	EventNameSelectContent      EventName = "select_content"
	EventNameSelectItem         EventName = "select_item"
	EventNameShare              EventName = "share"
	EventNameSignUp             EventName = "sign_up"
	EventNameSpendVirtualMoney  EventName = "spend_virtual_money"
	EventNameTutorialBegin      EventName = "tutorial_begin"
	EventNameTuturialComplete   EventName = "tutorial_complete"
	EventNameUnlockArchievement EventName = "unlock_archievement"
	EventNameViewCart           EventName = "view_cart"
	EventNameViewItem           EventName = "view_item"
	EventNameViewItemList       EventName = "view_item_list"
	EventNameViewPromotion      EventName = "view_promotion"
)

func (EventName) String

func (s EventName) String() string

type EventParameter

type EventParameter string

EventParameter as string See https://support.google.com/analytics/table/13594742?sjid=7861230991468479976-EU

const (
	// EventParameterAppVersion The mobile app's versionName (Android) or short bundle version (iOS) in which an event occurred
	EventParameterAppVersion EventParameter = "app_version"
	// EventParameterCancellationReason The reason a cancellation occurred
	EventParameterCancellationReason EventParameter = "cancellation_reason"
	// EventParameterFirebaseErrorValue Additional details corresponding to the error code reported by the Firebase SDK
	EventParameterFirebaseErrorValue EventParameter = "firebase_error_value"
	// EventParameterFirebaseScreen The current screen’s name, as provided by the developer
	EventParameterFirebaseScreen EventParameter = "firebase_screen"
	// EventParameterFirebaseScreenClass The current screen’s class name
	EventParameterFirebaseScreenClass EventParameter = "firebase_screen_class"
	// EventParameterFirebaseScreenID A random identifier for the current screen
	EventParameterFirebaseScreenID EventParameter = "firebase_screen_id"
	// EventParameterMessageID The Firebase Cloud Messaging or Firebase In-App Messaging message identifier, which is unique per message campaign
	EventParameterMessageID EventParameter = "message_id"
	// EventParameterMessageName The Firebase Cloud Messaging or Firebase In-App Messaging message name
	EventParameterMessageName EventParameter = "message_name"
	// EventParameterMessageType The Firebase Cloud Messaging message notification type
	EventParameterMessageType EventParameter = "message_type"
	// EventParameterPreviousAppVersion For the app_update event, the parameter signifies the previous application version
	EventParameterPreviousAppVersion EventParameter = "previous_app_version"
	// EventParameterPreviousOsVersion For the os_update event, the parameter signifies the previous OS version
	EventParameterPreviousOsVersion EventParameter = "previous_os_version"
	// EventParameterCampaignContent The ad content that was associated with the start of a session
	EventParameterCampaignContent EventParameter = "campaign_content"
	// EventParameterCampaignMedium The method for acquiring users to your website or application
	EventParameterCampaignMedium EventParameter = "campaign_medium"
	// EventParameterCampaignSource A representation of the publisher or inventory source from which traffic originated. For example, users who return to your website from Google Search show as "google" in the Session source dimension
	EventParameterCampaignSource EventParameter = "campaign_source"
	// EventParameterCampaignTerm The term that was associated with the start of a session
	EventParameterCampaignTerm EventParameter = "campaign_term"
	// EventParameterCoupon The coupon name or code associated with an event
	EventParameterCoupon EventParameter = "coupon"
	// EventParameterCurrency The currency used in an event, in 3-letter ISO 4217 format. For example, the currency used in a purchase
	EventParameterCurrency EventParameter = "currency"
	// EventParameterShippingTier The shipping tier selected for delivery of a purchased item
	EventParameterShippingTier EventParameter = "shipping_tier"
	// EventParameterTransactionID The unique identifier of a transaction
	EventParameterTransactionID EventParameter = "transaction_id"
	// EventParameterValue The monetary value of the event
	EventParameterValue EventParameter = "value"
	// EventParameterAffiliation A product affiliation to designate a supplying company or brick and mortar store location
	EventParameterAffiliation EventParameter = "affiliation"
	// EventParameterCreativeName The name of a creative used in a promotion. Example value: summer_banner
	EventParameterCreativeName EventParameter = "creative_name"
	// EventParameterCreativeSlot The name of the promotional creative slot associated with an event. Example value: featured_app_1
	EventParameterCreativeSlot EventParameter = "creative_slot"
	// EventParameterDiscount The value of a discount value associated with a purchased item
	EventParameterDiscount EventParameter = "discount"
	// EventParameterIndex The index of the item in a list
	EventParameterIndex EventParameter = "index"
	// EventParameterItemBrand The brand of an item
	EventParameterItemBrand EventParameter = "item_brand"
	// EventParameterItemCategory The category of an item. If used as part of a category hierarchy or taxonomy, then this is the first category
	EventParameterItemCategory EventParameter = "item_category"
	// EventParameterItemCategory2 The second hierarchical category in which you classified an item
	EventParameterItemCategory2 EventParameter = "item_category2"
	// EventParameterItemCategory3 The third hierarchical category in which you classified an item
	EventParameterItemCategory3 EventParameter = "item_category3"
	// EventParameterItemCategory4 The fourth hierarchical category in which you classified an item
	EventParameterItemCategory4 EventParameter = "item_category4"
	// EventParameterItemCategory5 The fifth hierarchical category in which you classified an item
	EventParameterItemCategory5 EventParameter = "item_category5"
	// EventParameterItemID The ID that you specify for an item
	EventParameterItemID EventParameter = "item_id"
	// EventParameterItemListID The name of the list in which an item was presented to a user
	EventParameterItemListID EventParameter = "item_list_id"
	// EventParameterItemListName The ID of the list in which an item was presented to a user
	EventParameterItemListName EventParameter = "item_list_name"
	// EventParameterItemName The name of the event that contains the parameter group
	EventParameterItemName EventParameter = "item_name"
	// EventParameterItemVariant The item variant or unique code or description (e.g., XS, S, M, L for size; Red, Blue, Green, Black for color) for additional item details or options
	EventParameterItemVariant EventParameter = "item_variant"
	// EventParameterLocationID The physical location associated with the item (e.g. the physical store location)
	EventParameterLocationID EventParameter = "location_id"
	// EventParameterPromotionID The ID of the promotion associated with an event
	EventParameterPromotionID EventParameter = "promotion_id"
	// EventParameterPromotionName The name of the promotion associated with an event
	EventParameterPromotionName EventParameter = "promotion_name"
	// EventParameterAchievementID The ID of an achievement that was unlocked in a game
	EventParameterAchievementID EventParameter = "achievement_id"
	// EventParameterCharacter The name of a character in a game
	EventParameterCharacter EventParameter = "character"
	// EventParameterLevelName The name of the level in a game
	EventParameterLevelName EventParameter = "level_name"
	// EventParameterVirtualCurrencyName The name of a virtual currency
	EventParameterVirtualCurrencyName EventParameter = "virtual_currency_name"
	// EventParameterFileExtension The extension of a file download
	EventParameterFileExtension EventParameter = "file_extension"
	// EventParameterFileName The page path of a file download
	EventParameterFileName EventParameter = "file_name"
	// EventParameterFormDestination The URL to which a form is being submitted
	EventParameterFormDestination EventParameter = "form_destination"
	// EventParameterFormID The HTML id attribution of the <form> DOM element
	EventParameterFormID EventParameter = "form_id"
	// EventParameterFormName The HTML name attribute of the <form> DOM element
	EventParameterFormName EventParameter = "form_name"
	// EventParameterFormSubmitText The text of the submit button, if present
	EventParameterFormSubmitText EventParameter = "form_submit_text"
	// EventParameterGroupID The ID of a group
	EventParameterGroupID EventParameter = "group_id"
	// EventParameterLanguage The language setting of a user’s browser or device, displayed as the ISO 639 language code
	EventParameterLanguage EventParameter = "language"
	// EventParameterPercentScrolled The percentage down the page that the user scrolled
	EventParameterPercentScrolled EventParameter = "percent_scrolled"
	// EventParameterSearchTerm The strings or keywords used in a search
	EventParameterSearchTerm EventParameter = "search_term"
	// EventParameterLinkClasses The HTML class attribute for an outbound link or file download
	EventParameterLinkClasses EventParameter = "link_classes"
	// EventParameterLinkDomain The destination domain of an outbound link or file download
	EventParameterLinkDomain EventParameter = "link_domain"
	// EventParameterLinkID The ID for an outbound link or file download
	EventParameterLinkID EventParameter = "link_id"
	// EventParameterLinkUrl The full URL for an outbound link or file download
	EventParameterLinkUrl EventParameter = "link_url"
	// EventParameterOutbound Indicates whether a click was on an outbound link
	EventParameterOutbound EventParameter = "outbound"
	// EventParameterContentGroup The content group associated with a page or screen
	EventParameterContentGroup EventParameter = "content_group"
	// EventParameterContentID An ID for an article of content that a user interacted with
	EventParameterContentID EventParameter = "content_id"
	// EventParameterContentType The type of content that a user interacted with
	EventParameterContentType EventParameter = "content_type"
	// EventParameterPageLocation The complete URL of the webpage that someone visited on your website
	EventParameterPageLocation EventParameter = "page_location"
	// EventParameterPageReferrer The referring URL, which is the user's previous URL and can be your website's domain or other domains
	EventParameterPageReferrer EventParameter = "page_referrer"
	// EventParameterPageTitle The HTML page title that you set on your website
	EventParameterPageTitle EventParameter = "page_title"
	// EventParameterScreenResolution The resolution of a device, in the format (Width)x(Height)
	EventParameterScreenResolution EventParameter = "screen_resolution"
	// EventParameterAdFormat The format of an advertisement in an app
	EventParameterAdFormat EventParameter = "ad_format"
	// EventParameterAdPlatform The platform used to surface an advertisement in an app
	EventParameterAdPlatform EventParameter = "ad_platform"
	// EventParameterAdSource The source network that served an advertisement
	EventParameterAdSource EventParameter = "ad_source"
	// EventParameterAdUnitID The unique identifier for an ad unit
	EventParameterAdUnitID EventParameter = "ad_unit_id"
	// EventParameterAdUnitName The name you choose for an ad unit
	EventParameterAdUnitName EventParameter = "ad_unit_name"
	// EventParameterVideoProvider The source of an embedded video
	EventParameterVideoProvider EventParameter = "video_provider"
	// EventParameterVideoTitle The title of an embedded video
	EventParameterVideoTitle EventParameter = "video_title"
	// EventParameterVideoUrl The url of an embedded video
	EventParameterVideoUrl EventParameter = "video_url"

	EventParameterMethod      EventParameter = "method"
	EventParameterPaymentType EventParameter = "payment_type"
)

func (EventParameter) String

func (s EventParameter) String() string

type EventParameterNumber

type EventParameterNumber string

EventParameterNumber as number See https://support.google.com/analytics/table/13594742?sjid=7861230991468479976-EU

const (
	EventParameterNumberValue EventParameterNumber = "value"
	// EventParameterNumberFirebaseError The error code reported by the Firebase SDK.
	EventParameterNumberFirebaseError EventParameterNumber = "firebase_error"
	// EventParameterNumberFreeTrial Signifies that an in-app purchase is a free trial
	EventParameterNumberFreeTrial EventParameterNumber = "free_trial"
	// EventParameterNumberMessageDeviceTime The Firebase Cloud Messaging or Firebase In-App Messaging delivery epoch timestamp in UTC.	(None)
	EventParameterNumberMessageDeviceTime EventParameterNumber = "message_device_time"
	// EventParameterNumberMessageTime The Firebase Cloud Messaging message notification epoch timestamp in UTC.	(None)
	EventParameterNumberMessageTime EventParameterNumber = "message_time"
	// EventParameterNumberShipping The shipping cost associated with a transaction
	EventParameterNumberShipping EventParameterNumber = "shipping"
	// EventParameterNumberTax The tax cost associated with a transaction
	EventParameterNumberTax EventParameterNumber = "tax"
)

func (EventParameterNumber) String

func (s EventParameterNumber) String() string

type Item

type Item struct {
	// Example: 12345
	ID *string `json:"id,omitempty" mapstructure:"id,omitempty"`
	// Example: Stan and Friends Tee
	Name *string `json:"nm,omitempty" mapstructure:"nm,omitempty"`
	// Example: Google
	Brand *string `json:"br,omitempty" mapstructure:"br,omitempty"`
	// Example: men
	CategoryHierarchy1 *string `json:"ca,omitempty" mapstructure:"ca,omitempty"`
	// Example: t-shirts
	CategoryHierarchy2 *string `json:"c2,omitempty" mapstructure:"c2,omitempty"`
	// Example: men
	CategoryHierarchy3 *string `json:"c3,omitempty" mapstructure:"c3,omitempty"`
	// Example: men
	CategoryHierarchy4 *string `json:"c4,omitempty" mapstructure:"c4,omitempty"`
	// Example: men
	CategoryHierarchy5 *string `json:"c5,omitempty" mapstructure:"c5,omitempty"`
	// Example: Yellow
	Variant *string `json:"va,omitempty" mapstructure:"va,omitempty"`
	// Example: 123.45
	Price *string `json:"pr,omitempty" mapstructure:"pr,omitempty"`
	// Example: 1
	Quantity *string `json:"qt,omitempty" mapstructure:"qt,omitempty"`
	// Example: 50%OFF
	Coupon *string `json:"cp,omitempty" mapstructure:"cp,omitempty"`
	// Example: cross-selling: mens
	ListName *string `json:"ln,omitempty" mapstructure:"ln,omitempty"`
	// Example: 10
	ListPosition *string `json:"lp,omitempty" mapstructure:"lp,omitempty"`
	// Example: id-mens-123
	ListID *string `json:"li,omitempty" mapstructure:"li,omitempty"`
	// Example: 10.00
	Discount *string `json:"ds,omitempty" mapstructure:"ds,omitempty"`
	// Example: Foo Marketplace
	Affiliation *string `json:"af,omitempty" mapstructure:"af,omitempty"`
	// Example: ChIJIQBpAG2ahYAR_6128GcTUEo
	LocationID *string `json:"lo,omitempty" mapstructure:"lo,omitempty"`
}

*

promotion_id: "pi",
promotion_name: "pn",
creative_name: "cn",
creative_slot: "cs",

type Marshler added in v0.1.8

type Marshler interface {
	MarshalMPv2() (*Event, error)
}

type SST

type SST struct {
	// Example: 1
	ADR *string `json:"adr,omitempty" mapstructure:"adr,omitempty"`
	// Example: 1---
	USPrivacy *string `json:"us_privacy,omitempty" mapstructure:"us_privacy,omitempty"`
	// Example: 542231386.1709295522
	RND *string `json:"rnd,omitempty" mapstructure:"rnd,omitempty"`
	// Example: google.de
	ETLD *string `json:"etld,omitempty" mapstructure:"etld,omitempty"`
	// Example: region1
	GCSub *string `json:"gcsub,omitempty" mapstructure:"gcsub,omitempty"`
	// Example: DE
	UC *string `json:"uc,omitempty" mapstructure:"uc,omitempty"`
	// Example: 1708250245344
	TFT *string `json:"tft,omitempty" mapstructure:"tft,omitempty"`
	// Example: 13l3l3l3l1
	GCD *string `json:"gcd,omitempty" mapstructure:"gcd,omitempty"`
}

type Unmarshler added in v0.1.8

type Unmarshler interface {
	UnmarshalMPv2(*Event) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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