https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
a

alert-state-22242

12/20/2023, 1:03 PM
Im noticing a little difference in the amount of unique users between BQ and the growthbook UI (I am counting user_pseudo_ids in BQ). This along with a slight difference in my metrics as well. Is this to be expected?
This is the query btw:
Copy code
WITH ExperimentSessions AS (
  SELECT
    CONCAT(
      (SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id'),
      user_pseudo_id
    ) AS session_id,
    (SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'variation_id') AS variation_id,
    user_pseudo_id
  FROM
    `xyz.events_202312*`
  WHERE
    _TABLE_SUFFIX BETWEEN '13' AND '18'
    AND event_name = 'experiment_viewed'
  GROUP BY
    session_id, variation_id, user_pseudo_id
)

, counts AS (
  SELECT
    ES.session_id,
    ES.variation_id,
    COUNTIF(E.event_name = 'page_view') AS page_view_count,
    COUNTIF(E.event_name = 'ge_bort') AS ge_bort_count,
    COUNT(DISTINCT ES.user_pseudo_id) AS unique_user_count
  FROM
    ExperimentSessions ES
  JOIN
    `xyz.events_202312*` E
  ON
    ES.session_id = CONCAT(
        (SELECT value.int_value FROM UNNEST(E.event_params) WHERE key = 'ga_session_id'),
        E.user_pseudo_id
    )
  WHERE
    E._TABLE_SUFFIX BETWEEN '13' AND '18'
  GROUP BY
    ES.session_id, ES.variation_id
)

SELECT
  variation_id,
  SUM(counts.page_view_count) AS page_views,
  SUM(counts.ge_bort_count) AS ge_bort_count,
  SUM(counts.unique_user_count) AS unique_users
FROM counts
WHERE variation_id IS NOT NULL
GROUP BY 1
h

helpful-application-7107

12/20/2023, 3:37 PM
You can click "View Queries" in the top right of the results table in GrowthBook to see the query we execute to inspect if there are any differences that stand out to you. I'm also happy to take a look if you want to share it here.
a

alert-state-22242

12/22/2023, 7:29 AM
Appreciate it Luke! I will get back to you on tuesday! Busy with christmas planning etc! Happy holidays! @helpful-application-7107
4 Views