ConversionUploadService

590 views
Skip to first unread message

p clara

unread,
Feb 4, 2020, 1:29:12 AM2/4/20
to AdWords API and Google Ads API Forum
How do I make a successful call and how do I authorize and create a ConversionUploadServiceClient? I tried many ways, only get errors like "failed to connect to all addresses"

Google Ads API Forum Advisor Prod

unread,
Feb 4, 2020, 3:41:18 PM2/4/20
to p.cl...@gmail.com, adwor...@googlegroups.com

Hello,

Thank you for writing to us. Please refer to this code sample (available in all the client libraries) to add conversion actions via Google Ads API Beta for reference to create a service client for ConversionUploadService. You could also refer to the examples available in AdWords API for uploading the conversions via API. If you are still having trouble, could you please share the complete request and response logs along with the client customer id for me to take a look into this further and assist you better?

P.S. Please use Reply privately to author option while sharing the details.

Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UUzynP:ref

p clara

unread,
Feb 5, 2020, 5:38:10 AM2/5/20
to AdWords API and Google Ads API Forum
Thank you for your answe. I need to accessmthod UploadClickConversion(UploadClickConversionRequest). I found all the examples from the C# library, also found the one with the ConversionAction. I did not find any example on the web that could help me create and authorize a ConversionUploadService with ServiceAccountCredentials and after that use the service to upload offline conversions using the method UploadClickConversions. I would appreciate any help you can provide.

Another issue would be the proxy from the company. Every request sent is passed through the proxy and everytime I try to call, I get  "StatusCode=unavailbale.Detail=failed to connect to all addresses" .What can we do to make it work? Can you provide an endpoint for the proxy to ignore ? Considein that is Grpc I can't the endpoint to which google ads api is trying to connect. Or is there another solution?

Thank you.

On Tuesday, February 4, 2020 at 8:29:12 AM UTC+2, p clara wrote:
How do I make a successful call and how do I authorize and create a ConversionUploadServiceClient? I tried many ways, only get errors like "StatusCode=unavailbale.Detail=failed to connect to all addresses" .What 

p clara

unread,
Feb 5, 2020, 6:27:11 AM2/5/20
to AdWords API and Google Ads API Forum
Another question is what fields from ClickConversion https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v2.services#google.ads.googleads.v2.services.ClickConversion  are mandatory when sending a ConversionClickConversionRequest ?

Thank you.

On Tuesday, February 4, 2020 at 8:29:12 AM UTC+2, p clara wrote:

Google Ads API Forum Advisor Prod

unread,
Feb 5, 2020, 4:04:38 PM2/5/20
to p.cl...@gmail.com, adwor...@googlegroups.com

Hello,

Please find my response to your queries below.

  • To authorize using a service account, please refer to this guide or detailed steps and information related to the same. We strongly recommend using OAuth2 installed app or web flow instead of service accounts unless you need a domain-specific feature (for example, impersonation). OAuth2 installed app and web flows do require an initial user interaction for granting access to the account, but are much simpler to set up. You need to implement the code set up on your end to make calls using service accounts.

  • For another issue, could you please share the complete request and response logs along with the client customer id or me to investigate the error on my end and assist you better?

  • The resource name for the ClickConversion is not required while creating a new ClickConversion and the rest of the fields are required until specified they are optional in the documentation.

Let us know if you need any additional information.



Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UUzynP:ref

Google Ads API Forum Advisor Prod

unread,
Feb 5, 2020, 4:19:14 PM2/5/20
to p.cl...@gmail.com, adwor...@googlegroups.com

Hello,

Please use Reply privately to author option while sharing the details for investigation as requested in my previous email.



Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UUzynP:ref

p clara

unread,
Feb 11, 2020, 9:06:12 AM2/11/20
to AdWords API and Google Ads API Forum
Hello,

 I am back with a new questions regarding the same issue. I managed to resolve the initial error "Failed to connect to all addresses", but now I hit a new issue. I have two ways of defining a googleAdsClient and calling the UploadClickConversions:
First method
                GoogleAdsClient googleAdsClient = new GoogleAdsClient(new Google.Ads.GoogleAds.Config.GoogleAdsConfig());
                googleAdsClient.Config.DeveloperToken =  "****";
                googleAdsClient.Config.LoginCustomerId = "****";
                googleAdsClient.Config.OAuth2ClientId = "****";
                googleAdsClient.Config.OAuth2Mode = Google.Ads.GoogleAds.Config.OAuth2Flow.SERVICE_ACCOUNT;
                googleAdsClient.Config.OAuth2ClientSecret = "****";
                googleAdsClient.Config.OAuth2SecretsJsonPath = "****";
