google-ads-api icon indicating copy to clipboard operation
google-ads-api copied to clipboard

Accessing raw request/response data for Google support debugging

Open rosslavery opened this issue 2 years ago • 6 comments

Hi all,

Trying to debug an issue with Google support and they are requesting the raw request/response logs, not just the request_id.

In earlier versions of the library we used to be able to specify LogOptions which would be passed through to google-ads-node and would let you control verbosity, etc.

In the latest library version, the hooks don't provide as much detail, at least not at the level Google support requires to assist. Are there any alternatives I'm not aware of? If not consider this a feature request to add the LogOptions back :D

rosslavery avatar Aug 13 '21 13:08 rosslavery

Hi @rosslavery, this is an interesting idea! I will see if we can get it into a future version.

wcoots avatar Aug 23 '21 12:08 wcoots

Hi, I second this, it would be very helpful!

With partial_failure set to true, I'm not even getting back the request_id. Setting it to false is not an option unfortunately. Any workaround you could think of to allow me to get the request_id back? Thanks!

stephanembl avatar Dec 06 '21 17:12 stephanembl

Couple of notes:

  • Google support has become particularly insistent on these details being provided before they can offer any help via their official support channels
  • A workaround I've found for this is to replicate the problematic request via the REST API and that tends to get them to be more open to providing support since it's an officially supported method

rosslavery avatar Dec 07 '21 22:12 rosslavery

  • A workaround I've found for this is to replicate the problematic request via the REST API and that tends to get them to be more open to providing support since it's an officially supported method

Great suggestion, I'm going to try this workaround! Thank you @rosslavery

stephanembl avatar Dec 08 '21 12:12 stephanembl

Any update on this topic @wcoots ? I am also in need of the same information.

zahnrodolfo avatar Jan 12 '23 07:01 zahnrodolfo

hi @wcoots, I wrote a Google Ads API library for node, and I supported Logging, you can refer to my source code for your project. https://github.com/htdangkhoa/google-ads/blob/main/src/lib/LoggingInterceptor.ts

After you have defined your Logging Interceptor, you can add it by this way in your service.ts file:

...

// Initialising services can take a few ms, so we cache when possible.
const creds = this.getCredentials();
const client = new protoService({
  sslCreds: creds,
  grpc: new grpc.Client(protoService.apiEndpoint, creds, {
    interceptors: [
      // add logging interceptor to grpc client
    ],
  }),
});

...

Good luck 😃

htdangkhoa avatar Nov 13 '23 08:11 htdangkhoa