Skip to content

Attribution

A customer arrives through an ad, comes back through the newsletter, then buys after typing the address. Which visit “made” the sale? Each attribution model answers differently; eodia analytics computes all six, and insights dashboards compare them.

The analytics.touchpoints view gives each person’s visits, in order: their rank (rank), their channel, source, medium and campaign. The person is the matched identity if the visitor signed in, otherwise the visitor identifier (see the signed-in visitor).

To follow a person from one visit to the next, they must be recognized: measurement cookie, consent given, or signed-in visitor. In cookieless mode, the hash changes every day, and attribution is limited to the day; the view’s comment says so.

Only visits in the 30 days before the conversion count, by default. The window is set per site, from 1 to 90 days (Site settings › Attribution window).

modelDistribution
first_clickeverything to the first visit
last_clickeverything to the last visit
last_non_directeverything to the last non-direct visit; to the direct visit only if it is the only one
linearequal shares across all visits
position_based40% to the first, 40% to the last, 20% spread across the others
time_decaya share that halves every 7 days before the conversion

last_non_direct is Google Analytics’ default model apart from the “data-driven” model. There is no “data-driven” model: it requires volumes and training beyond the reach of a view.

One row per conversion, visit and model. Conversions are goals reached (conversion_kind = 'goal') and orders (purchase).

ColumnContents
modelthe model
conversion_kind, conversion, conversion_id, converted_atthe conversion: goal or order, its name, its identifier, its instant
personthe person who converted
session_id, started_atthe credited visit
touchpoint, touchpointsthe rank of the visit in the journey, and the number of visits in the journey
channel, source, medium, campaignthe origin of the credited visit
creditthe share of the conversion attributed to the visit, from 0 to 1; the sum is 1 per conversion and per model
valuethe attributed value: credit × conversion value
days_beforethe time between the visit and the conversion, in days
-- Revenue attributed by channel, according to each model (last 30 days)
SELECT model, channel, round(sum(value), 2) AS revenue
FROM analytics.attribution
WHERE conversion_kind = 'purchase'
AND day >= current_date - INTERVAL '30' DAY
GROUP BY model, channel
ORDER BY model, revenue DESC

In the demo, Maison Arvor customers often come back three times before buying: the “first visit” model credits paid social, “last visit” credits direct, “last non-direct visit” credits the newsletter. None of them is wrong; they do not tell the same story.

-- The average time between the first visit and the order
SELECT avg(days_before) AS days
FROM analytics.attribution
WHERE model = 'first_click' AND conversion_kind = 'purchase'

A goal is declared in the site’s Metadata tab: a page reached (/contact/merci, * for any text) or an event (optionally with a property to check), and a value: none, fixed, or the event’s value property. The analytics.goals view lists them, and analytics.conversions gives each goal reached.

eodia analytics is free software by Eodia.