【问题标题】:GA4 traffic source data do not match with bigqueryGA4流量源数据与bigquery不匹配
【发布时间】:2022-12-21 00:55:32
【问题描述】:

我尝试从 bigquery 导出流量源数据和事件归因并与 GA4(session_source 和 session_medium)匹配 我从 bigquery 中提取事件参数(源广告媒体),但两个数据源之间存在很大差距

有解决办法吗?

我尝试在 SQL 下面使用


with prep as (
select
    user_pseudo_id,
    (select value.int_value from unnest(event_params) where key = 'ga_session_id') as session_id,
    max((select value.string_value from unnest(event_params) where key = 'source')) as source,
    max((select value.string_value from unnest(event_params) where key = 'medium')) as medium,
    max((select value.string_value from unnest(event_params) where key = 'name')) as campaign,
    max((select value.string_value from unnest(event_params) where key = 'term')) as term,
    max((select value.string_value from unnest(event_params) where key = 'content')) as coXXntent,
    platform,
FROM `XXX` 
group by
    user_pseudo_id,
    session_id,
    platform
)

select
    -- session medium (dimension | the value of a medium associated with a session)
    platform,
    coalesce(source,'(none)') as source_session,
    coalesce(medium,'(none)') as medium_session,
    coalesce(campaign,'(none)') as campaign_session,
    coalesce(content,'(none)') as content,
    coalesce(term,'(none)') as term,
    count(distinct concat(user_pseudo_id,session_id)) as sessions
from
    prep
group by
    platform,
    source_session,
    medium_session,
    campaign_session,
    content,
    term
order by
    sessions desc

【问题讨论】:

    标签: google-bigquery google-analytics-4


    【解决方案1】:

    我也在尝试弄清楚为什么 BigQuery 无法正确匹配事件的来源和媒介。我发现的问题是,即使链接中有 gclid 参数,它也会将源/媒体指定为 google/organic。第二个问题是在将来源识别为直接来源方面存在巨大缺陷——在这种情况下,我根本没有这些事件参数。

    这些值是有效的,但仅适用于获取用户的来源和媒体。

    当我比较 UA 和 GA4 中的数据时,会话归因是正确的。所以在导出到 BigQuery 时看起来像是一个问题。我将此事报告给支持部门,正在等待回复。

    【讨论】:

      【解决方案2】:

      我还注意到来源/媒体在 BigQuery 和 GA4 之间不一致,就像 Justyna 评论的那样,我的很多来源/媒体都是通过 google/organic 获得的,即使它们不是。我希望 Justyna 在有解决方案时会在这里发布。

      查看您的代码,我可以看到另外 2 个会导致差异的区域

      1)

      count(distinct concat(user_pseudo_id,session_id)) as sessions
      

      这将只捕获具有有效 pseudo_id 和 session_id 的事件,这是正确的计数方式,但在我的数据中往往有一些没有 id 的事件为空,所以你的会话计数包括它们但 GA4 确实如此。所以使用你的首选如果这对您来说是个问题,则计算空值的方法。

      2): 您还进行了精确计数,这也是正确的,但 GA4 进行了近似匹配,请参阅下面的链接了解详细信息。

      https://developers.google.com/analytics/blog/2022/hll#using_bigquery_hll_functions_with_google_analytics_event_data

      使用以上两种技术,我可以更接近 GA4 会话数,但它们仍然没有正确归因

      【讨论】:

        猜你喜欢
        • 2023-01-31
        • 1970-01-01
        • 1970-01-01
        • 2022-06-17
        • 2023-01-17
        • 1970-01-01
        • 2023-01-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多