Fabio Zecchini
Fabio Zecchini

Reputation: 21

Google Analytics access via API but webProperties empty

I'm expecting issue on accessing my GA account via API. As you can see from the response the entity webProperties is empty also if I have all permission and scopes active .

{
  "kind": "analytics#accountSummaries",
  "username": "[email protected]",
  "totalResults": 1,
  "startIndex": 1,
  "itemsPerPage": 1000,
  "items": [
    {
      "id": "183028779",
      "kind": "analytics#accountSummary",
      "name": "Libra Factory B.V.",
      "webProperties": []
    }
  ]
}

Also using https://ga-dev-tools.appspot.com/account-explorer/ it only show account but no property. Being the account part of an Google Workplace organization, is there anything I need to enable in the organization panel to enable Google API ?

Thanks in advance for any help. Fabio

Upvotes: 2

Views: 1052

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116918

The web property is empty because your account is GA4 and not universal analytics. Ga4 accounts dont have web properties.

You are also using the account summaries call from the management api which is for use with universal analytics not GA4.

You should try using the admin api which is designed for use with Ga4 accounts.

GET https://analyticsadmin.googleapis.com/v1alpha/accountSummaries

Upvotes: 3

Related Questions