I would like to count the number of events occurring on a specific page, given a Previous Page Path.
It doesn't seem to be possible neither with Behaviour>Events report nor with custom report.
Could anyone recommend a way to achieve the above?
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.Sign up to join this community
Unfortunately this isn't possible. I did some experiments using the API in Google Sheets. Using Event Category, Page, Previous Page Path, and Total Events, I got a "selected dimensions and metrics cannot be queried together" error.
If you remove Page, you still get an error. If you remove Event Category, you get data for Page, Previous Page Path, and Total Events, but in every row the values for Page and Previous Page Path are the same. I couldn't tell you why this is permitted when the version without Page isn't, but it's not helpful anyway.
[My two hypotheses were: "previous page path is a connection made GA-side that only involves pageview hits" and "previous page path exists for every hit but is always the most recent pageview hit, so for events it's the same page." The connection is certainly made GA-side, but beyond that the evidence doesn't make me feel like I can fully accept or reject either one.]
You could probably estimate the count by seeing what percentage of pageviews of Page 2 (let's call it) were preceded by pageviews of Page 1 and taking that percentage of Total Events on Page 2.
For more accuracy make that calculation only within the following sequence segment:
Filter sessions starting with any user interaction Step 1: Page contains [page 1] is immediately followed by Step 2: Page contains [page 2]
If it is hard to get to Page 2 other than from Page 1, or people are unlikely to go to Page 2 more than once in a session, your estimate should be pretty accurate.