viakite
Dashboard

API/Reports/A goal's conversions by source, under four attribution models

A goal's conversions by source, under four attribution models

POST/v1/projects/{project}/analytics/attribution

Each person who reached goal inside date_range is one conversion, at their first goal event. Its credit is shared among the visits that led to it (up to and including the visit it happened in), grouped by dimension, a column that says where a visit came from (channel by default): first_touch gives it all to the first visit, last_touch to the last, linear the same share to each, and position_based 40% to the first, 40% to the last and 20% shared by the ones between (half each with two visits). Each model's column adds up to conversions. With count_by: visitors (the default) only the visitor's visits of that day count, since a visitor id lasts one day. With count_by: users people are identified users (identify, with their visitors' anonymous events of the day linked), and their visits on every device in the 30 days before the conversion count. Filters apply to the conversion. Up to 100 rows, by linear credit.

Secret keyNeeds analytics.viewus.api.vk.viabio.me

Path parameters

projectstringrequired
The project's id (prj_…).

Body

goalobjectrequired
What counts as a conversion, a page or an event with optional property conditions; any custom event when left out. With a goal, revenue and average_order_value count only the goal's events.
Show 3 fields
typestringrequired
pageevent
valuestringrequiredup to 255 chars
A path (with * for any part) or an event name.
conditionsPropertyCondition[]up to 20 items
With type event, property tests the event must pass, all of them (plan is pro).
Show 3 fields
propertystringrequiredup to 255 chars
operatorstringrequired
isis_notcontainsstarts_with
valuestringrequiredup to 255 chars
dimensionstring
What the credit goes to; channel by default.
channelsourcereferrer_domainutm_sourceutm_mediumutm_campaignutm_termutm_contentref
filtersFilter[]
A dimension matching any of up to 20 values, or or, a list of such filters (not nested). Filters in a list are ANDed; up to 20 in all. goal matches the names of the project's saved goals an event reaches (is_not: none of them); page_group matches the name of the first of the project's saved page groups whose pattern the event's path matches (empty when none does); new_returning is New or Returning.
Show 4 fields
dimensionstring
A dimension's name; keyed ones take a key: props.plan.
operatorstring
isis_notcontainsnot_containsstarts_withregex
valuesstring[]1–20 items
orFilter[]
date_rangeobjectrequired
A preset, or from and to as dates (2026-11-01, whole days in the project's time zone, to included) or RFC 3339 times (to excluded). Empty means the last 30 days. A range starting before the first day the plan keeps (retention_days of F47: the last N days, today included, in the project's time zone) starts on that day instead: the answer's date_range shows where it starts, and F1, F2 and the public queries add a range_clamped warning. A range wholly before it is empty.
Show 3 fields
presetstring
todayyesterday7d30d90dthis_monthlast_monththis_yearall
fromstring
tostring
count_bystring
visitors (the default): the visitor's visits of the same day. users: identified people, with their visits on every device over the 30 days before the conversion.
visitorsusers

Responses

Each value's credit under each model.

dataAttributionRow[]requiredup to 100 items
One value and the conversions it gets credit for under each model (fractions).
Show 5 fields
valuestringrequired
The dimension's value; empty when the visits had none.
first_touchnumberrequired
last_touchnumberrequired
linearnumberrequired
position_basednumberrequired
conversionsintegerrequired
People who converted in the range; each model's column adds up to it.
dimensionstringrequired
count_bystringrequired
visitorsusers
windowstringrequired
date_rangeobjectrequired
A resolved range [from, to) in UTC.
Show 2 fields
fromstring · date-timerequired
A time in UTC, ISO 8601.
tostring · date-timerequired
A time in UTC, ISO 8601.
Example response
1{
2 "data": [
3 {
4 "value": "string",
5 "first_touch": 1.5,
6 "last_touch": 1.5,
7 "linear": 1.5,
8 "position_based": 1.5
9 }
10 ],
11 "conversions": 1,
12 "dimension": "country",
13 "count_by": "visitors",
14 "window": "1 day",
15 "date_range": {
16 "from": "2026-11-21T09:30:00Z",
17 "to": "2026-11-21T09:30:00Z"
18 }
19}

Errors

Every error has the same shape: error.code, a message for people and details.

StatusCode
422validation_error
503clickhouse_not_configured