Lens

Create an Attribution Table

An attribution table stores one row per touch: every conversion, the sessions that led to it, and the credit each one earns under five models, so ordinary tiles can answer attribution questions.

What an attribution table is

An attribution table is a composite table built from raw events. For every conversion it finds the visits that came before it, within a lookback window, and precomputes how much credit each visit earns under five models. Because the credit is stored as ordinary metrics, any tile (Table, Bar, Line, KPI) can show it.

ModelCredit
First TouchAll credit to the first visit in the path
Last TouchAll credit to the last visit
LinearShared equally across all visits
Position-Based40% to the first, 40% to the last, 20% shared across the visits between. With two visits, 50% each
Time DecayMore credit to visits closer to the conversion, halving every Time-Decay Half-Life days

This is different from the Attribution tile, which counts users per channel on the fly with a fixed last-touch rule.

Before you start

You need one of:

  • a GA4 BigQuery export and a Google service account with BigQuery Data Viewer and BigQuery Job User on the project. Queries are billed to that project.
  • a Lens event table with one row per event, such as Echo events, with a user ID, a session ID and an event name.

Create the table

  1. Go to Configure > Data Tables, click + New Table and choose Attribution Table under Composite Tables.
  2. Under Details, enter a Table Name.
  3. Under Data Source, pick where raw events come from: - GA4 BigQuery Export: pick the Service Account (or the default TagPipes service account), then enter the Project ID and GA4 Export Dataset. Touches use GA4's session source, medium, campaign and channel group. - Lens Event Table: pick the Source Table, then the User ID Field, Session ID Field, Event Name Field and Channel Field. Source Field, Medium Field and Campaign Field are optional. Each session's first event decides its channel, source, medium and campaign.
  4. Under Conversion, enter the exact Conversion Event, for example purchase. Optionally: - Only When: click Add Condition to narrow the conversion, for example fulfillment_type is delivery. - Keep These Conversion Fields: up to 10, comma separated. Each becomes a conv_ column you can filter tiles by, so one table answers delivery, pickup and all orders. - Revenue Field: without it, credit is counted in conversions only. - De-duplicate On: a conversion repeated with the same value counts once, such as a transaction ID.
  5. Click Check Setup (below).
  6. Set the Attribution Rules (below), a Sync Schedule and, optionally, a Notifications group to email when a sync fails.
  7. Click Create Table. The first sync is queued straight away.

Check Setup

Check Setup reads the last 7 days of data and saves nothing. It shows:

LineTells you
Conversions, last 7 daysHow many conversion events matched. Zero means the table would be empty
Converting usersHow many users converted
field filledFor each kept conversion field, how often it has a value
Sessions with no channelVisits that will read as (not set)
Events GA4 dates on another day than zoneGA4 export only: how many events fall on a different day in your chosen Report Days In zone
BigQuery scanned per syncGA4 export only: what each build reads, with an estimated cost per sync and per month at the chosen schedule

Warnings appear underneath, for example when a kept field is blank on most conversions. See BigQuery Cost for how the estimate is worked out.

Attribution rules

SettingDefaultWhat it does
Lookback Window30 daysHow far before a conversion a visit still counts as a touch. 7, 14, 30, 60 or 90 days
Conversions KeptLast 90 daysThe history the table holds: 30, 60, 90, 180 or 365 days. Rebuilt in full on every sync
Direct VisitsCount ThemCount Them gives direct visits credit like any other. Skip When Possible ignores direct when another channel touched
Channel Values That Mean DirectDirect, (direct)Comma separated, case-insensitive. A blank channel reads as (not set)
Time-Decay Half-Life (days)7A touch this many days before the conversion gets half the weight of one on the day
Most Touches Per Conversion50Keeps the latest ones when a path is longer
Report Days InInherit from PropertyThe day each conversion is counted on. For a GA4 export, use the GA4 property's time zone
Step NamesSource / Medium as recordedGA4 only. Pick a custom grouping on source_medium, source, medium, campaign or channel to give steps friendly names
Channel GroupGA4 DefaultGA4 only. Primary Group uses the GA4 property's own primary channel group; visits it does not cover use the default. Changing it needs a sync

What the table contains

Each row is one touch on one conversion. Visits that did not convert are also stored, so conversion rates can be worked out.

ColumnsExamples
TouchChannel, Source, Medium, Campaign, Source / Medium, Step, Touch #, Touches in Path
PathPath (Channel), Path (Source / Medium), Path (Campaign), Path (Steps), First-Touch Channel, Last-Touch Channel. A path keeps its last 10 steps
CreditConversions and Revenue for each of the five models
RatesConv. Rate per model (credit divided by Sessions), Conv. Rate (Visitors)
TotalsConversions, Revenue, Touches, Sessions, Visitors, Converting Visitors, Avg Days to Convert, Avg Touches per Conversion

Visitors, Converting Visitors and Conv. Rate (Visitors) count one path per visitor and are filled for GA4 export tables; use them with the path columns.

Credit adds up across rows, so a Bar tile of Conversions (Linear) by Channel is a linear attribution report.

Troubleshooting

SymptomFix
"Fill in ... first" when checkingA required field is empty. Fill the fields named in the message.
No conversions matchedThe event name or a condition does not match exactly. Check the spelling and case.
Many sessions with no channelThe channel field is often blank in the source. Pick another field, or expect a large (not set) row.
Days do not match GA4Set Report Days In to the GA4 property's time zone.
"Unknown time zone"Pick a zone from the Report Days In list.