Reputation: 363
When looking at Goal Funnel report in the Google Analytics website. I can see not only the number of goal starts and completion but also how many visits to each step.
How can I find the step data through the Google Analytics API?
I am testing with the query explorer and testing on a goal with 3 steps, which 1st step marked as Required
I was able to get the start and completion by running by using goalXXStarts and goalXXCompletions:
However I can't figure out a way to get the goal second step data.
I tried using ga:users
or ga:uniquePageViews
with the URL of the step 2, and previousPagePath as step 1 (required = true) and add to that the ga:users
or ga:uniquePageViews
from the next stage with ga:previousPagePath
of step 1 (since its required=true) for backfill.
I also tried other combinations, but could never reach the right number or close to it.
Upvotes: 3
Views: 739
Reputation: 186
One technique that can be used to perform conversion funnel analysis with the Google Analytics Core Reporting API is to define a segment for each step in the funnel. If the first step of the funnel is a 'required' step, then that step must also be included in segments for each of the subsequent steps.
For example, if your funnel has three steps named A, B, and C, then you will need to define a segment for A, another for B, and another again for C.
If step A is required then:
Otherwise, if step A is NOT required then:
To obtain the count for each step in the funnel, you perform a query against each segment to obtain the number of sessions
where that segment matches. Additionally, you can query the previous and next pages, including entrances and exits, for each step (if you need to); in which case, query previousPagePath
and pagePath
as dimensions along with metrics uniquePageviews
, entrances
and exits
. Keep in mind the difference between 'hit-level' vs 'session-level' data when performing, constructing and interpreting the results of each query.
You can also achieve similar results by using sequential segmentation which will offer you finer control over how the funnel steps are counted, as well as allowing for non-sequential funnel analysis if required.
Upvotes: 0