columns

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package columns provides generic column implementations for session data tracking.

Index

Constants

View Source
const (
	// EventPlatformWeb is a const value for core.d8a.tech/events/platform for events
	// received using web trackers
	EventPlatformWeb = "web"
	// EventPlatformMobile is a const value for core.d8a.tech/events/platform for events
	// received using mobile trackers
	EventPlatformMobile = "mobile"
	// EventPlatformServer is a const value for core.d8a.tech/events/platform for events
	// received using server trackers
	EventPlatformServer = "server"
)
View Source
const (
	// MetadataKeyOriginalPageLocation is the key used to store the original page location
	// (with tracking parameters) in event metadata.
	MetadataKeyOriginalPageLocation = "original_page_location"

	MetadataKeySessionSourceMediumTerm = "session_source_medium_term"
)
View Source
const MaxStringLength = 8096

Sanity check - max writable string length

Variables

View Source
var CoreInterfaces = struct {
	EventID           schema.Interface
	EventName         schema.Interface
	EventPropertyID   schema.Interface
	EventPropertyName schema.Interface
	EventDateUTC      schema.Interface
	EventTimestampUTC schema.Interface
	EventClientID     schema.Interface
	EventUserID       schema.Interface
	EventIPAddress    schema.Interface
	EventPageLocation schema.Interface
	EventPageHostname schema.Interface
	EventPagePath     schema.Interface
	EventPageTitle    schema.Interface
	EventPageReferrer schema.Interface
	EventPlatform     schema.Interface

	// Event UTM parameters
	EventUtmCampaign        schema.Interface
	EventUtmSource          schema.Interface
	EventUtmMedium          schema.Interface
	EventUtmContent         schema.Interface
	EventUtmTerm            schema.Interface
	EventUtmID              schema.Interface
	EventUtmSourcePlatform  schema.Interface
	EventUtmCreativeFormat  schema.Interface
	EventUtmMarketingTactic schema.Interface

	// Click ids
	EventClickIDGclid   schema.Interface
	EventClickIDDclid   schema.Interface
	EventClickIDGbraid  schema.Interface
	EventClickIDSrsltid schema.Interface
	EventClickIDWbraid  schema.Interface
	EventClickIDFbclid  schema.Interface
	EventClickIDMsclkid schema.Interface

	// Geo
	GeoCity         schema.Interface
	GeoRegion       schema.Interface
	GeoMetro        schema.Interface
	GeoCountry      schema.Interface
	GeoContinent    schema.Interface
	GeoSubContinent schema.Interface

	// Device
	DeviceCategory               schema.Interface
	DeviceLanguage               schema.Interface
	DeviceMobileBrandName        schema.Interface
	DeviceMobileModelName        schema.Interface
	DeviceOperatingSystem        schema.Interface
	DeviceOperatingSystemVersion schema.Interface
	DeviceWebBrowser             schema.Interface
	DeviceWebBrowserVersion      schema.Interface

	EventTrackingProtocol schema.Interface

	// Session-scoped event columns
	SSEIsEntry           schema.Interface
	SSESessionHitNumber  schema.Interface
	SSESessionPageNumber schema.Interface
	SSETimeOnPage        schema.Interface
	SSEIsEntryPage       schema.Interface
	SSEIsExitPage        schema.Interface

	// Session columns
	SessionID schema.Interface

	SessionSource schema.Interface
	SessionMedium schema.Interface
	SessionTerm   schema.Interface

	SessionReferrer       schema.Interface
	SessionDuration       schema.Interface
	SessionTotalEvents    schema.Interface
	SessionFirstEventTime schema.Interface
	SessionLastEventTime  schema.Interface

	SessionEntryPageLocation  schema.Interface
	SessionSecondPageLocation schema.Interface
	SessionExitPageLocation   schema.Interface
	SessionEntryPageTitle     schema.Interface
	SessionSecondPageTitle    schema.Interface
	SessionExitPageTitle      schema.Interface

	// Session UTM parameters
	SessionUtmCampaign        schema.Interface
	SessionUtmSource          schema.Interface
	SessionUtmMedium          schema.Interface
	SessionUtmContent         schema.Interface
	SessionUtmTerm            schema.Interface
	SessionUtmID              schema.Interface
	SessionUtmSourcePlatform  schema.Interface
	SessionUtmCreativeFormat  schema.Interface
	SessionUtmMarketingTactic schema.Interface

	// Session Click IDs
	SessionClickIDGclid   schema.Interface
	SessionClickIDDclid   schema.Interface
	SessionClickIDGbraid  schema.Interface
	SessionClickIDSrsltid schema.Interface
	SessionClickIDWbraid  schema.Interface
	SessionClickIDFbclid  schema.Interface
	SessionClickIDMsclkid schema.Interface

	// Totals
	SessionTotalPageViews         schema.Interface
	SessionUniquePageViews        schema.Interface
	SessionTotalPurchases         schema.Interface
	SessionTotalScrolls           schema.Interface
	SessionTotalOutboundClicks    schema.Interface
	SessionUniqueOutboundClicks   schema.Interface
	SessionTotalSiteSearches      schema.Interface
	SessionUniqueSiteSearches     schema.Interface
	SessionTotalFormInteractions  schema.Interface
	SessionUniqueFormInteractions schema.Interface
	SessionTotalVideoEngagements  schema.Interface
	SessionTotalFileDownloads     schema.Interface
	SessionUniqueFileDownloads    schema.Interface

	SessionSplitCause schema.Interface
}{
	EventID: schema.Interface{
		ID:      "core.d8a.tech/events/id",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "id", Type: arrow.BinaryTypes.String},
	},
	EventName: schema.Interface{
		ID:      "core.d8a.tech/events/name",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "name", Type: arrow.BinaryTypes.String},
	},
	EventPropertyID: schema.Interface{
		ID:      "core.d8a.tech/events/property_id",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "property_id", Type: arrow.BinaryTypes.String},
	},
	EventPropertyName: schema.Interface{
		ID:      "core.d8a.tech/events/property_name",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "property_name", Type: arrow.BinaryTypes.String},
	},
	EventDateUTC: schema.Interface{
		ID:      "core.d8a.tech/events/date_utc",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "date_utc", Type: arrow.FixedWidthTypes.Date32},
	},
	EventTimestampUTC: schema.Interface{
		ID:      "core.d8a.tech/events/timestamp_utc",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "timestamp_utc", Type: arrow.FixedWidthTypes.Timestamp_s},
	},
	EventClientID: schema.Interface{
		ID:      "core.d8a.tech/events/client_id",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "client_id", Type: arrow.BinaryTypes.String},
	},
	EventUserID: schema.Interface{
		ID:      "core.d8a.tech/events/user_id",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "user_id", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventIPAddress: schema.Interface{
		ID:      "core.d8a.tech/events/ip_address",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "ip_address", Type: arrow.BinaryTypes.String},
	},
	EventPageLocation: schema.Interface{
		ID:      "core.d8a.tech/events/page_location",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "page_location", Type: arrow.BinaryTypes.String},
	},
	EventPageHostname: schema.Interface{
		ID:      "core.d8a.tech/events/page_hostname",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "page_hostname", Type: arrow.BinaryTypes.String},
	},
	EventPagePath: schema.Interface{
		ID:      "core.d8a.tech/events/page_path",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "page_path", Type: arrow.BinaryTypes.String},
	},
	EventPageTitle: schema.Interface{
		ID:      "core.d8a.tech/events/page_title",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "page_title", Type: arrow.BinaryTypes.String},
	},
	EventPageReferrer: schema.Interface{
		ID:      "core.d8a.tech/events/page_referrer",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "page_referrer", Type: arrow.BinaryTypes.String},
	},
	EventPlatform: schema.Interface{
		ID:      "core.d8a.tech/events/platform",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "platform", Type: arrow.BinaryTypes.String},
	},
	EventUtmCampaign: schema.Interface{
		ID:      "core.d8a.tech/events/utm_campaign",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "utm_campaign", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventUtmSource: schema.Interface{
		ID:      "core.d8a.tech/events/utm_source",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "utm_source", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventUtmMedium: schema.Interface{
		ID:      "core.d8a.tech/events/utm_medium",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "utm_medium", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventUtmContent: schema.Interface{
		ID:      "core.d8a.tech/events/utm_content",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "utm_content", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventUtmTerm: schema.Interface{
		ID:      "core.d8a.tech/events/utm_term",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "utm_term", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventUtmID: schema.Interface{
		ID:      "core.d8a.tech/events/utm_id",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "utm_id", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventUtmSourcePlatform: schema.Interface{
		ID:      "core.d8a.tech/events/utm_source_platform",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "utm_source_platform", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventUtmCreativeFormat: schema.Interface{
		ID:      "core.d8a.tech/events/utm_creative_format",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "utm_creative_format", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventUtmMarketingTactic: schema.Interface{
		ID:      "core.d8a.tech/events/utm_marketing_tactic",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "utm_marketing_tactic", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventClickIDGclid: schema.Interface{
		ID:      "core.d8a.tech/events/click_id_gclid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "click_id_gclid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventClickIDDclid: schema.Interface{
		ID:      "core.d8a.tech/events/click_id_dclid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "click_id_dclid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventClickIDGbraid: schema.Interface{
		ID:      "core.d8a.tech/events/click_id_gbraid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "click_id_gbraid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventClickIDSrsltid: schema.Interface{
		ID:      "core.d8a.tech/events/click_id_srsltid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "click_id_srsltid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventClickIDWbraid: schema.Interface{
		ID:      "core.d8a.tech/events/click_id_wbraid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "click_id_wbraid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventClickIDFbclid: schema.Interface{
		ID:      "core.d8a.tech/events/click_id_fbclid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "click_id_fbclid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventClickIDMsclkid: schema.Interface{
		ID:      "core.d8a.tech/events/click_id_msclkid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "click_id_msclkid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	GeoCity: schema.Interface{
		ID:      "core.d8a.tech/events/geo_city",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "geo_city", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	GeoRegion: schema.Interface{
		ID:      "core.d8a.tech/events/geo_region",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "geo_region", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	GeoMetro: schema.Interface{
		ID:      "core.d8a.tech/events/geo_metro",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "geo_metro", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	GeoCountry: schema.Interface{
		ID:      "core.d8a.tech/events/geo_country",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "geo_country", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	GeoContinent: schema.Interface{
		ID:      "core.d8a.tech/events/geo_continent",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "geo_continent", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	GeoSubContinent: schema.Interface{
		ID:      "core.d8a.tech/events/geo_sub_continent",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "geo_sub_continent", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	DeviceCategory: schema.Interface{
		ID:      "core.d8a.tech/events/device_category",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "device_category", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	DeviceLanguage: schema.Interface{
		ID:      "core.d8a.tech/events/device_language",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "device_language", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	DeviceMobileBrandName: schema.Interface{
		ID:      "core.d8a.tech/events/device_mobile_brand_name",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "device_mobile_brand_name", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	DeviceMobileModelName: schema.Interface{
		ID:      "core.d8a.tech/events/device_mobile_model_name",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "device_mobile_model_name", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	DeviceOperatingSystem: schema.Interface{
		ID:      "core.d8a.tech/events/device_operating_system",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "device_operating_system", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	DeviceOperatingSystemVersion: schema.Interface{
		ID:      "core.d8a.tech/events/device_operating_system_version",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "device_operating_system_version", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	DeviceWebBrowser: schema.Interface{
		ID:      "core.d8a.tech/events/device_web_browser",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "device_web_browser", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	DeviceWebBrowserVersion: schema.Interface{
		ID:      "core.d8a.tech/events/device_web_browser_version",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "device_web_browser_version", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	EventTrackingProtocol: schema.Interface{
		ID:      "core.d8a.tech/events/tracking_protocol",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "tracking_protocol", Type: arrow.BinaryTypes.String},
	},
	SSEIsEntry: schema.Interface{
		ID:      "core.d8a.tech/events/session_is_entry",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_is_entry", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SSESessionHitNumber: schema.Interface{
		ID:      "core.d8a.tech/events/session_hit_number",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_hit_number", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SSESessionPageNumber: schema.Interface{
		ID:      "core.d8a.tech/events/session_page_number",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_page_number", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SSETimeOnPage: schema.Interface{
		ID:      "core.d8a.tech/events/time_on_page",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "time_on_page", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SSEIsEntryPage: schema.Interface{
		ID:      "core.d8a.tech/events/session_is_entry_page",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_is_entry_page", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SSEIsExitPage: schema.Interface{
		ID:      "core.d8a.tech/events/session_is_exit_page",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_is_exit_page", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},

	SessionID: schema.Interface{
		ID:      "core.d8a.tech/sessions/id",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_id", Type: arrow.BinaryTypes.String},
	},
	SessionSource: schema.Interface{
		ID:      "core.d8a.tech/sessions/source",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_source", Type: arrow.BinaryTypes.String},
	},
	SessionMedium: schema.Interface{
		ID:      "core.d8a.tech/sessions/medium",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_medium", Type: arrow.BinaryTypes.String},
	},
	SessionTerm: schema.Interface{
		ID:      "core.d8a.tech/sessions/term",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_term", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionReferrer: schema.Interface{
		ID:      "core.d8a.tech/sessions/referrer",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_referrer", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionDuration: schema.Interface{
		ID:      "core.d8a.tech/sessions/duration",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_duration", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionTotalEvents: schema.Interface{
		ID:      "core.d8a.tech/sessions/total_events",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_total_events", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionFirstEventTime: schema.Interface{
		ID:      "core.d8a.tech/sessions/first_event_time",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_first_event_time", Type: arrow.FixedWidthTypes.Timestamp_s, Nullable: true},
	},
	SessionLastEventTime: schema.Interface{
		ID:      "core.d8a.tech/sessions/last_event_time",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_last_event_time", Type: arrow.FixedWidthTypes.Timestamp_s, Nullable: true},
	},
	SessionEntryPageLocation: schema.Interface{
		ID:      "core.d8a.tech/sessions/entry_page_location",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_entry_page_location", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionSecondPageLocation: schema.Interface{
		ID:      "core.d8a.tech/sessions/second_page_location",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_second_page_location", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionExitPageLocation: schema.Interface{
		ID:      "core.d8a.tech/sessions/exit_page_location",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_exit_page_location", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionEntryPageTitle: schema.Interface{
		ID:      "core.d8a.tech/sessions/entry_page_title",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_entry_page_title", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionSecondPageTitle: schema.Interface{
		ID:      "core.d8a.tech/sessions/second_page_title",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_second_page_title", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionExitPageTitle: schema.Interface{
		ID:      "core.d8a.tech/sessions/exit_page_title",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_exit_page_title", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionUtmCampaign: schema.Interface{
		ID:      "core.d8a.tech/sessions/utm_campaign",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_utm_campaign", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionUtmSource: schema.Interface{
		ID:      "core.d8a.tech/sessions/utm_source",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_utm_source", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionUtmMedium: schema.Interface{
		ID:      "core.d8a.tech/sessions/utm_medium",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_utm_medium", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionUtmContent: schema.Interface{
		ID:      "core.d8a.tech/sessions/utm_content",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_utm_content", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionUtmTerm: schema.Interface{
		ID:      "core.d8a.tech/sessions/utm_term",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_utm_term", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionUtmID: schema.Interface{
		ID:      "core.d8a.tech/sessions/utm_id",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_utm_id", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionUtmSourcePlatform: schema.Interface{
		ID:      "core.d8a.tech/sessions/utm_source_platform",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_utm_source_platform", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionUtmCreativeFormat: schema.Interface{
		ID:      "core.d8a.tech/sessions/utm_creative_format",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_utm_creative_format", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionUtmMarketingTactic: schema.Interface{
		ID:      "core.d8a.tech/sessions/utm_marketing_tactic",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_utm_marketing_tactic", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionClickIDGclid: schema.Interface{
		ID:      "core.d8a.tech/sessions/click_id_gclid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_click_id_gclid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionClickIDDclid: schema.Interface{
		ID:      "core.d8a.tech/sessions/click_id_dclid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_click_id_dclid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionClickIDGbraid: schema.Interface{
		ID:      "core.d8a.tech/sessions/click_id_gbraid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_click_id_gbraid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionClickIDSrsltid: schema.Interface{
		ID:      "core.d8a.tech/sessions/click_id_srsltid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_click_id_srsltid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionClickIDWbraid: schema.Interface{
		ID:      "core.d8a.tech/sessions/click_id_wbraid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_click_id_wbraid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionClickIDFbclid: schema.Interface{
		ID:      "core.d8a.tech/sessions/click_id_fbclid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_click_id_fbclid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionClickIDMsclkid: schema.Interface{
		ID:      "core.d8a.tech/sessions/click_id_msclkid",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_click_id_msclkid", Type: arrow.BinaryTypes.String, Nullable: true},
	},
	SessionTotalPageViews: schema.Interface{
		ID:      "core.d8a.tech/sessions/total_page_views",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_total_page_views", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionUniquePageViews: schema.Interface{
		ID:      "core.d8a.tech/sessions/unique_page_views",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_unique_page_views", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionTotalPurchases: schema.Interface{
		ID:      "core.d8a.tech/sessions/total_purchases",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_total_purchases", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionTotalScrolls: schema.Interface{
		ID:      "core.d8a.tech/sessions/total_scrolls",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_total_scrolls", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionTotalOutboundClicks: schema.Interface{
		ID:      "core.d8a.tech/sessions/total_outbound_clicks",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_total_outbound_clicks", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionUniqueOutboundClicks: schema.Interface{
		ID:      "core.d8a.tech/sessions/unique_outbound_clicks",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_unique_outbound_clicks", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionTotalSiteSearches: schema.Interface{
		ID:      "core.d8a.tech/sessions/total_site_searches",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_total_site_searches", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionUniqueSiteSearches: schema.Interface{
		ID:      "core.d8a.tech/sessions/unique_site_searches",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_unique_site_searches", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionTotalFormInteractions: schema.Interface{
		ID:      "core.d8a.tech/sessions/total_form_interactions",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_total_form_interactions", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionUniqueFormInteractions: schema.Interface{
		ID:      "core.d8a.tech/sessions/unique_form_interactions",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_unique_form_interactions", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionTotalVideoEngagements: schema.Interface{
		ID:      "core.d8a.tech/sessions/total_video_engagements",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_total_video_engagements", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionTotalFileDownloads: schema.Interface{
		ID:      "core.d8a.tech/sessions/total_file_downloads",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_total_file_downloads", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionUniqueFileDownloads: schema.Interface{
		ID:      "core.d8a.tech/sessions/unique_file_downloads",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_unique_file_downloads", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
	},
	SessionSplitCause: schema.Interface{
		ID:      "core.d8a.tech/sessions/split_cause",
		Version: "1.0.0",
		Field:   &arrow.Field{Name: "session_split_cause", Type: arrow.BinaryTypes.String, Nullable: true},
	},
}

CoreInterfaces are the core columns that are always present in the schema.

Functions

func AlwaysNilEventColumn added in v0.6.0

func AlwaysNilEventColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	options ...EventColumnOptions,
) schema.EventColumn

AlwaysNilEventColumn creates a new event column that always returns nil

func CastToBool

func CastToBool(_ schema.InterfaceID) func(any) (any, error)

CastToBool casts a value to bool considering various truthy representations

func CastToFloat64OrNil

func CastToFloat64OrNil(columnID schema.InterfaceID) func(any) (any, error)

CastToFloat64OrNil casts a value to float64 or returns nil if conversion fails or value is empty

func CastToInt64OrNil

func CastToInt64OrNil(columnID schema.InterfaceID) func(any) (any, error)

CastToInt64OrNil casts a value to int64 or returns nil if conversion fails or value is empty

func CastToInt64OrZero

func CastToInt64OrZero(columnID schema.InterfaceID) func(any) (any, error)

CastToInt64OrZero casts a value to int64 or returns 0 if conversion fails or value is empty

func CastToString

func CastToString(i schema.InterfaceID) func(any) (any, error)

CastToString casts a value to string or returns nil if conversion fails

func ExctractFieldValue added in v0.17.0

func ExctractFieldValue(field string) func(*schema.Event) (any, error)

func FromPageURLParamEventColumn added in v0.14.0

func FromPageURLParamEventColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	param string,
	excludeFromPageLocation bool,
	options ...EventColumnOptions,
) schema.EventColumn

FromPageURLParamEventColumn creates a new event column from a URL parameter. If excludeFromPageLocation is true, the parameter will be registered for exclusion from page location URLs.

func FromQueryParamEventColumn

func FromQueryParamEventColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	queryParam string,
	options ...EventColumnOptions,
) schema.EventColumn

FromQueryParamEventColumn creates a new event column from a query param

func FromQueryParamSessionColumn

func FromQueryParamSessionColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	queryParam string,
	options ...SessionColumnOptions,
) schema.SessionColumn

FromQueryParamSessionColumn creates a new session column from a query param

func GetAllCoreColumns

func GetAllCoreColumns() []schema.Interface

GetAllCoreColumns returns a slice of all core column interfaces for easy consumption.

func GetExcludedURLParams added in v0.14.0

func GetExcludedURLParams() map[string]bool

GetExcludedURLParams returns a copy of all excluded URL parameters.

func IsURLParamExcluded added in v0.14.0

func IsURLParamExcluded(param string) bool

IsURLParamExcluded checks if a URL parameter is in the blacklist registry.

func NewFirstLastMatchingEventColumn added in v0.14.0

func NewFirstLastMatchingEventColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	matches EventBoolPredicateFunc,
	isFirst bool,
	options ...SessionScopedEventColumnOptions,
) schema.SessionScopedEventColumn

NewFirstLastMatchingEventColumn creates a session-scoped event column that marks the first or last event matching a predicate with 1, and all other events with 0. This is useful for marking entry/exit pages, where only the first/last page_view in a session should be marked.

func NewSimpleEventColumn

func NewSimpleEventColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	getValue func(*schema.Event) (any, error),
	options ...EventColumnOptions,
) schema.EventColumn

NewSimpleEventColumn creates a new simple event column with the given configuration

func NewSimpleSessionColumn

func NewSimpleSessionColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	getValue func(*schema.Session) (any, error),
	options ...SessionColumnOptions,
) schema.SessionColumn

NewSimpleSessionColumn creates a new simple session column with the given configuration

func NewSimpleSessionScopedEventColumn added in v0.2.0

func NewSimpleSessionScopedEventColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	getValue func(*schema.Session, int) (any, error),
	options ...SessionScopedEventColumnOptions,
) schema.SessionScopedEventColumn

NewSimpleSessionScopedEventColumn creates a new session-scoped event column with the given configuration

func NewTimeOnPageColumn added in v0.15.0

func NewTimeOnPageColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	isPageViewEvent EventBoolPredicateFunc,
	options ...SessionScopedEventColumnOptions,
) schema.SessionScopedEventColumn

NewTimeOnPageColumn creates a session-scoped event column that calculates time spent on a page based on the interval between subsequent page view events, or using other events timestamps if no subsequent page view was recorded. The isPageViewEvent function is dependency-injected to allow protocol-specific page view detection.

func NewValueTransitionColumn added in v0.9.0

func NewValueTransitionColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	chainFieldName string,
	advance EventBoolPredicateFunc,
	direction TransitionDirection,
	options ...SessionScopedEventColumnOptions,
) schema.SessionScopedEventColumn

NewValueTransitionColumn creates a session-scoped event column that calculates values by looking to find the closest event where the value differs from the current one. For example, previous_page_url or previous_page_title: if multiple consecutive events have the same page URL/title, it returns the value from the closest previous event that had a different value, not the immediately previous event.

func NilIfError

func NilIfError(i func(any) (any, error)) func(any) (any, error)

NilIfError returns nil if the error is not nil

func NthEventMatchingPredicateValueColumn added in v0.9.0

func NthEventMatchingPredicateValueColumn(
	columnID schema.InterfaceID,
	field *arrow.Field,
	n int,
	extract func(*schema.Event) (any, error),
	matches func(*schema.Event) bool,
	options ...SessionColumnOptions,
) schema.SessionColumn

NthEventMatchingPredicateValueColumn creates a session column that extracts a value from the nth event that matches the given predicate. This allows protocol-specific filtering (e.g., only page view events). Supports negative indices to count from the end (e.g., -1 for last matching event).

func ReadOriginalPageLocation added in v0.14.0

func ReadOriginalPageLocation(event *schema.Event) string

ReadOriginalPageLocation retrieves the original page location from event metadata. Returns empty string if not found.

func RegisterURLParamForExclusion added in v0.14.0

func RegisterURLParamForExclusion(param string)

RegisterURLParamForExclusion adds a URL parameter to the blacklist registry. Parameters in this registry will be stripped from page location URLs.

func StrErrIfEmpty

func StrErrIfEmpty(ifID schema.InterfaceID) func(any) (any, error)

StrErrIfEmpty casts a value to string or returns an error if conversion fails or value is empty

func StrNilIfErrorOrEmpty

func StrNilIfErrorOrEmpty(i func(any) (any, error)) func(any) (any, error)

StrNilIfErrorOrEmpty returns nil if the error is not nil or the value is an empty string

func StripExcludedParams added in v0.14.0

func StripExcludedParams(urlStr string) (cleaned, original string, err error)

StripExcludedParams removes excluded URL parameters from a URL string. Returns the cleaned URL and the original URL.

func TotalEventsOfGivenNameColumn added in v0.10.0

func TotalEventsOfGivenNameColumn(
	columnID schema.InterfaceID,
	field *arrow.Field,
	eventNames []string,
	options ...SessionColumnOptions,
) schema.SessionColumn

TotalEventsOfGivenNameColumn creates a session column that counts the total number of events with the given event names.

func TransitionAdvanceWhenEventNameIs added in v0.9.0

func TransitionAdvanceWhenEventNameIs(targetEventName string) func(event *schema.Event) bool

TransitionAdvanceWhenEventNameIs returns a function that checks if an event has the specified event name.

func URLElementColumn added in v0.2.0

func URLElementColumn(
	id schema.InterfaceID,
	field *arrow.Field,
	getValue func(e *schema.Event, url *url.URL) (any, error),
	options ...EventColumnOptions,
) schema.EventColumn

URLElementColumn creates a new event column from a URL element

func UniqueEventsOfGivenNameColumn added in v0.10.0

func UniqueEventsOfGivenNameColumn(
	columnID schema.InterfaceID,
	field *arrow.Field,
	eventNames []string,
	dependentColumns []*arrow.Field,
	options ...SessionColumnOptions,
) schema.SessionColumn

UniqueEventsOfGivenNameColumn creates a session column that counts the unique number of events. Deduplication strategy: Events are considered unique for unique combinations of event name and dependent column values.

func WriteOriginalPageLocation added in v0.14.0

func WriteOriginalPageLocation(event *schema.Event, originalURL string)

WriteOriginalPageLocation stores the original page location (with tracking parameters) in the event metadata.

Types

type BrokenEventError

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

BrokenEventError is an error that occurs when an event doesn't have

all required information in order to be processed.

func NewBrokenEventError

func NewBrokenEventError(message string) *BrokenEventError

NewBrokenEventError creates a new BrokenEventError.

func (*BrokenEventError) Error

func (e *BrokenEventError) Error() string

type BrokenSessionError

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

BrokenSessionError is an error that occurs when a session is invalid.

func NewBrokenSessionError

func NewBrokenSessionError(message string) *BrokenSessionError

NewBrokenSessionError creates a new InvalidSessionError.

func (*BrokenSessionError) Error

func (e *BrokenSessionError) Error() string

type EventBoolPredicateFunc added in v0.17.0

type EventBoolPredicateFunc func(event *schema.Event) bool

EventBoolPredicateFunc allows setting constraints for TransitionColumns

type EventColumnOptions

type EventColumnOptions func(*simpleEventColumn)

EventColumnOptions configures a simple event column

func WithEventColumnCast

func WithEventColumnCast(castFunc func(any) (any, error)) EventColumnOptions

WithEventColumnCast sets the cast function for an event column

func WithEventColumnDependsOn

func WithEventColumnDependsOn(dependsOn ...schema.DependsOnEntry) EventColumnOptions

WithEventColumnDependsOn sets the dependencies for an event column

func WithEventColumnDocs added in v0.9.0

func WithEventColumnDocs(displayName, description string) EventColumnOptions

WithEventColumnDocs sets the documentation for an event column

func WithEventColumnRequired

func WithEventColumnRequired(required bool) EventColumnOptions

WithEventColumnRequired sets whether an event column is required

type SessionColumnOptions

type SessionColumnOptions func(*simpleSessionColumn)

SessionColumnOptions configures a simple session column

func WithSessionColumnCast

func WithSessionColumnCast(castFunc func(any) (any, error)) SessionColumnOptions

WithSessionColumnCast sets the cast function for a session column

func WithSessionColumnDependsOn

func WithSessionColumnDependsOn(dependsOn ...schema.DependsOnEntry) SessionColumnOptions

WithSessionColumnDependsOn sets the dependencies for a session column

func WithSessionColumnDocs added in v0.9.0

func WithSessionColumnDocs(displayName, description string) SessionColumnOptions

WithSessionColumnDocs sets the documentation for a session column

func WithSessionColumnRequired

func WithSessionColumnRequired(required bool) SessionColumnOptions

WithSessionColumnRequired sets whether a session column is required

type SessionScopedEventColumnOptions added in v0.2.0

type SessionScopedEventColumnOptions func(*simpleSessionScopedEventColumn)

SessionScopedEventColumnOptions configures a simple session-scoped event column

func WithSessionScopedEventColumnCast added in v0.2.0

func WithSessionScopedEventColumnCast(castFunc func(any) (any, error)) SessionScopedEventColumnOptions

WithSessionScopedEventColumnCast sets the cast function for a session-scoped event column

func WithSessionScopedEventColumnDependsOn added in v0.2.0

func WithSessionScopedEventColumnDependsOn(dependsOn ...schema.DependsOnEntry) SessionScopedEventColumnOptions

WithSessionScopedEventColumnDependsOn sets the dependencies for a session-scoped event column

func WithSessionScopedEventColumnDocs added in v0.9.0

func WithSessionScopedEventColumnDocs(displayName, description string) SessionScopedEventColumnOptions

WithSessionScopedEventColumnDocs sets the documentation for a session-scoped event column

func WithSessionScopedEventColumnRequired added in v0.2.0

func WithSessionScopedEventColumnRequired(required bool) SessionScopedEventColumnOptions

WithSessionScopedEventColumnRequired sets whether a session-scoped event column is required

type TransitionDirection added in v0.9.0

type TransitionDirection bool

TransitionDirection specifies the direction of the transition

const (
	// TransitionDirectionForward specifies the forward direction of the transition
	TransitionDirectionForward TransitionDirection = false
	// TransitionDirectionBackward specifies the backward direction of the transition
	TransitionDirectionBackward TransitionDirection = true
)

type TransitionTransformerFunction added in v0.9.0

type TransitionTransformerFunction func([]string)

TransitionTransformerFunction allows transforming the consecutive values chain

Directories

Path Synopsis
nolint
nolint
Package eventcolumns provides column implementations for event data tracking.
Package eventcolumns provides column implementations for event data tracking.
Package sessioncolumns provides column implementations for session data tracking.
Package sessioncolumns provides column implementations for session data tracking.

Jump to

Keyboard shortcuts

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