You've successfully subscribed to GA4BigQuery
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.

How to replicate the 'Conversions | Goals | Reverse Goal Path' report

Join 2,600+ other professionals and receive a monthly newsletter packed with GA4 & BigQuery news, tips & tricks

Great! Check your inbox and click the link to confirm your subscription
Please enter a valid email address!
Already have an account? Sign in
This article is about GA3 - Universal Analytics

As a Google Analytics user you are probably quite attached to the default reports in the user interface of Universal Analytics. It can be hard to make sense of the data in the BigQuery export tables.

Let me enable you to replicate the reports you're familiar with. I'll try to keep it basic here.

Reverse Goal Path report

In the Conversions | Goals | Reverse Goal Path report you'll find data about goal completions, segmented by goal completion location and previous location steps 1, 2 and 3.

Let's query!

  count(distinct case when regexp_contains(goal_completion_location, r'/ordercompleted') then session_id else null end) as goal_1_completions,
  select as goal_completion_location,
    lag(, 1) over (partition by fullvisitorid, visitstarttime order by hits.hitnumber asc) as goal_previous_step_1,
    lag(, 2) over (partition by fullvisitorid, visitstarttime order by hits.hitnumber asc) as goal_previous_step_2,
    lag(, 3) over (partition by fullvisitorid, visitstarttime order by hits.hitnumber asc) as goal_previous_step_3,
    concat(cast(fullvisitorid as string),cast(visitstarttime as string)) as session_id
    unnest(hits) as hits
group by
  goal_completion_location not in (goal_previous_step_1, goal_previous_step_2, goal_previous_step_3) and goal_1_completions >= 1
order by
  goal_1_completions desc