How to see three-step paths in the navigation flow
Hover a page on the left of the flow and see where visitors who came from it went next.
GA4 only records pairs: "A went to B" and "B went to C". It does not know where people who came from A and saw B went afterwards. A small script sends the previous two pages with every page view as a nav_step event; seops uses it to draw A → B → C with real data.
Do first: How to connect Google Analytics 4
What opens in seops
- 4 · Tracking › Traffic › Navigation › Flow: hover a page on the left and only that path lights up on the right
- Your assistant (get_navigation) can read the most common three-step paths
- No cookie; only sessionStorage, cleared when the tab closes
Steps
-
Custom dimension 1: previous page
In Analytics: Admin (gear) → Data display → Custom definitions → Create custom dimension. Dimension name
prev_pathPrevious page. Scope Event. Event parameterprev_path. Save. -
Custom dimension 2: page before that
Same screen, Create custom dimension again. Name
prev2_pathPage before previous. Scope Event. Event parameterprev2_path. Save. -
Add the script to the site
It must run on every page after GA4. With Cloudflare Zaraz it sends through
zaraz.track, otherwise throughgtag. On WordPress paste it in the footer with a code-snippet plugin. On your own site, telling your coding agent "add the nav_step snippet from seops" is enough.<script> // seops · three-step navigation (Traffic › Navigation › Flow). Run on every page, after GA4. (function () { try { var S = sessionStorage, h = JSON.parse(S.getItem("nav_hist") || "[]"), c = location.pathname, r = ""; try { var u = new URL(document.referrer); if (u.host === location.host) r = u.pathname; } catch (e) {} if (h[h.length - 1] === c) return; // reload if (r && r !== c) { var p = { prev_path: r.slice(0, 100), prev2_path: (h[h.length - 1] === r ? h[h.length - 2] || "(entry)" : "(unknown)").slice(0, 100) }; if (window.zaraz && zaraz.track) zaraz.track("nav_step", p); else if (window.gtag) gtag("event", "nav_step", p); } S.setItem("nav_hist", JSON.stringify(r ? [r, c] : [c])); } catch (e) {} })(); </script> -
Using Zaraz? Forward the event to GA4
In Cloudflare: Zaraz → Tools → Google Analytics 4 → Actions → Create action. Trigger: Create trigger with rule
{{ client.__zarazTrack }}Equalsnav_step. Action type Event, event namenav_step. Add field twice:prev_path={{ client.prev_path }},prev2_path={{ client.prev2_path }}. Save. -
Check
Browse a few pages on your site. In GA4 → Reports → Realtime the
nav_stepevent should appear. The flow in seops starts filling within a day; custom dimensions only cover data from the day they were created.
How to use it in seops
- 4 · Tracking › Traffic › Navigation: pick a page, hover a page on the left of the flow
- If no data arrives for a while, the Status line under the card says why
Questions
"Custom dimensions not defined"
The parameter names in steps 1 and 2 must be exactly prev_path and prev2_path, scope Event.
"No nav_step data yet"
The script isn't running or the event isn't reaching GA4 (Zaraz action). Look for the event in the Realtime report.
What is "(unknown)"?
The visitor opened the page in a new tab; the previous step isn't known in that tab.