Hello,
We're using Google Ads API in our app.
First, the manager account owner starts the OAuth process, then a list of managed accounts is displayed to them, then they select the managed account to use for conversions queries using this C# code :
var client = new GoogleAdsClient(config);
var service = client.GetService(Services.V17.ConversionUploadService);
var searchService = client.GetService(Services.V17.GoogleAdsService);
SearchGoogleAdsRequest request = new SearchGoogleAdsRequest()
{
Query = "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = '" + convs.First().Eventname + "'",
CustomerId = customerId.ToString()
};
But this queries raises an exception because the user has no permission. This is because we provide the managed account id as login-customer-id. However, providing it manually at debug time allows the query to complete.
My question is, how can we retrieve the corresponding manager account id to the selected customer id so that the query succeeds ?
I tried many things from the docs but without success. It seems that it's not possible to retrieve the manager id using any query based on customer id, is it ?
Best,
Olivier