Module | Services | Data types | Constants |
---|---|---|---|
nativeapp | App ConsentData ConsentValue Device Edition Event EventType NativeAppSubmission ScrollDepth |
VIEW | 0 |
When a user views a 'page'. |
AD_LOAD | 1 |
An ad has been loaded |
PERFORMANCE | 2 |
The event contains performance benchmark data. |
NETWORK | 3 |
The event contains profiling data for network based operations. |
INTERACTION | 4 |
The event contains information about an in-page interaction |
AB_TEST | 5 |
The event contains information about the AB tests. |
COMPONENT_EVENT | 6 |
The event contains information about components. |
ACQUISITION | 7 |
The event contains information about acquisitions. |
IN_PAGE_CLICK | 8 |
The event contains information about an in-page click |
CONSENT | 9 |
The event contains a user’s consent. |
A specific version of the app exists for each edition in the content api. For example, US visitors get the US version of our app.
UK | 0 | |
US | 1 | |
AU | 2 | |
International | 3 | |
Europe | 4 |
Key | Field | Type | Description | Requiredness | Default value |
---|---|---|---|---|---|
1 | maxExtent | i32 | The maximum percentage of the page seen by the user | required | |
2 | numberOfContainers | i32 | Total number of containers that were displayed on the page Only applicable for fronts | optional | |
3 | numberOfContainersViewed | i32 | Number of containers acctually viewed by the user Only applicable for fronts | optional |
Key | Field | Type | Description | Requiredness | Default value |
---|---|---|---|---|---|
1 | tcfConsent | string | optional | ||
2 | ccpaConsent | bool | optional | ||
3 | ausConsent | bool | optional | ||
4 | usNatConsent | bool | optional |
A user’s consent, which is represented differently for different jurisdictions.
Key | Field | Type | Description | Requiredness | Default value |
---|---|---|---|---|---|
1 | consentValue | ConsentValue | required | ||
2 | consentUUID | string | `consentUUID` is an identifier for the consent, for debugging. | optional | |
3 | cmpVersion | string | `cmpVersion` is the version of the Consent Management Platform in use, for debugging. | optional |
A `ConsentData` holds a user’s consent, plus some metadata.
Key | Field | Type | Description | Requiredness | Default value |
---|---|---|---|---|---|
3 | eventType | EventType | The type of this event | optional |
|
1 | eventId | string | Unique id associated with this specific event. You must make sure this is globally unqiue: ophan will only process one event per eventId. | required | |
9 | viewId | string | The id of this page view. Defaults to the same as event Id which is fine for events of type View. However, AD_LOAD events must set this to be the same as the viewId of the of the page view on which this ad is shown. | optional | |
22 | ageMsLong | i64 | This is for reporting offline events. The number of milliseconds ago that the event occurred. (We deliberately don't use an absolute timestamp to avoid issues with clocks on mobile devices being incorrect) This number should be zero or a positive number, never negative (that would mean in the future!). If an event has just happened, set this value to 0. | optional | |
2 | ageMs | i32 | DEPRECATED - use ageMsLong instead The i32 type is a 32-bit signed integer, so can only represent up to 2^31 milliseconds (24.9 days) of age without overflow - if a device is offline longer than a month we would get some weird 'future' events. | optional | 0 |
4 | path | string | Represents the page that has been displayed. For content pages, this should the exact content api path with a "/" prefix. For other pages, this should be the path of the corresponding web page on theguardian.com. This is mandatory if eventType is VIEW. | optional | |
5 | OBSOLETE_previousPath | string | DEPRECATED - use referrer The referring path, i.e. the path representing a page displyed on the app on which the user clicked a link to arrive at this page. | optional | |
6 | OBSOLETE_referringSource | source.Source | DEPRECATED - use referrer The means by which the user arrived at this page. | optional | |
7 | pushNotificationId | string | An id which we can link back to Pushy. | optional | |
8 | adLoad | ads.RenderedAd | Details about a rendered ad. Only applicable if eventType is AD_LOAD. | optional | |
10 | benchmark | benchmark.BenchmarkData | Contains benchmark data. Only applicable if eventType is PERFORMANCE. | optional | |
11 | networkOperation | benchmark.NetworkOperationData | Contains performance data for network based operations. Only applicable if eventType is NETWORK. | optional | |
12 | attentionMs | i64 | Attention time spent on this page view in milliseconds Only applicable if eventType is INTERACTION. | optional | |
13 | scrollDepth | ScrollDepth | Details of how far through a page a user has scrolled Only applicable if eventType is INTERACTION. | optional | |
14 | media | media.MediaPlayback | If populated, this event includes data about media playback | optional | |
15 | ab | abtest.AbTestInfo | If populated, this event includes data about ab tests that the user was a member of | optional | |
16 | interaction | interaction.Interaction | If populated, this event includes data about in-app interactions. | optional | |
17 | referrer | referrer.Referrer | If populated, contains information about the referrer/previous page in the apps. | optional | |
18 | url | url.Url | Represents the url of the page that has been displayed. Only applicable if eventType is VIEW. | optional | |
19 | renderedComponents | list< | If populated, contains information about the components present on the view. Only applicable if eventType is VIEW. | optional | |
20 | componentEvent | componentevent.ComponentEvent | If populated, this event includes data about components | optional | |
21 | acquisition | acquisition.Acquisition | If populated, this event includes data about an acquisition | optional | |
23 | inPageClick | inpageclick.InPageClick | If populated, this event includes data about a click that did not result in a page transition | optional | |
24 | consent | ConsentData | Populated if eventType is CONSENT, this field contains the user’s consent. | optional |
E.g. a 'page view' see EventType.
Key | Field | Type | Description | Requiredness | Default value |
---|---|---|---|---|---|
1 | version | string | The version of the app. | optional | |
2 | family | string | The device family. | optional | |
3 | os | string | The device's os. | optional | |
4 | edition | Edition | The edition of the app. | optional | |
5 | platform | platform.Platform | optional | ||
6 | isBeta | bool | Whether the app version is currently in Beta. | optional |
Details about this running application
Key | Field | Type | Description | Requiredness | Default value |
---|---|---|---|---|---|
1 | name | string | optional | ||
2 | manufacturer | string | optional | ||
3 | deviceClass | device.DeviceClass | optional |
Key | Field | Type | Description | Requiredness | Default value |
---|---|---|---|---|---|
2 | app | App | App specific information. | required | |
3 | device | Device | Device specific information. | optional | |
4 | deviceId | string | Equivalent to a web cookie. A way of identifying unique devices. | required | |
5 | userId | string | The user’s guardian user id if they are logged in. | optional | |
8 | OBSOLETE_kruxId | string | DEPRECATED - Used to be for the user's Krux identifer. | optional | |
6 | subscriptionId | subscription.SubscriptionType | What type of subscription does this user have? | optional | |
7 | events | list< | The interaction events contained within this submission. | required | |
9 | membershipTier | subscription.MembershipTier | If this user is a member, what tier are they currently a part of? | optional |
This is the root object that represents a tracking submission from native apps. This can be supplied to Ophan in one of two ways:Note that, for largely backwards compatibility reasons, in some cases we allow synonyms for enum values in json; these are noted in the descriptions below.
- Create the equivalent json and POST the json to https://ophan.theguardian.com/mob with a content type of application/json
- Create a thift binary blob in compact binary protocol format from this definition and POST to https://ophan.theguardian.com/mob a content type of application/vnd.apache.thrift.compact