Thrift module: nativeapp

ModuleServicesData typesConstants
nativeapp App
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.

Enumeration: Edition

A specific version of the app exisits for each edition in the content api. For example, US visitors get the US version of our app.

UK0
US1
AU2
International3

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

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
2ageMsi32This is for reporting offline events. The number of milliseconds ago that the event occured. (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. 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
5previousPathstringDEPRECATED - 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
6referringSourcesource.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

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

Details about this running application

Struct: Device

KeyFieldTypeDescriptionRequirednessDefault value
1namestringoptional
2manufacturerstringoptional

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
8kruxIdstringThe krux identifer for this user. 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.