Learn business growth with Google Analytics 4 Forums Google Analytics 4 How can I access the page URLs when analyzing user behavior in GA4? Reply To: How can I access the page URLs when analyzing user behavior in GA4?

  • Daniel

    Member
    15 February 2023 at 4:40 pm

    In Google Analytics 4 (GA4), some of the parameters like page_path are no longer sent automatically like they used to be in the previous Universal Analytics version. You’ll find that GA4 captures page_location by default which holds the full URL (including query parameters) of the page where the event was captured. You’ll need to implement custom tracking to capture page path separately. If you’re using Google Tag Manager, there are various methods to capture this data, for instance, you could set up a custom JavaScript variable to strip out the domain and just return the path. If you’re using gtag.js directly, you may need to implement additional JavaScript to capture this on the page_view event. Creating a custom event could potentially work as well, but before you do that, you’d have to consider what other default data you might lose by not utilizing the built-in page_view event and weighing out if it’s worth it. A more comprehensive solution would be modifying the tracking setup slightly to send the page path with the default page_view events.