Skip to main content

Attribution

This SQL query helps you understand how different channels contribute to new business deals and their associated value.

SELECT
session.channel,
sum(a.weight) deals,
sum(a.value) value
FROM
`table.attribution` AS r,
UNNEST(attribution) AS a
WHERE
a.model = 'Data-Driven'
AND r.stage.name = 'NewBiz'
AND timestamp >= '2025-05-01'
AND timestamp < '2025-06-01'
group by session.channel
order by deals desc

This SQL query provides a detailed breakdown of new business performance by both channel and source, using a data-driven attribution model

SELECT
session.channel,
session.source,
COUNT(DISTINCT dd_stage_id) AS influenced_prospects,
SUM(attr.value) AS total_value,
SUM(attr.weight) AS attributable_prospects
FROM
`table.attribution` AS a,
UNNEST(attribution) AS attr
WHERE
stage.name = 'NewBiz'
AND timestamp >= '2025-05-01'
AND timestamp < '2025-06-01'
AND attr.model = 'Data-Driven'
GROUP BY
channel,
SOURCE
ORDER BY
channel,
source