I am working in BigQuery to understand how many users complete a specific page path (at any point in the session). Lets say the page path is Page 1 -> Page 2 -> Page 3. The pages must be followed in sequential order. I am able to use BQ to establish a page path - but this method only works to identify users who reached those pages at any point in the session. For example, Page 1 -> Page 456 -> Page 2.
Any ideas?
(SELECT [date]
, CASE WHEN pages like '/Page1' then fullVisitorId end as [users]
, CASE WHEN pages like '/Page1>>/Page2' then fullVisitorId end as [path_users_2]
, CASE WHEN pages like '/Page1>>Page2>>Page3' then fullVisitorId end as [path_users_3]
, [path_type]
, [path]
, [product]
, [device.deviceCategory]
FROM
( SELECT [date]
, [fullVisitorId]
, [visitId]
, [visitNumber]
, group_concat(hits.page.pagePath,'>>') as [pages]
, 'New Pages' as [path_type]
, 'Upgrade' as [path]
, 'Professional' as [product]
FROM
(
TABLE_DATE_RANGE
( [XXXXXX.ga_sessions_]
, TIMESTAMP('2014-06-01')
, TIMESTAMP('2014-06-05') )
)
where
(REGEXP_MATCH(hits.page.pagePath,r'^/Page1($|/$|\?|/\?|%3F)'))
or (REGEXP_MATCH(hits.page.pagePath,r'^/Page2($|/$|\?|/\?|%3F)'))
or ( (REGEXP_MATCH(hits.page.pagePath,r'^/Page3($|/$|\?|/\?|%3F)'))
and hits.transaction.transactionId is not null
and hits.item.productSku is not null
and hits.item.itemRevenue is not null )
group each by [date]
, [fullVisitorId]
, [visitId]
, [visitNumber]
, [path_type]
, [path]
, [product]
, [device.deviceCategory]
)
group each by
[date]
, [path_type]
, [path]
, [product]
, [users]
, [path_users_2]
, [path_users_3]
, [device.deviceCategory]
)