Link server and engagement metrics aggregator for Firefox Directory Links
There are a few API endpoints we care about:
- /v2/links/fetch/
locale
- /v2/links/fetch
- /v2/links/view
- /v2/links/click
- /v3/links/fetch/
locale
/channel
- /v3/links/view
- /v3/links/click
The fetch
endpoint takes locale in a JSON payload and returns an HTTP 303
redirect to a CDN location with the content appropriate for the user agent.
In Firefox, this is called when the idle-daily
event is triggered. This is guaranteed to trigger only once daily.
Method: GET
URL Parameters:
- locale - User Agent locale setting
DEPRECATED
The fetch
endpoint takes locale in a JSON payload and returns an HTTP 303
redirect to a CDN location with the content appropriate for the user agent.
In Firefox, this is called when the idle-daily
event is triggered. This is guaranteed to trigger only once daily.
Note: Prior to having v2, the v1 of this endpoint also took a data parameter, hence why this is a POST
Method: POST
Example payload:
{"locale": "en-US"}
Parameters:
- locale - User Agent locale setting
The view
endpoint is called each time a new tab page is opened. An asynchronous ping is sent from Firefox to Mozilla servers. The goal is to capture the impression data for tiles, in order to calculate raech and click-through rates (CTR).
Method: POST
Example Payload:
{
"view": 1,
"locale": "en-US",
"tiles": [
{
"id": 8,
"pin": true,
"pos": 2,
"score": 2000,
"url": ""
},
{
"id": 12
}
]
}
Parameters:
view
: the value of thisaction
is the index of the last tile intiles
visible in the user's viewporttiles
: an ordered array of tiles representative of what is in a new tab pageid
: a tile ID. provided in the fetch payload asdirectoryId
; absent for history tilespin
: signals that the tile is pinned in the UA; absent for unpinned tilespos
: denotes the index of the tile in the new tab page; absent if the value is the same as its array index oftiles
score
: frecency for the tile; absent for frecencies under 5000url
: signals that the tile is enhanced (with an empty "" value); absent for directory and history tiles
locale
: User Agent locale setting
The click
endpoint captures any click interaction with the tile. This includes click
, block
, pin
, unpin
, sponsored
, and sponsored_link
.
When the user interacts with the tile, an asynchronous ping is sent to Mozilla servers. This is to measure a click event. Since our business model is Cost per Click (CPC), this metric is vital.
Positive events and perhaps more importantly, negative events like block
and unpin
are also very important. It can tell us that certain tiles are not appropriate or that people do not like them.
Method: POST
Example Payload:
{
"click": 1,
"locale": "en-US",
"tiles": [
{
"id": 8,
"pin": true,
"pos": 2,
"score": 2000,
"url": ""
},
{
"id": 12
},
...
]
}
Parameters:
click
/block
/pin
/unpin
/sponsored
/sponsored_link
: Only one of these can happen in one payload. The value of thisaction
is the index intiles
for which this action applies- The rest of the parameters are the same as for
/v2/links/view
except for theview
action, i.e. thelocale
andtiles
params.
The fetch
endpoint takes locale in a JSON payload and returns an HTTP 303
redirect to a CDN location with the content appropriate for the user agent.
In Firefox, this is called when the idle-daily
event is triggered. This is guaranteed to trigger only once daily.
Method: GET
URL Parameters:
- locale - User Agent locale setting
- channel - Firefox Channel the request is coming from
unchanged from /v2/links/view
unchanged from /v2/links/click