0
I need to collect only the last hitnumber per visitID in a query from a Google database Analytics via google big query. Below follows my current code. I have reached the point of ordering the query where the maximum hitnumber appears first by visitId.
SELECT
visitNumber,
visitId,
date,
hitNumber,
device.operatingSystem,
device.operatingSystemVersion,
device.mobileDeviceBranding,
device.screenResolution,
appInfo.exitScreenName,
appInfo.screenName,
eventInfo.eventCategory,
eventInfo.eventAction,
eventInfo.eventLabel,
FROM `nomeConta.idConta.ga_sessions_yyyymmdd`
CROSS JOIN UNNEST (hits)
WHERE appInfo.exitScreenName = "nomeTelaErro"
and appInfo.screenName like "%identificacaoTela%"
and date >= 'yyyymmdd'
order by visitID, hitNumber DESC
It worked great, thank you very much!
– Juliana Pereira de Souza