Hey Growthbook team, I have a question regarding metrics which I hope you can help me understand. Just to clarify a few details of our setup, we have both the JS and PHP SDK setup successfully with
experiment_viewed
event setup and pushing through the DL into GA4 and into BigQuery. We also have the
gb_user_id
in the event pushing successfully for each unique session.
--
My question is, when we have an experiment setup and the
experiment_viewed
successfully firing with the correct experiment_id, variation_id and gb_user_id, do all the metrics for that experiment that are triggered based on GA4 events - e.g. add to cart, purchase need to have matching
gb_user_id
within the metric setup in GB? For example this is our current add_to_cart metric.
SELECT
(select value.string_value from unnest(user_properties) where key = 'gb_user_id') as consumer,
(select value.string_value from unnest(event_params) where key = 'page_location') as page_location,
event_name,
TIMESTAMP_MICROS(event_timestamp) as timestamp,
1 as value
FROM
`growthbook-377317`.`analytics_320607085`.`events_*`
WHERE
event_name = 'add_to_cart'
AND (select value.string_value from unnest(user_properties) where key = 'gb_user_id') is not null
AND ((_TABLE_SUFFIX BETWEEN '{{date startDateISO "yyyyMMdd"}}' AND '{{date endDateISO "yyyyMMdd"}}') OR
(_TABLE_SUFFIX BETWEEN 'intraday_{{date startDateISO "yyyyMMdd"}}' AND 'intraday_{{date endDateISO "yyyyMMdd"}}'))