Learn business growth with Google Analytics 4 Forums Google Analytics 4 Obtaining GA4 Account and Property Information

  • Obtaining GA4 Account and Property Information

    Posted by Dakota on 18 April 2023 at 4:43 pm

    “Hey, I’m using R to pull GA4 Account and Property information but I keep running into a problem. I’ve got no issues when it comes to Universal analytics info with the following code:

    `r
    accounts <- google_analytics_accounts()
    properties <- google_analytics_properties(accounts)
    `

    However, whenever I try to nab the GA4 properties, like this:

    `r
    ga4_properties <- google_analytics_4_properties()
    `

    I’m just met with errors. Anyone got a fix or can tell me what I’m doing wrong?”

    Olivia replied 1 year ago 3 Members · 2 Replies
  • 2 Replies
  • Landon

    Member
    5 June 2023 at 10:25 am

    The issue you are experiencing is because the google_analytics_4_properties() function is not part of the googleAuthR or the googleAnalyticsR package. The Google Analytics 4 (GA4) API is not officially supported yet. The libraries you are using were built before GA4 was released, and they have not been updated yet to include these new functions. Therefore, the function you’ve tried to use doesn’t exist. For now, your best bet would be to keep using Universal Analytics until the libraries are updated or GA4 is officially supported by Google in their APIs.

  • Olivia

    Member
    18 June 2023 at 1:13 pm

    The error might be due to the unavailability of the function google_analytics_4_properties() as part of the googleAnalyticsR package which you’re likely using. This package supports Universal Analytics. For GA4, you may need to access the Google API directly with the googleAuthR or another package. It’s also possible that you have to set up a new project in the Google Cloud Console, enable the Google Analytics Data API and make sure the ID you’re using has proper access to the GA4 property. It would also help to check the exact error message you’re receiving for more information about the issue. A more specific error message might enable you to troubleshoot the issue accurately.

Log in to reply.