cuddly-journalist-11507
04/13/2023, 4:13 PMpurchase
with GA4 as the data source?
I added SQL below, and I got an error and I don't know how to fix.
What I'm doing wrong?
SELECT
user_id,
user_pseudo_id as anonymous_id,
TIMESTAMP_MICROS(event_timestamp) as timestamp,
event_value_in_usd as value
FROM
`azos-data`.`analytics_262365471`.`events_*`
WHERE
event_name = 'purchase'
AND value_param.key = 'value'
AND _TABLE_SUFFIX BETWEEN '{{startYear}}{{startMonth}}{{startDay}}' AND '{{endYear}}{{endMonth}}{{endDay}}'
fresh-football-47124
cuddly-journalist-11507
04/14/2023, 3:51 PMfresh-football-47124
cuddly-journalist-11507
04/17/2023, 3:39 PMSELECT
user_id,
user_pseudo_id as anonymous_id,
TIMESTAMP_MICROS(event_timestamp) as timestamp,
event_params.value.string_value AS page_location,
1 as value
FROM
`azos-data`.`analytics_262365471`.`events_*`,
UNNEST(event_params) AS event_params
WHERE
event_name = 'page_view'
AND event_params.key = 'page_location'
AND event_params.value.string_value LIKE '%GOOGLE.com%'
AND _TABLE_SUFFIX BETWEEN '{{startYear}}{{startMonth}}{{startDay}}' AND '{{endYear}}{{endMonth}}{{endDay}}'