Get a list of property IDs from Google Analytics Data API (GA4) - google-analytics-api

How do I go about enumerating the profile property IDs available as GA4 properties? I don't see any API endpoints for this in the documentation: https://developers.google.com/analytics/devguides/reporting/data/v1

Related

Is it possible to make an API call to link a GA4 and UA property in a Google Analytics account?

I am migrating to GA4 from Universal Analytics and am planning to create a script to make API calls to create the new GA4 properties as we have many properties.
However, in order to prevent Google from creating a duplicate property come March.
I would either need to connect the new GA4 property to its UA counterparts
or
Turn off the flag "Automatically set up a basic Google Analytics 4 property"
Is there a way to do either of these through an api? Or is the only option to do this manually through the Google Analytics UI?
I experimented with the apis available for property management and account management through the current api reference(v1beta) and was unable to find an api solution
https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/properties

How to access report data in a "App + Web" google analytics property using The Google Analytics Reporting API v4?

I have a Web+App google analytics property, and I need to access report data using The Google Analytics Reporting API v4. In the docs, the field viewId is required to build a ReportRequest object. But, in the new google analytics Web+App feature, you cannot create a view from the property.
For GA4 Properties, you need to use the Google Analytics Data API v1. See the devsite: https://developers.google.com/analytics/trusted-testing/analytics-data
App + Web Properties were recently renamed to GA4 Properties. See the blog post: https://blog.google/products/marketingplatform/analytics/new_google_analytics/.
The Google Analytics Reporting API v4 (https://developers.google.com/analytics/devguides/reporting/core/v4) accepts numeric view identifiers in report requests. GA4 Properties do not have views, and there is not a way to create views in those properties.
Unfortunately Reporting API v4 doesn't support App+Web properties for the exact reason you stated - the API only understands view ID's and not property ID's.
Looking at the documentation, it's noted there that it doesn't support your setup, however, they do have a tester program that allows you to test and provide feedback when it comes to new reporting features for properties like the one you use.
https://developers.google.com/analytics/devguides/reporting/core/v4

How to get Authenticated user's Google Ad Account ID using Google Ads API v0 using a REST API?

I have been trying to figure out after referring to their official documentation (Google Ads API Document) which is not clear enough
Here is what I have tried till now.
I have created an app where users can log in with their Google Ad words account. I need to fetch their Ad performance reports via REST API.
To make an API request to fetch performance reports, we need the Google Ad Words Account ID of the authenticated user. Currently, as I am testing it with my personal account, I can login to my Ad words Console and get the Ad Words Account ID. But, how do I fetch the Ad Words Account ID dynamically for other users who authenticate via my App?
I tried looking for a way in their official documentation. But I couldn't figure out.
Could someone help me with the REST API URL which needs to be called to fetch the authenticated user's Ad words Account ID.
In addition to previous answer, I guess this is what you are looking for:
https://developers.google.com/adwords/api/docs/guides/first-api-call#create_test_accounts
It explains how to setup Google Ad Words API and get your ID.
According to the documentation here Account overview, you need to list the customers to get the ID. For each user that logs in as long as they do not have access to multiple accounts you should get a single customer and their ID.
CustomerService
CustomerService provides information about your accounts. It has a
getCustomers() method that takes no arguments and returns a list of
Customer objects containing fields such as customerId, currencyCode,
and dateTimeZone. CustomerService also has a mutate() method that can
be used to update various attributes of a customer, including the
autoTaggingEnabled and conversionTrackingSetting fields.
If no clientCustomerId is specified in a request, the response will
contain multiple entries if more than one account is directly
accessible by the authenticated account.

Azure AD - Manage Group & User Assignments

I am an Azure Global Tenant Admin for our [Premium] Azure AD instance. I have a Web App that requires Group/User Assignment to access. We need to know which Groups and Users have been assigned access. The Azure UI does not let you query this information so I am wondering if there is any way to obtain a list of Groups/Users that have been assigned access to a Web App.
Edit: It looks like the Graph API version 1.5 now supports this. I can download the servicePrincipal ODATA with this URL:
GET string.Format("https://graph.windows.net/{0}/servicePrincipals?api-version=1.5&$filter=appId+eq+'{1}'",
tenant, clientId)
According to this MSDN post, I should be able to use a URL format like
GET string.Format("https://graph.windows.net/{0}/servicePrincipals/{1}/appRoleAssignedTo?api-version=1.5",
tenant, clientId)
However, I am receiving this error:
"Resource 'f4126638-cb47-48df-ad9d-57c0684b6575' does not exist or one of its queried reference-property objects are not present."}
In the second Graph call, I should be using the servicePrincipal's ObjectID returned from the first call instead of the Application's ClientID.

Google Analytics Retrieve Starred Profiles via API

Is it possible to retrieve a list of ga_account_id and ga_profile_id from only the 'starred' profiles by my analytics account programatically?
I've read through the API docs and can't see how this is possible.
You can do this with the Management API . I strongly recommend the account summary's report as its just one request and will return everything you need.
GET /management/accountSummaries