LoginCustomerID issue

69 views
Skip to first unread message

Reports1

unread,
Jun 8, 2022, 3:43:42 PM6/8/22
to Google Ads API and AdWords API Forum
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;
                            });

Google Ads API Forum Advisor

unread,
Jun 9, 2022, 1:07:15 AM6/9/22
to report...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching us out. I am Sherwin from Google Ads API support team. I hope that you are doing well today.

With regard to your concern, can you please tell me if you receive any error messages when you execute these codes? And to further investigate this issue, could you provide the complete and recent request and response logs with request ID and request header generated on your end? You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com

Best regards,
Google Logo
Sherwin Vincent
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bdjHZ:ref
Reply all
Reply to author
Forward
0 new messages