Learn business growth with Google Analytics 4 Forums Google Analytics 4 'Sending page view location, referrer and user agent data to GA4 with measurement protocol'

  • 'Sending page view location, referrer and user agent data to GA4 with measurement protocol'

    Posted by Ella on 26 November 2022 at 1:56 pm

    I’m having a bit of trouble migrating my code from Universal Analytics to GA4. I was previously able to send data like the URL of the visited page, user agent, referral URL, and user IP using the measurement protocol. This allowed me to see details like page views per user, sessions per user, user location, device info, and the URL of the viewed page, including the referral URL on Google Analytics. Now, I’ve been following this particular guide (link provided), but I can only send an event_name and I’m not able to send the rest of the data. Can anyone guide me on how to include all the desired data while migrating to GA4?

    William replied 11 months, 2 weeks ago 3 Members · 2 Replies
  • 2 Replies
  • William

    Member
    5 January 2023 at 12:28 pm

    Certainly! It’s not uncommon to face a hiccup or two when migrating from Universal Analytics to GA4, especially with the measurement protocol currently being slightly limited. This just means that you won’t be able to send over all the types and amount of data you used to, at least for now.

    Got some feedback about this? Great – the Google Analytics team could use it. You can quickly share your thoughts via this [support form](https://developers.google.com/analytics/devguides/support). Your voice matters and who knows? It might just tip the balance to speed up the process. It’s all a part of the ride, so enjoy the journey as we navigate through these evolving technologies together.

  • William

    Member
    16 April 2023 at 5:53 am

    In GA4, you can send event data using the Measurement Protocol API and add different parameters to gather the desired data. However, GA4 does not need to send user agent, referral URL, and user IP data in the same way as Universal Analytics. This data is collected automatically. To track user interactions more granularly, you can create custom events and parameters. For example, you can send a ‘page_view’ event and add parameters to the event to include data like the page’s URL. It might be different from the way Universal Analytics operates, but GA4 is designed to provide a richer set of reports to describe your users’ behavior. Be aware that you might need to adjust your implementation or potentially use Google Tag Manager to gather the desired data. Make sure to refer to the GA4 documentation for details on using the Measurement Protocol API and setting up custom events and parameters.

Log in to reply.