2016-03-30 23:23:13 +03:00
# Activity Stream Pings
The Activity Stream addon sends two distinct types of pings to the backend (HTTPS POST) [Onyx server ](https://github.com/mozilla/onyx ) :
2016-03-30 23:37:05 +03:00
- a `session` ping that describes the ending of an Activity Stream session (lose focus event on Activity Stream), and
2016-03-30 23:23:13 +03:00
- an `event` ping that records specific data about individual user interactions while interacting with Activity Stream
# Example Activity Stream `session` Log
2016-03-10 22:48:17 +03:00
2016-03-12 03:50:45 +03:00
```json
{
2016-03-30 23:23:13 +03:00
"action": "activity_stream_session",
2016-03-12 03:50:45 +03:00
"addon_version": "1.0.0",
"client_id": "374dc4d8-0cb2-4ac5-a3cf-c5a9bc3c602e",
"date": "2016-03-07",
"ip": "10.192.171.13",
2016-04-04 21:09:34 +03:00
"load_latency": 1100,
2016-03-12 03:50:45 +03:00
"load_reason": "restore",
"locale": "en-US",
"max_scroll_depth": 145,
2016-04-04 21:09:34 +03:00
"page": "newtab or timeline",
"receive_at": 1457396660000,
2016-03-12 03:50:45 +03:00
"session_duration": 1635,
2016-03-30 23:40:50 +03:00
"tab_id": "1-3",
2016-03-12 03:50:45 +03:00
"total_bookmarks": 19,
"total_history_size": 9,
"ua": "python-requests/2.9.1",
"unload_reason": "close",
}
```
2016-03-30 23:23:13 +03:00
# Example Activity Stream `event` Log
```json
{
"action": "activity_stream_event",
2016-04-04 21:09:34 +03:00
"action_position": "3",
2016-03-30 23:23:13 +03:00
"addon_version": "1.0.0",
"client_id": "374dc4d8-0cb2-4ac5-a3cf-c5a9bc3c602e",
2016-03-31 23:38:16 +03:00
"date": "2016-03-07",
2016-04-04 21:09:34 +03:00
"event": "click or scroll or search or delete",
2016-03-31 23:38:16 +03:00
"ip": "10.192.171.13",
2016-04-04 21:09:34 +03:00
"locale": "en-US",
"page": "newtab or timeline",
"receive_at": 1457396660000,
"source": "top sites, or bookmarks, or...",
"tab_id": "1-3",
2016-07-22 21:11:13 +03:00
"ua": "python-requests/2.9.1",
"url": "https://www.example.com",
"recommender_type": "pocket-trending"
2016-03-30 23:23:13 +03:00
}
```
2016-05-26 19:07:12 +03:00
# Example Activity Stream `performance` Log
```json
{
"action": "activity_stream_performance",
"addon_version": "1.0.0",
"client_id": "374dc4d8-0cb2-4ac5-a3cf-c5a9bc3c602e",
"date": "2016-03-07",
"event": "previewCacheHit",
"event_id": "45f1912165ca4dfdb5c1c2337dbdc58f",
"ip": "10.192.171.13",
"locale": "en-US",
"receive_at": 1457396660000,
"source": "TOP_FRECENT_SITES",
"tab_id": "1-3",
"ua": "python-requests/2.9.1",
"value": 1,
}
```
2016-03-12 03:50:45 +03:00
| KEY | DESCRIPTION | |
|-----|-------------|:-----:|
2016-05-26 19:07:12 +03:00
| `action_position` | The index of the element in the `source` that was clicked. | :one:
2016-03-31 22:20:38 +03:00
| `action` | Either `activity_stream_event` or `activity_stream_session` . | :one:
2016-03-12 03:50:45 +03:00
| `addon_version` | The version of the Activity Stream addon. | :one:
| `client_id` | An identifier for this client. | :one:
2016-05-26 19:07:12 +03:00
| `date` | The date in YYYY-MM-DD format. | :three:
| `event_id` | An identifier shared by multiple performance pings that describe ane entire request flow. | :one:
2016-03-30 23:23:13 +03:00
| `event` | The type of event. Either ("click", "share", "delete", "more_items") | :one:
2016-05-26 19:07:12 +03:00
| `ip` | The IP address of the client. | :two:
2016-03-12 03:50:45 +03:00
| `load_reason` | Either ("newtab", "refocus", "restore") and is the reason the tab was focused. | :one:
2016-05-26 19:07:12 +03:00
| `locale` | The browser chrome's language (eg. en-US). | :two:
2016-03-12 03:50:45 +03:00
| `max_scroll_depth` | The maximum number of pixels the scroll bar was dragged in this session. | :one:
2016-05-26 19:07:12 +03:00
| `page` | Either ("newtab", "timeline"). | :one:
2016-03-12 03:50:45 +03:00
| `session_duration` | Defined to be the time in milliseconds between the newtab gaining and losing focus. | :one:
2016-05-26 19:07:12 +03:00
| `source` | Either ("recent_links", "recent_bookmarks", "frecent_links", "top_sites", "spotlight", "sidebar") and indicates what `action` . | :two:
2016-03-12 03:50:45 +03:00
| `tab_id` | The Firefox generated unique id for the tab. | :one:
2016-05-26 19:07:12 +03:00
| `timestamp` | The time in ms since epoch. | :three:
2016-03-12 03:50:45 +03:00
| `total_bookmarks` | The total number of bookmarks in the user's places db. | :one:
| `total_history_size` | The number of history items currently in the user's places db. | :one:
2016-05-26 19:07:12 +03:00
| `ua` | The user agent string. | :two:
2016-03-14 22:16:24 +03:00
| `unload_reason` | The reason the Activity Stream page lost focus. | :one:
2016-05-26 19:07:12 +03:00
| `value` | An integer that represents the measured performance value. Can store counts, times in milliseconds, and should always be a positive integer.| :one:
2016-03-12 03:50:45 +03:00
| `ver` | The version of the Onyx API the ping was sent to. | :one:
2016-07-22 21:11:13 +03:00
| `url` | The URL of the recommendation shown in one of the highlights spots, if any. | :one:
| `recommender_type` | The type of recommendation that is being shown, if any. | :one:
2016-03-12 03:50:45 +03:00
**Where:**
:one: Firefox data
:two: HTTP protocol data
2016-03-10 22:48:17 +03:00
:three: server augmented data