Google Ads API team and all.
I have access to 3 Google Ads manager accounts.
When getting Google Ads API data for each using C#/.Net client, it works only if for the specific manager customer in the App Config file:
<GoogleAdsApi>
<add key="LoginCustomerId" value="XXXXXXXXXX" />
I tried to populate it dynamically under "options". See info below, but some how it gets ignored and Google API seems to only see/recognize the LoginCusomterID in the Apps.config.
I tried to add it in this section, but it is being ignored.
codeExample.Run(new GoogleAdsClient(), options.CustomerId, options.LoginCustomerId,Start_date_new, End_date_new, DMS_STORE_ID);
when calling the API as is does not accept the LognincustomeriD under:
googleAdsService.SearchStream(customerId.ToString(),query,
delegate (SearchGoogleAdsStreamResponse resp)
Appreciate any help, thanks
public class Options : OptionsBase
{
[Option("customerId", Required = true, HelpText =
"The Google Ads customer ID for which the call is made.")]
public long CustomerId { get; set; }
[Option("LoginCustomerId", Required = false, HelpText =
"Optional Login customer ID if your access to the CIDs is via a manager account.")]
public long LoginCustomerId { get; set; }
}
Options options = new Options();
CommandLine.Parser.Default.ParseArguments<Options>(args).MapResult(
delegate (Options o)
{
options = o;
return 0;
}, delegate (IEnumerable<Error> errors)
{
options.CustomerId = long.Parse("aaaaaaaa");
options.LoginCustomerId = long.Parse("XXXXXXXXXX);
return 0;
});