flaky-glass-97366
03/04/2025, 5:46 PMnumerous-glass-72216
03/09/2025, 3:13 PMhelpful-glass-76730
03/10/2025, 10:40 AMgifted-angle-45680
03/13/2025, 12:14 PMnarrow-lifeguard-42299
03/18/2025, 5:20 PMjolly-oil-48997
03/19/2025, 8:32 AMcategory_button_click
GA event where the its attribute is entryPoint
= that has value as productTile
But currently it gives me main_sum_square
in the experiment.
Ideally I should get the total count of the category_button_click
event where the event param is productTile
The combined query is
-- DEV Secondary Metrics - category_button_click where the attribute is entryPoint = productTile (count)
WITH
__rawExperiment AS (
SELECT
user_id as user_id,
TIMESTAMP_MICROS(event_timestamp) as timestamp,
experiment_id_param.value.string_value AS experiment_id,
variation_id_param.value.int_value AS variation_id,
geo.country as country,
traffic_source.source as source,
traffic_source.medium as medium,
device.category as device,
device.web_info.browser as browser,
device.operating_system as os
FROM
`axinan-dev`.`analytics_320528630`.`events_*`,
UNNEST (event_params) AS experiment_id_param,
UNNEST (event_params) AS variation_id_param
WHERE
(
(_TABLE_SUFFIX BETWEEN '20250313' AND '20250319')
OR (
_TABLE_SUFFIX BETWEEN 'intraday_20250313' AND 'intraday_20250319'
)
)
AND event_name = 'experiment_viewed'
AND experiment_id_param.key = 'experiment_id'
AND variation_id_param.key = 'variation_id'
AND user_id is not null
),
__experimentExposures AS (
-- Viewed Experiment
SELECT
e.user_id as user_id,
cast(e.variation_id as string) as variation,
CAST(e.timestamp as DATETIME) as timestamp
FROM
__rawExperiment e
WHERE
e.experiment_id = 'get-quote-button'
AND e.timestamp >= '2025-03-13 00:00:00'
AND e.timestamp <= '2025-03-19 04:26:17'
),
__experimentUnits AS (
-- One row per user
SELECT
e.user_id AS user_id,
(
CASE
WHEN count(distinct e.variation) > 1 THEN '__multiple__'
ELSE max(e.variation)
END
) AS variation,
MIN(e.timestamp) AS first_exposure_timestamp
FROM
__experimentExposures e
GROUP BY
e.user_id
),
__distinctUsers AS (
SELECT
user_id,
cast('' as string) AS dimension,
variation,
first_exposure_timestamp AS timestamp,
date_trunc(first_exposure_timestamp, DAY) AS first_exposure_date
FROM
__experimentUnits
),
__metric as ( -- Metric (DEV Secondary Metrics - category_button_click where the attribute is entryPoint = productTile)
SELECT
user_id as user_id,
m.value as value,
CAST(m.timestamp as DATETIME) as timestamp
FROM
(
SELECT
user_id,
user_pseudo_id AS anonymous_id,
TIMESTAMP_MICROS(event_timestamp) AS timestamp,
value_param.value.int_value as value
FROM
`axinan-dev.analytics_320528630.events_*`,
UNNEST (event_params) AS value_param
WHERE
event_name = 'category_button_click'
AND EXISTS (
SELECT
1
FROM
UNNEST (event_params) AS ep2
WHERE
ep2.key = 'entryPoint'
AND ep2.value.string_value = 'productTile'
)
AND EXISTS (
SELECT
1
FROM
UNNEST (event_params) AS ep3
WHERE
ep3.key = 'url'
AND ep3.value.string_value LIKE '%staging%'
)
AND (
(_TABLE_SUFFIX BETWEEN '20250313' AND '20250319')
OR (
_TABLE_SUFFIX BETWEEN 'intraday_20250313' AND 'intraday_20250319'
)
)
) m
WHERE
m.timestamp >= '2025-03-13 00:00:00'
AND m.timestamp <= '2025-03-19 04:26:17'
),
__userMetricJoin as (
SELECT
d.variation AS variation,
d.dimension AS dimension,
d.user_id AS user_id,
(
CASE
WHEN m.timestamp >= d.timestamp
AND m.timestamp <= '2025-03-19 04:26:17' THEN m.value
ELSE NULL
END
) as value
FROM
__distinctUsers d
LEFT JOIN __metric m ON (m.user_id = d.user_id)
),
__userMetricAgg as (
-- Add in the aggregate metric value for each user
SELECT
umj.variation AS variation,
umj.dimension AS dimension,
umj.user_id,
SUM(COALESCE(value, 0)) as value
FROM
__userMetricJoin umj
GROUP BY
umj.variation,
umj.dimension,
umj.user_id
)
-- One row per variation/dimension with aggregations
SELECT
m.variation AS variation,
m.dimension AS dimension,
COUNT(*) AS users,
SUM(COALESCE(m.value, 0)) AS main_sum,
SUM(POWER(COALESCE(m.value, 0), 2)) AS main_sum_squares
FROM
__userMetricAgg m
GROUP BY
m.variation,
m.dimension
and the query that i had created to extract the data is
SELECT
user_id,
user_pseudo_id AS anonymous_id,
TIMESTAMP_MICROS(event_timestamp) AS timestamp,
value_param.value.int_value as value
FROM
`axinan-dev.analytics_320528630.events_*`,
UNNEST(event_params) AS value_param
WHERE
event_name = '{{eventName}}'
AND EXISTS (
SELECT 1
FROM UNNEST(event_params) AS ep2
WHERE ep2.key = 'entryPoint' AND ep2.value.string_value = 'productTile'
)
AND EXISTS (
SELECT 1
FROM UNNEST(event_params) AS ep3
WHERE ep3.key = 'url' AND ep3.value.string_value LIKE '%staging%'
)
AND ((_TABLE_SUFFIX BETWEEN '{{date startDateISO "yyyyMMdd"}}' AND '{{date endDateISO "yyyyMMdd"}}') OR
(_TABLE_SUFFIX BETWEEN 'intraday_{{date startDateISO "yyyyMMdd"}}' AND 'intraday_{{date endDateISO "yyyyMMdd"}}'))
Help will be really appreciated.little-balloon-64875
03/24/2025, 1:28 PM3.1M
. Which seems insane. Trying to figure out why this is so high and how to debug, prior to setting up some sort of proxy or CDN on our own.average-whale-33542
03/24/2025, 7:36 PMripe-dinner-7830
03/27/2025, 2:54 PMgorgeous-london-26565
03/31/2025, 12:27 PMsetUrl
in the growthbook API), we expect the experiment to be applied.
But it is only applied when the page with the experiment is the landing page. Do anyone have experience with an issue like that?
More context can be found here:
https://github.com/growthbook/growthbook/issues/3873jolly-oil-48997
03/31/2025, 1:10 PMcategory_button_click
events triggered via GA4 between March 18th and March 31st.
The metric has the custom query
SELECT
user_id,
user_pseudo_id AS anonymous_id,
TIMESTAMP_MICROS(event_timestamp) AS timestamp,
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'entryPoint') AS entryPoint,
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'url') AS url,
1 as value
FROM
`axinan-prod`.`analytics_323303173`.`events_*`,
UNNEST(event_params) AS value_param
WHERE
event_name = '{{eventName}}'
AND EXISTS (
SELECT 1
FROM UNNEST(event_params) AS ep2
WHERE ep2.key = 'entryPoint' AND ep2.value.string_value = 'productTile'
)
AND ((_TABLE_SUFFIX BETWEEN '{{date startDateISO "yyyyMMdd"}}' AND '{{date endDateISO "yyyyMMdd"}}') OR
(_TABLE_SUFFIX BETWEEN 'intraday_{{date startDateISO "yyyyMMdd"}}' AND 'intraday_{{date endDateISO "yyyyMMdd"}}'))
QUALIFY ROW_NUMBER() OVER (PARTITION BY event_timestamp ORDER BY event_timestamp) = 1
My query filters for events where eventName
is category_button_click
. When I execute this query directly in the Google BigQuery console, I obtain a count of 3326, as shown in the screenshot. However, when I attempt to retrieve the same count using a GrowthBook metric, I receive results for 'Count of users', main_sum
, and main_sum_squares
instead of the expected count of category_button_click
events with the parameter entryPoint
equal to 'productTile'. How can I configure the GrowthBook metric to return the correct event count?
Any help will be really appreciated.loud-guitar-35849
04/02/2025, 1:47 AMclean-dentist-82655
04/03/2025, 2:52 PMsalmon-lamp-78940
04/09/2025, 10:59 AMflat-park-58308
04/10/2025, 6:04 PMshy-river-35647
04/10/2025, 6:22 PM-re
appended.. But in the data warehouse we still see traffic with old name <test_name>.. Is this expected ? We were trying to find traffic with the new key but no data was found.. Wanted to confirm if using the old experiment key would still re-bucket the users..colossal-ability-68565
04/14/2025, 7:28 PMreturn
field ("error"
).
3. However, the value returned by GrowthBook does not match the expected result calculated directly in BigQuery using the same logic.
BigQuery Reference Query
sql
WITH fact_table AS (
SELECT
e.user_id,
e.user_pseudo_id AS anonymous_id,
TIMESTAMP_MICROS(event_timestamp) AS timestamp,
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'description') AS description,
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'socialNetworkName') AS socialNetworkName,
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'return') AS return
FROM
`******.analytics_2********2.events_*` e
WHERE
event_name = "connection_social_network"
AND (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'socialNetworkName') = "facebook"
AND (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'socialNetworkName') IS NOT NULL
AND (
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'return') = 'success'
OR (
(SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'return') = 'error'
AND (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'description') IS NOT NULL
)
)
AND _TABLE_SUFFIX BETWEEN FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
AND FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY))
)
SELECT
DATE(timestamp, 'America/Sao_Paulo') AS dia,
COUNTIF(return = 'error') AS numerador,
COUNT(*) AS denominador,
ROUND(COUNTIF(return = 'error') / COUNT(*) * 100, 2) AS percent_error,
ROUND(COUNTIF(return = 'success') / COUNT(*) * 100, 2) AS percent_success
FROM fact_table
GROUP BY dia
ORDER BY dia DESC;
GrowthBook Setup
• Fact Table: Filter Instagram connections
• Filters:
▪︎ event_name = "connection_social_network"
▪︎ socialNetworkName = "facebook"
▪︎ return = "error"
or "success"
▪︎ description IS NOT NULL
• Metric Type: Ratio
◦ Numerator: Count of rows where return = "error"
◦ Denominator: Total count of rows after experiment exposure
• Metric Goal: Decrease metric value
👉 Please refer to the attached screenshots for the exact configuration:
• Fact Table SQL setup
• Metric configuration
• SQL preview from GrowthBook
Issue
Despite replicating the logic between BigQuery and GrowthBook, the metric result shown inside GrowthBook doesn’t match the output from BigQuery. I suspect it might be related to:
• Differences in default time zones
• Filter logic timing (e.g., timestamp >= exposure_timestamp
)
• Unseen row filtering nuances
What I Need
Help verifying:
1. Whether my metric configuration matches the logic from BigQuery correctly.
2. If there are any known nuances with how GrowthBook processes time ranges or filters that could explain the mismatch.
3. Suggestions to ensure alignment between GB metrics and BQ calculations.
Thanks in advance! Let me know if you need more information.
Best,
Pedrowitty-laptop-42616
04/25/2025, 7:21 AMbillions-motorcycle-11145
05/06/2025, 5:43 PMlate-dentist-52023
05/07/2025, 12:57 AMlittle-balloon-64875
05/16/2025, 10:39 AMlively-tiger-66465
05/19/2025, 3:39 PMlittle-balloon-64875
05/19/2025, 5:05 PMwitty-laptop-42616
06/03/2025, 6:56 AMpolite-rainbow-93528
06/13/2025, 12:55 PMpurple-art-11901
06/23/2025, 7:16 PMnumerous-machine-2736
07/10/2025, 9:05 PMcreamy-breakfast-20482
07/22/2025, 1:16 PMlate-ambulance-66508
07/27/2025, 10:21 AMlate-ambulance-66508
07/28/2025, 8:42 AM