简体   繁体   中英

Get List hits.eventInfo.eventAction in Google Analytics BigQuery

I want to get list hits.eventInfo.eventAction in Google Analytics data via BigQuery using this code:

SELECT DISTINCT hits.eventInfo.eventAction FROM `ga_sessions_*`

But the error like this:

Cannot access field eventInfo on a value with type ARRAY<STRUCT<hitNumber INT64, time INT64

I try to add UNNEST(hits) but also error. Any suggestion?

Can you try the query below, I used UNNEST:

SELECT DISTINCT hits.eventInfo.eventAction FROM `bigquery-public-data.google_analytics_sample.ga_sessions_*`, UNNEST(hits) as hits

Output :

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM