首页 > 解决方案 > 在 BigQuery 中但在 Google Analytics 中没有包含小时-分钟组合的综合浏览量条目的原因是什么?

问题描述

我正在尝试查询 BigQuery 中特定页面的浏览量(使用 count(p.page.pagePath)),但 BigQuery 中的浏览量比 GA 中的浏览量更多。

在比较特定日期(10 月 10 日)的特定页面(页面标题 = Moteurs - Le Soir Plus)的小时-分钟组合时,我在 BigQuery 中获得了 GA 中不存在的小时-分钟组合。

这怎么可能?GA 是否不记录 BigQuery 所做的某些综合浏览量?

这是我使用的查询:

#standardSQL
CREATE TEMP FUNCTION
  customDimensionByIndex(indx INT64,
    arr ARRAY<STRUCT<index INT64,
    value STRING>>) AS ( (
    SELECT
      x.value
    FROM
      UNNEST(arr) x
    WHERE
      indx=x.index) );
SELECT distinct
  p.page.pageTitle,
  date,
  p.hour,
  p.minute,
  count(p.page.pagepath) as Pageviews
FROM
  `ga-ls-sw-233509.186661177.ga_sessions_*` AS st,
  UNNEST(hits) AS P
WHERE
  _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY))
  AND p.page.pageTitle = 'Moteurs - Le Soir Plus'
Group by
p.page.pageTitle,
date,
p.hour,
P.minute
ORDER BY
  p.hour DESC

以下是 10 月 10 日的两个输出(BQ 和 GA):

BQ:
Row page Title          date            hour    minute  Page views   
1   Moteurs - Le Soir Plus  20191010    16  13  1    
2   Moteurs - Le Soir Plus  20191010    16  14  1    
3   Moteurs - Le Soir Plus  20191010    16  16  1    
4   Moteurs - Le Soir Plus  20191010    14  29  1    
5   Moteurs - Le Soir Plus  20191010    14  32  1    
6   Moteurs - Le Soir Plus  20191010    11  19  1    
7   Moteurs - Le Soir Plus  20191010    11  20  1    
8   Moteurs - Le Soir Plus  20191010    9   17  1    
9   Moteurs - Le Soir Plus  20191010    9   24  1    
10  Moteurs - Le Soir Plus  20191010    8   18  1    
11  Moteurs - Le Soir Plus  20191010    8   23  1    
12  Moteurs - Le Soir Plus  20191010    8   24  1    
13  Moteurs - Le Soir Plus  20191010    8   29  1
14  Moteurs - Le Soir Plus  20191010    8   30  1
GA:
        Page Title          Date            Hour    Minute  Page views
1.      Moteurs - Le Soir Plus  20191010    16  13  1
2.      Moteurs - Le Soir Plus  20191010    16  14  1
3.      Moteurs - Le Soir Plus  20191010    14  29  1
4.      Moteurs - Le Soir Plus  20191010    11  19  1
5.      Moteurs - Le Soir Plus  20191010    09  17  1
6.      Moteurs - Le Soir Plus  20191010    08  18  1
7.      Moteurs - Le Soir Plus  20191010    08  23  1
8.      Moteurs - Le Soir Plus  20191010    08  29  1

前任。时分组合 16h16 存在于 BQ 但不存在于 GA 中。

标签: google-analyticsgoogle-bigquery

解决方案


据我所知,您计算的是hits不是 pageviews。确保P.type='PAGE'WHERE条款


推荐阅读