ConversionUploadServiceClient client5 = googleAdsClient.GetService(Services.V2.ConversionUploadService);


Second method uses App.config for the googleAdsClient configuration

                GoogleAdsClient googleAdsClient1 = new GoogleAdsClient(new Google.Ads.GoogleAds.Config.GoogleAdsConfig());
                googleAdsClient1.Config.OAuth2Mode = Google.Ads.GoogleAds.Config.OAuth2Flow.SERVICE_ACCOUNT;
                ConversionUploadServiceClient client6= googleAdsClient1.GetService(Services.V2.ConversionUploadService);

For both of the method I get the same error:
Status(StatusCode=Unavailable, Detail="Getting metadata from plugin failed with error: Exception occurred in metadata credentials plugin. Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"invalid_client", Description:"The OAuth client was not found.",

Can you please help ?

Google Ads API Forum Advisor Prod

unread,
Feb 11, 2020, 3:47:08 PM2/11/20
to p.cl...@gmail.com, adwor...@googlegroups.com

Hello,

From the shared details, it looks like there could be an issue with your OAuth2 Credentials. Could I please request regenerating a new set of credentials by following this guide, update your ads.properties with the newly created credentials and retry the request? Please give this a try and if the issue persists, could you please share the complete request and response logs along with the client customer id and email address used while generating the OAuth2 credentials for me to investigate this further on my end?

P.S. Please use Reply privately to author option for sharing the details for investigation.



Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UUzynP:ref

p clara

unread,
Feb 12, 2020, 4:20:44 AM2/12/20
to AdWords API and Google Ads API Forum
Thank you for your response.

We generated new credentials and tried to use them is both ways described above and now we have another error: Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"invalid_grant", Description:"Invalid grant: account not found".
From what I understand we have we also have to set the AccessType to offline. I did not found a way to do in C# code, I added <add key = "OAuth2AccessType" value = "offline" />  to the App.config file.

Google Ads API Forum Advisor Prod

unread,
Feb 12, 2020, 3:32:53 PM2/12/20
to p.cl...@gmail.com, adwor...@googlegroups.com

Hello,

Could you please confirm if you are following the steps mentioned in this guide to access the AdWords API with service accounts. If yes, please refer to this section of the guide which will help you to configure the client library for your service account. The steps for .Net client libraries are mentioned here which will guide you to setup OAuth2 for API access using your own credentials. Please give this a try and let me know if the issue persists. Also, we strongly recommend using installed app or web flows instead of service accounts unless you need domain-specific features (for example, impersonation). 



Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UUzynP:ref

p clara

unread,
Feb 14, 2020, 9:30:13 AM2/14/20
to AdWords API and Google Ads API Forum
Yes, the steps used are the ones mentioned in the links above.
Anyhow, I tried using the installed app flow with a new generated Client ID of type Other, as mentioned in the documentation here: https://developers.google.com/adwords/api/docs/guides/authentication#installed . The last error encountered is "User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header."  Does this mean that somewhere I should allow the new Client ID to the customer?

Thank you very much.

Google Ads API Forum Advisor Prod

unread,
Feb 14, 2020, 3:07:15 PM2/14/20
to p.cl...@gmail.com, adwor...@googlegroups.com

Hello,

The error means that the login customer id (the customer id of your manager account) must be specified in your properties file while making an API call against the client customer account. Please refer to this guide for more details related to this. Let me know if you need any additional information.



Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UUzynP:ref

p clara

unread,
Feb 17, 2020, 1:31:58 AM2/17/20
to AdWords API and Google Ads API Forum
I already have <add key = 'LoginCustomerId' value = 'XXXXXXXXX' /> added to my App.config file, still the error persists. I am using this library https://github.com/googleads/google-ads-dotnet/blob/master/src/App.config#L78.
Thank you.

Google Ads API Forum Advisor Prod

unread,
Feb 18, 2020, 2:06:13 PM2/18/20
to p.cl...@gmail.com, adwor...@googlegroups.com

Hello,

Could you please share the complete request and response logs along with the client customer id against which you are trying to make the API call? Also, please share the email address used while generating the OAuth2 credentials and the login customer id specified in the file for me to take a look into this further.

P.S. Please use Reply privately to author option while sharing the details.



Regards,
Nikisha Patel, Google Ads API Team



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