| Module | Services | Data types | Constants |
|---|---|---|---|
| events | AssignedId Event EventBatch EventType Geo Location Page PageView Path Platform Referrer SuspectStatus |
R2 | 0 | |
NEXT_GEN | 1 | |
IOS_NATIVE_APP | 2 | |
ANDRIOD_NATIVE_APP | 3 |
VALID | 0 |
This event is valid and should be processed normally
|
INVALID_APP_RESUME_BUG | 1 |
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_VISIBLE | 2 |
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_SUCCESSFUL | 3 |
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.
|
ROBOT | 1 |
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_VIEW | 2 |
This represents a page view delivered to a user on a website
|
WEB_PAGE_VIEW_ADDITIONAL | 3 |
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_VIEW | 4 |
Represents data about a page view within our native mobile apps
|
Base type: string
| Key | Field | Type | Description | Requiredness | Default value |
|---|---|---|---|---|---|
| 1 | id | string | The actual id | required | |
| 2 | isNew | bool | Whether 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 |
| Key | Field | Type | Description | Requiredness | Default value |
|---|---|---|---|---|---|
| 1 | lat | double | Latitude | required | |
| 2 | lon | double | Longitude | required |
| Key | Field | Type | Description | Requiredness | Default value |
|---|---|---|---|---|---|
| 1 | xForwardedForHeader | string | The 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 | |
| 2 | ip | string | The ip address of the client | optional | |
| 3 | geo | Geo | The resolved geolocation of the ip address | optional | |
| 4 | countryCode | string | The 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 | |
| 5 | countryName | string | Human readable country name | optional | |
| 6 | city | string | Human readable city name | optional | |
| 7 | continent | string | Human readable continent name | optional | |
| 8 | subdivisions | list< | Administrative subdivisions, e.g. "Wales", "Berkshire" | optional |
| Key | Field | Type | Description | Requiredness | Default value |
|---|---|---|---|---|---|
| 1 | url | string | The 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 | |
| 2 | host | string | The hostname extracted from the url. Note this is the *full* hostname, with no abbreviation performed | optional | |
| 3 | path | Path | The path extracted from the url. See documentation for the Path typedef for more information. | optional | |
| 4 | campaignId | set< | The values of all of the CMP and INTCMP parameters | optional | |
| 5 | platform | Platform | The platform that served this page | optional |
| Key | Field | Type | Description | Requiredness | Default value |
|---|---|---|---|---|---|
| 1 | raw | string | the raw value of document.referrer as reported by the browser, or invented for mobile apps | required | |
| 2 | simplifiedHost | string | the 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 | |
| 3 | path | Path | the path of the referrer, if the previous page was served by the guardian | optional | |
| 4 | component | string | the component that was clicked on for this referral, if the previous page was served by the guardian | optional | |
| 5 | platform | Platform | the platform of the referrer, if the previous page was served by the guardian | optional | |
| 6 | viewId | string | the viewId of the referrer, if the previous page was served by the guardian | optional | |
| 7 | string | if this was from a guardian email, what email it was | optional |
| Key | Field | Type | Description | Requiredness | Default value |
|---|---|---|---|---|---|
| 1 | validity | SuspectStatus | Whether we view this event as "suspect". most consumers of this stream should ignore events that are do not have a status of VALID. | optional | UNKNOWN |
| 2 | page | Page | Details about the page displayed | optional | |
| 3 | userAgent | ua.UserAgent | The user agent that made this request | optional | |
| 4 | location | Location | Details about the location of the user made this request | optional | |
| 5 | referrer | Referrer | Details about the referrer to this page view Will only be present on _PAGE_VIEW events where a referer was received | optional | |
| 6 | httpStatus | i16 | The http status returned to the user for this page view | required | 200 |
| Key | Field | Type | Description | Requiredness | Default value |
|---|---|---|---|---|---|
| 1 | eventType | EventType | The 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 | |
| 2 | uniqueEventId | string | Unique 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 | |
| 3 | dt | i64 | The date time (in millis since epoch UTC) at which this event occurred. | required | |
| 4 | pageViewId | string | The 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 | |
| 5 | browserId | AssignedId | The unqiue id associated with this browser. Currently this is maintained by setting a cookie for web events, or otherwise determined for native apps. | optional | |
| 6 | visitId | AssignedId | The 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 | |
| 7 | userId | string | If the user is logged in, the identity user id. | optional | |
| 8 | pageView | PageView | For *_PAGE_VIEW event types, details about the page view | optional |
| Key | Field | Type | Description | Requiredness | Default value |
|---|---|---|---|---|---|
| 1 | events | list< | default |