Documentation · API reference
POST/api/v1/sites/{site}/picks

Count a click on what a selector matches as an event

Count a click on what a selector matches as an event. The site's script carries it: nothing on the site's pages changes.

Parameters

sitein the address
neededA site's id or name

What to send

PickCreate Pick an element: count a click on what a selector matches as an event.

attr
string or nullThe attribute of the element the property's value is read from.
event
stringThe event a click is counted as. One that exists already is added to.
goal
string or nullMake a goal of the event as well, with this name.
path
string or nullThe one path it counts on. Left out: every page where it matches.
prop
string or null
selector
string
value
string or nullOr the value it always has.

The answer

Status 201

PickedView An element picked on a stored copy of a page (the Picker board): a click on what its selector matches is an event.

attr
string or null
by
stringneeded
event
stringneeded
id
stringneeded
made
integerneeded
path
string or nullThe one path it counts on. None: every page where it matches.
prop
string or nullA property sent with it, and where its value comes from: one of the element's attributes, or a fixed text.
says
stringneededWhat it sends, in a line.
selector
stringneeded
value
string or null

Asking

With your token from Settings
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/picks \
    -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{}'
With your token from Settings
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/picks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
}).then((r) => r.json());