Learn business growth with Google Analytics 4 Forums Google Analytics 4 How can the application version be included in Google Analytics 4 Measurement Protocol?

  • How can the application version be included in Google Analytics 4 Measurement Protocol?

    Posted by Casey on 29 April 2022 at 2:21 am

    Hey there, I’m currently working on transitioning from Google Analytics 3 to 4 for my Electron application. I’ve run into a bit of a snag since the ‘gtag’ method doesn’t work when the application is built, probably an issue with the app:// URL. So, I’ve decided to use the same work-around we did for Google Analytics 3, the measurement protocol.

    I can send events successfully which is great, but unfortunately I can’t seem to get the application name and version attached to these events. I’ve been fiddling around with various naming variants for the user properties such as ‘application_version’ or ‘applicationVersion’, but I haven’t found the magic combination that seems to work.

    I’ve included a snippet of my code for reference.

    Notice how I’m trying to attach the app version and name to the ‘user_properties’?

    Here:

    user_properties: {
        app_version: { value: "1.0.8-test" },
        app_name: { value: "Test" },
      },

    I’ve started to question whether it’s even feasible to send an app version through the Measurement Protocol API. It mostly seems to be designed to enrich events sent through gtag or the Firebase lib. If anyone’s dealt with this before or knows what I might be doing wrong, I’d appreciate the help!

    Emily replied 1 year ago 3 Members · 2 Replies
  • 2 Replies
  • George

    Member
    12 November 2022 at 8:50 pm

    Unfortunately, the current version of Google Analytics 4 doesn’t allow populating existing parameters like Application Name and App Version through the Measurement Protocol. However, the silver lining is that GA4 is still evolving, and this feature may be added in the future.

    For now, the workaround is to declare custom parameters for app_name and app_version. Once you’ve done that, you can align these new parameters with custom Dimensions inside the GA4 interface. It’s not a perfect solution, but it’s currently the only way to get the job done in GA4.

  • Emily

    Member
    1 July 2023 at 4:08 am

    Yes, you can send an app version through the Google Analytics Measurement Protocol API. However, it’s important to note that the way user properties are defined and utilized in Google Analytics 4 is different than previous versions. User properties in GA4 are typically registered and managed in the GA4 UI, so it appears they must be predefined before they can be attached to events or used in filters. To have the application name and version attached to the events, you need to first register these properties (app_name and app_version) in the GA4 UI. This is a change from previous versions where you could just send these properties with your hits without previously defining them. If you have already registered these properties and they are not showing up, it could be due to a data delay in GA4 or potential issues with the way these properties are defined in your code. There is also the chance of an error or delay with the Measurement Protocol API data being processed or appearing in your reports. It may take up to 24 hours for this data to appear.

Log in to reply.