Thrift module: nativeapp

ModuleServicesData typesConstants
nativeapp App
ConsentData
ConsentValue
Device
Edition
Event
EventType
NativeAppSubmission
ScrollDepth

Enumerations

Enumeration: EventType


VIEW0
When a user views a 'page'.


AD_LOAD1
An ad has been loaded


PERFORMANCE2
The event contains performance benchmark data.


NETWORK3
The event contains profiling data for network based operations.


INTERACTION4
The event contains information about an in-page interaction


AB_TEST5
The event contains information about the AB tests.


COMPONENT_EVENT6
The event contains information about components.


ACQUISITION7
The event contains information about acquisitions.


IN_PAGE_CLICK8
The event contains information about an in-page click


CONSENT9
The event contains a user’s consent.


Enumeration: Edition

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.


UK0
US1
AU2
International3
Europe4

Data structures

Struct: ScrollDepth

KeyFieldTypeDescriptionRequirednessDefault value
1maxExtenti32The maximum percentage of the page seen by the user required
2numberOfContainersi32Total number of containers that were displayed on the page Only applicable for fronts optional
3numberOfContainersViewedi32Number of containers acctually viewed by the user Only applicable for fronts optional

Union: ConsentValue

KeyFieldTypeDescriptionRequirednessDefault value
1tcfConsentstringoptional
2ccpaConsentbooloptional
3ausConsentbooloptional
4usNatConsentbooloptional

A user’s consent, which is represented differently for different
jurisdictions.

Struct: ConsentData

KeyFieldTypeDescriptionRequirednessDefault value
1consentValueConsentValuerequired
2consentUUIDstring`consentUUID` is an identifier for the consent, for debugging. optional
3cmpVersionstring`cmpVersion` is the version of the Consent Management Platform in use, for debugging. optional

A `ConsentData` holds a user’s consent, plus some metadata.

Struct: Event

KeyFieldTypeDescriptionRequirednessDefault value
3eventTypeEventTypeThe type of this event optionalEventType.VIEW
1eventIdstringUnique id associated with this specific event. You must make sure this is globally unqiue: ophan will only process one event per eventId. required
9viewIdstringThe 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
22ageMsLongi64This 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
2ageMsi32DEPRECATED - 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. optional0
4pathstringRepresents 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
5OBSOLETE_previousPathstringDEPRECATED - 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
6OBSOLETE_referringSourcesource.SourceDEPRECATED - use referrer The means by which the user arrived at this page. optional
7pushNotificationIdstringAn id which we can link back to Pushy. optional
8adLoadads.RenderedAdDetails about a rendered ad. Only applicable if eventType is AD_LOAD. optional
10benchmarkbenchmark.BenchmarkDataContains benchmark data. Only applicable if eventType is PERFORMANCE. optional
11networkOperationbenchmark.NetworkOperationDataContains performance data for network based operations. Only applicable if eventType is NETWORK. optional
12attentionMsi64Attention time spent on this page view in milliseconds Only applicable if eventType is INTERACTION. optional
13scrollDepthScrollDepthDetails of how far through a page a user has scrolled Only applicable if eventType is INTERACTION. optional
14mediamedia.MediaPlaybackIf populated, this event includes data about media playback optional
15ababtest.AbTestInfoIf populated, this event includes data about ab tests that the user was a member of optional
16interactioninteraction.InteractionIf populated, this event includes data about in-app interactions. optional
17referrerreferrer.ReferrerIf populated, contains information about the referrer/previous page in the apps. optional
18urlurl.UrlRepresents the url of the page that has been displayed. Only applicable if eventType is VIEW. optional
19renderedComponentslist<string>If populated, contains information about the components present on the view. Only applicable if eventType is VIEW. optional
20componentEventcomponentevent.ComponentEventIf populated, this event includes data about components optional
21acquisitionacquisition.AcquisitionIf populated, this event includes data about an acquisition optional
23inPageClickinpageclick.InPageClickIf populated, this event includes data about a click that did not result in a page transition optional
24consentConsentDataPopulated if eventType is CONSENT, this field contains the user’s consent. optional

E.g. a 'page view' see EventType.


Struct: App

KeyFieldTypeDescriptionRequirednessDefault value
1versionstringThe version of the app. optional
2familystringThe device family. optional
3osstringThe device's os. optional
4editionEditionThe edition of the app. optional
5platformplatform.Platformoptional
6isBetaboolWhether the app version is currently in Beta. optional

Details about this running application

Struct: Device

KeyFieldTypeDescriptionRequirednessDefault value
1namestringoptional
2manufacturerstringoptional
3deviceClassdevice.DeviceClassoptional

Struct: NativeAppSubmission

KeyFieldTypeDescriptionRequirednessDefault value
2appAppApp specific information. required
3deviceDeviceDevice specific information. optional
4deviceIdstringEquivalent to a web cookie. A way of identifying unique devices. required
5userIdstringThe user’s guardian user id if they are logged in. optional
8OBSOLETE_kruxIdstringDEPRECATED - Used to be for the user's Krux identifer. optional
6subscriptionIdsubscription.SubscriptionTypeWhat type of subscription does this user have? optional
7eventslist<Event>The interaction events contained within this submission. required
9membershipTiersubscription.MembershipTierIf 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:

  1. Create the equivalent json and POST the json to https://ophan.theguardian.com/mob with a content type of application/json
  2. 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
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.