Search code examples
filtergoogle-analyticsgoal-tracking

Goal not working with pagePath filter in Analytics API


I would like to find the conversion rates for one of my goals. However, I just want to see the results based on pages with "profile/" in the URL. I've tried using the following filter separately in the Analytics API add-on for Google sheets: ga:pagePath=@profile/ or ga:pagePath=~profile

The filter works, but I don't get any conversion hits. Can anyone help?

Thanks, Josh


Solution

  • Unless your goal actually is the page with the path of /profile you should use a segment rather than a filter. The difference is that a segment will give you the visits that include (exclude etc. depending on the conditions for you segment) visitors via the profile page, whereas a filter will only include pageviews to the exact /profile page.

    So you are looking for a segment definition like

    sessions::condition::ga:pagePath==/profile
    

    This will limit the data to sessions that have at some point visited the profile page (but will also show what happenend before and after).

    A more convinient way to get your segment definition is to define the segment in the GA interface, then head over to the query explorer and select your newly created segment via the segments dropdown. You can copy it from there (either by id or you can copy the segment definition if you click the checkbox below the dropdown).