Thrift module: events

ModuleServicesData typesConstants
events AssignedId
Event
EventBatch
EventType
Geo
Location
Page
PageView
Path
Platform
Referrer
SuspectStatus

Enumerations

Enumeration: Platform

The platform that served this request to the reader.



R20
NEXT_GEN1
IOS_NATIVE_APP2
ANDRIOD_NATIVE_APP3

Enumeration: SuspectStatus


VALID0 This event is valid and should be processed normally
INVALID_APP_RESUME_BUG1 This event is invalid, becuase we think it was only sent because of a persistent bug in the mobile apps where they erroneously sent page view notifcation after a device suspend-resume
INVALID_WEB_NOT_VISIBLE2 This event is invalid, becuase although we tracked it, the resulting web page was not visible. In the future, ophan's tracking code will deal with this and report only when the page does subsequently become visible.
INVALID_WEB_NOT_SUCCESSFUL3 This event does not represent a usual page view, as the user was returned a non-200 sucess code. (Which we track by putting special ophan tracking on the error page displayed.)

Unless you're specifically interested in errors, you should ignore these as page views.


Enumeration: EventType


ROBOT1 NO LONGER USED
previously (when ophan processed this data) indicated that the event arose from web server logs with no evidence of actual user interaction


WEB_PAGE_VIEW2 This represents a page view delivered to a user on a website
WEB_PAGE_VIEW_ADDITIONAL3 This represents additional information about a page view delivered on the website
NOTE: ophan (currently) makes no guarantees about order of message delivery so it's perfectly possible to receive additional events about a page view before the page view itself
NATIVE_APP_PAGE_VIEW4 Represents data about a page view within our native mobile apps

Type declarations

Typedef: Path

Base type: string

The path extracted from the url (without query string or fragment), including a preceeding "/". So http://www.theguardian.com/uk/sport becomes "/uk/sport".

Note that ophan performs some procesisng on this path - especially from the native mobile apps - to try to make this match up with a valid url on www.theguardian.com



Data structures

Struct: AssignedId

KeyFieldTypeDescriptionRequirednessDefault value
1idstringThe actual id
required
2isNewboolWhether the id was generated and set for the
first time on this request. If undefined,
it's not known whether the id is a new one
or not.
optional

Ophan assigns various ids to things when necessary (on Web, by dropping cookies). This struct indicates the id and whether we freshly assigned an id on this request.

Struct: Geo

KeyFieldTypeDescriptionRequirednessDefault value
1latdoubleLatitude
required
2londoubleLongitude
required

A geographical location

Struct: Location

KeyFieldTypeDescriptionRequirednessDefault value
1xForwardedForHeaderstringThe full value of the X-Forwarded-For header supplied.
Normally you'll want to ignore this as read the other fields that
are derived from that header.
optional
2ipstringThe ip address of the client
optional
3geoGeoThe resolved geolocation of the ip address
optional
4countryCodestringThe two letter country code of the ip address;
Note that guardian internal traffic (within the Guardian offices)
is assigned a country code of "GNM"
optional
5countryNamestringHuman readable country name
optional
6citystringHuman readable city name
optional
7continentstringHuman readable continent name
optional
8subdivisionslist<string>Administrative subdivisions, e.g. "Wales", "Berkshire"
optional

Where this request was made from, derived by ip address lookup.

Struct: Page

KeyFieldTypeDescriptionRequirednessDefault value
1urlstringThe full URL, potentially including query string and fragment identifier
Note that for native mobile apps, we synthesise a url with an invented
hostname of "native-app.theguardian.com".
required
2hoststringThe hostname extracted from the url. Note this is the *full* hostname,
with no abbreviation performed
optional
3pathPathThe path extracted from the url. See documentation for the Path
typedef for more information.
optional
4campaignIdset<string>The values of all of the CMP and INTCMP parameters
optional
5platformPlatformThe platform that served this page
optional

Details about the page that was served to the user


Struct: Referrer

KeyFieldTypeDescriptionRequirednessDefault value
1rawstringthe raw value of document.referrer as reported by the browser, or
invented for mobile apps

required
2simplifiedHoststringthe host that this referral came from
Note that in most cases we trim down the hostname included in "raw"
to only include the first value before the top level domain,
so m.facebook.com => facebook.com
Exceptions include google (not trimmed, so it's easy to see the difference between
www. and news.); outbrain (not trimmed, to identify between traffic.outbrain.com and
paid.outbrain.com.
Also, t.co is mapped to twitter.com
optional
3pathPaththe path of the referrer, if the previous page was served by the guardian
optional
4componentstringthe component that was clicked on for this referral,
if the previous page was served by the guardian
optional
5platformPlatformthe platform of the referrer,
if the previous page was served by the guardian
optional
6viewIdstringthe viewId of the referrer,
if the previous page was served by the guardian
optional
7emailstringif this was from a guardian email, what email it was
optional

Information about the referrer - previous page - that the reader navigated to this one from.


Struct: PageView

KeyFieldTypeDescriptionRequirednessDefault value
1validitySuspectStatusWhether we view this event as "suspect".
most consumers of this stream should ignore events
that are do not have a status of VALID.
optionalUNKNOWN
2pagePageDetails about the page displayed
optional
3userAgentua.UserAgentThe user agent that made this request
optional
4locationLocationDetails about the location of the user made this request
optional
5referrerReferrerDetails about the referrer to this page view
Will only be present on _PAGE_VIEW events where
a referer was received
optional
6httpStatusi16The http status returned to the user for this page view
required200

Details about a page view - only populated for _PAGE_VIEW event types


Struct: Event

KeyFieldTypeDescriptionRequirednessDefault value
1eventTypeEventTypeThe type of this event, from the list above.
Note: this is marked as optional because what thrift does
when new event types are added to the enum above that your
version of this definition doesn't understand, this field
will become undefined. You should probably ignore events where
this field is undefined.
optional
2uniqueEventIdstringUnique id associated with this event. Ophan never makes
better than at-least-once delivery promises, so you
must ensure that processing two events with the same
uniqueEventId has no effect
required
3dti64The date time (in millis since epoch UTC) at which this event
occurred.
required
4pageViewIdstringThe page view for which this event is associated.
Ophan may send multiple events relating to the same
page view, which may contain updates to any previously
supplied data or new data. You should treat the one with the
highest timestamp (dt) as the most accurate.
optional
5browserIdAssignedIdThe unqiue id associated with this browser.
Currently this is maintained by setting a cookie for web
events, or otherwise determined for native apps.
optional
6visitIdAssignedIdThe unique id associated with this "visit".
For web reports, the visit id is a refreshed session
cookie that expires after 30 minutes of activity.
Mobile apps do not currently set this value.
optional
7userIdstringIf the user is logged in, the identity user id.
optional
8pageViewPageViewFor *_PAGE_VIEW event types, details about the page view
optional

Struct: EventBatch

KeyFieldTypeDescriptionRequirednessDefault value
1eventslist<Event>default

Used internally within ophan to e.g. put batches of tracker events on a queue.