@@ -38,22 +38,40 @@ export interface SelfDescribingEvent {
3838}
3939
4040/**
41- * A Structured Event
42- * A classic style of event tracking, allows for easier movement between analytics
43- * systems. A loosely typed event, creating a Self Describing event is preferred, but
44- * useful for interoperability.
41+ * Event properties that are sent directly, not as part of a self-describing schema.
42+ * These properties will have their own column in the warehouse event table.
4543 */
46- export interface StructuredEvent {
47- /** Name you for the group of objects you want to track e.g. "media", "ecomm". */
48- category : string ;
49- /** Defines the type of user interaction for the web object. */
50- action : string ;
51- /** Identifies the specific object being actioned. */
44+ export interface AtomicProperties {
45+ /** Type of event, e.g. "pp" for page ping. */
46+ eventName ?: string ;
47+ /** Version of the tracker used. */
48+ trackerVersion ?: string ;
49+ /** The browser useragent. */
50+ useragent ?: string ;
51+ /** For page view events. The page URL. */
52+ url ?: string ;
53+ /** For page view events. The page title. */
54+ title ?: string ;
55+ /** For page view events. The referrer URL. */
56+ referrer ?: string ;
57+ /** For structured events. Name for the group of objects you want to track. */
58+ category ?: string ;
59+ /** For structured events. Defines the type of user interaction for the web object. */
60+ action ?: string ;
61+ /** For structured events. Identifies the specific object being actioned. */
5262 label ?: string ;
53- /** Describes the object or the action performed on it. */
63+ /** For structured events. Describes the object or the action performed on it. */
5464 property ?: string ;
55- /** Quantifies or further describes the user action. */
65+ /** For structured events. Quantifies or further describes the user action. */
5666 value ?: number ;
67+ /** For page ping events. The minimum X offset. */
68+ minXOffset ?: number ;
69+ /** For page ping events. The maximum X offset. */
70+ maxXOffset ?: number ;
71+ /** For page ping events. The minimum Y offset. */
72+ maxYOffset ?: number ;
73+ /** For page ping events. The maximum Y offset. */
74+ minYOffset ?: number ;
5775}
5876
5977/**
@@ -91,68 +109,30 @@ interface FullPageViewEvent extends PageViewEvent {
91109 referrer ?: string ;
92110}
93111
94- /** Additional data points to set when tracking an event */
95- export interface CommonEventProperties {
96- /** Add context to an event by setting an Array of Self Describing JSON */
97- context ?: Array < SelfDescribingJson > | null ;
98- }
99-
100112/**
101- * Event properties that are sent directly, not as part of a self-describing schema.
102- * These properties will have their own column in the warehouse event table.
113+ * A Structured Event
114+ * A classic style of event tracking, allows for easier movement between analytics
115+ * systems. A loosely typed event, creating a Self Describing event is preferred, but
116+ * useful for interoperability.
103117 */
104- export interface AtomicProperties {
105- /** Type of event, e.g. "pp" for page ping. */
106- eventName ?: string ;
107- /** Version of the tracker used. */
108- trackerVersion ?: string ;
109- /** The browser useragent. */
110- useragent ?: string ;
111- /** For page view events. The page URL. */
112- url ?: string ;
113- /** For page view events. The page title. */
114- title ?: string ;
115- /** For page view events. The referrer URL. */
116- referrer ?: string ;
117- /** For structured events. Name for the group of objects you want to track. */
118- category ?: string ;
119- /** For structured events. Defines the type of user interaction for the web object. */
120- action ?: string ;
121- /** For structured events. Identifies the specific object being actioned. */
118+ export interface StructuredEvent {
119+ /** Name you for the group of objects you want to track e.g. "media", "ecomm". */
120+ category : string ;
121+ /** Defines the type of user interaction for the web object. */
122+ action : string ;
123+ /** Identifies the specific object being actioned. */
122124 label ?: string ;
123- /** For structured events. Describes the object or the action performed on it. */
125+ /** Describes the object or the action performed on it. */
124126 property ?: string ;
125- /** For structured events. Quantifies or further describes the user action. */
127+ /** Quantifies or further describes the user action. */
126128 value ?: number ;
127- /** For page ping events. The minimum X offset. */
128- minXOffset ?: number ;
129- /** For page ping events. The maximum X offset. */
130- maxXOffset ?: number ;
131- /** For page ping events. The minimum Y offset. */
132- maxYOffset ?: number ;
133- /** For page ping events. The maximum Y offset. */
134- minYOffset ?: number ;
135129}
136130
137- /** Interface for communicating with the Android mobile tracker */
138- export type SnowplowWebInterfaceV2 = {
139- trackWebViewEvent : (
140- atomicProperties : string ,
141- selfDescribingEventData ?: string | null ,
142- context ?: string | null ,
143- trackers ?: Array < string > | null
144- ) => void ;
145- } ;
146-
147- /** Interface for communicating with the iOS mobile tracker */
148- export type WebkitMessageHandlerV2 = {
149- postMessage : ( message : {
150- atomicProperties : string ;
151- selfDescribingEventData ?: string | null ;
152- context ?: string | null ;
153- trackers ?: Array < string > | null ;
154- } ) => void ;
155- } ;
131+ /** Additional data points to set when tracking an event */
132+ export interface CommonEventProperties {
133+ /** Add context to an event by setting an Array of Self Describing JSON */
134+ context ?: Array < SelfDescribingJson > | null ;
135+ }
156136
157137/** Interface for communicating with the Android mobile tracker */
158138export type SnowplowWebInterface = {
@@ -191,6 +171,16 @@ export type SnowplowWebInterface = {
191171 ) => void ;
192172} ;
193173
174+ /** Interface for communicating with the Android mobile tracker from v6.1+ onwards */
175+ export type SnowplowWebInterfaceV2 = {
176+ trackWebViewEvent : (
177+ atomicProperties : string ,
178+ selfDescribingEventData ?: string | null ,
179+ context ?: string | null ,
180+ trackers ?: Array < string > | null
181+ ) => void ;
182+ } ;
183+
194184/** Interface for communicating with the iOS mobile tracker */
195185export type WebkitMessageHandler = {
196186 postMessage : ( message : {
@@ -205,6 +195,16 @@ export type WebkitMessageHandler = {
205195 } ) => void ;
206196} ;
207197
198+ /** Interface for communicating with the iOS mobile tracker from v6.1+ onwards */
199+ export type WebkitMessageHandlerV2 = {
200+ postMessage : ( message : {
201+ atomicProperties : string ;
202+ selfDescribingEventData ?: string | null ;
203+ context ?: string | null ;
204+ trackers ?: Array < string > | null ;
205+ } ) => void ;
206+ } ;
207+
208208/** Interface for communicating with the React Native tracker */
209209export type ReactNativeInterface = {
210210 postMessage : ( message : string ) => void ;
0 commit comments