Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITH
- ---added user_id compared to the query from
- flat_user_properties AS (
- select
- user_pseudo_id,
- event_timestamp,
- event_name,
- user_id,
- user_properties.key,
- user_properties.value.string_value,
- user_properties.value.int_value,
- user_properties.value.float_value,
- user_properties.value.double_value,
- user_properties.value.set_timestamp_micros,
- concat(user_pseudo_id,event_timestamp,event_name,dedup_id) as join_key
- from (
- select
- row_number() over(partition by user_pseudo_id, event_timestamp, event_name) as dedup_id,
- *
- from
- -- change this to your google analytics 4 export location in bigquery
- `uptimerobot-001.analytics_220800152.events_*`
- where
- -- define static and/or dynamic start and end date
- _table_suffix between '20220805' and '20220927'),
- unnest(user_properties) as user_properties
- ),
- /*list of users from GA4 completed G4 with ABTestVariant dimenssion*/
- ABTest as
- (SELECT
- user_id,
- event_name,
- key,
- string_value as ABTestVariant,
- event_timestamp
- FROM
- flat_user_properties
- WHERE
- key = "ABTest2"
- AND event_name LIKE ("G4_First_Subscription_Paid")
- )
- SELECT
- *
- FROM ABTest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement