Learn business growth with Google Analytics 4 Forums Google Analytics 4 How to obtain user_pseudo_id using GA4 API?

  • How to obtain user_pseudo_id using GA4 API?

    Posted by Elizabeth on 25 June 2022 at 6:29 pm

    I was wondering if you know of a way to get the ‘user_pseudo_id’ field from the GA4 API? It’s funny because I noticed it wasn’t listed in the dimensions listed within the API documentation but, do you remember how the clientId for UA wasn’t listed either, yet we could still use it as a dimension? If you need a refresher, you can find more about this on this stackoverflow discussion.

    You see, my problem is, I have some historical GA4 data that I need to import into Google BigQuery, but unfortunately not all the fields I need for my export are readily available in the GA4 API. Does this dilemma sound familiar to you?

    Alexander replied 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Alexander

    17 December 2022 at 6:30 pm

    In simpler terms, your solution lies with Google Tag Manager. All you gotta do is pass the ‘user_pseudo_id’ as a custom user parameter there, and you just need to do it once. After that, all your GA4 tags will follow the path you set. There’s a useful tutorial link in your message that explains how to do this, so give that a whirl. This should help you import the GA4 data you need into Google BigQuery.

  • Alexander

    7 January 2023 at 5:37 pm

    Unfortunately, as of now, there’s no way to fetch the ‘user_pseudo_id’ through the GA4 API. While it’s true that the clientId for Universal Analytics (UA) wasn’t listed in the API documentation yet it was retrievable as a dimension, this isn’t the case for the ‘user_pseudo_id’ in GA4. If you have your GA4 data flowing into Google BigQuery, the ‘user_pseudo_id’ would normally be present there. However, you mentioned that you need to import GA4 data into BigQuery, but the missing dimensions are not available in the API which creates a troublesome situation. Unfortunately, this is a limitation set on GA4 API directly by Google.

Log in to reply.