adsense.reports.generate is not allowing multiple values for metric attributes #35

sqrrrl opened this Issue Apr 8, 2013 · 2 comments


None yet
1 participant

sqrrrl commented Apr 8, 2013

(Moved from

To reproduce

  1. authenticate via oauth 2
  2. use v1.2 (adsense.reports.generate)
  3. put multiple elements in array for metric attribute

What is the expected output? What do you see instead?
i expect all the metric attributes to appear with data,

instead i see no data at all, here's an example
when i put

'metric' => %w(CLICKS EARNINGS),

i get the following


if i use only 1 element in metric, it works, for instance,

'metric' => %w(CLICKS),

i get the following


im running on Centos 6, using gem 'google-api-client'


sqrrrl commented Apr 8, 2013

Additional history:
Project Member #1
Likely caused by an issue with how Faraday encodes query parameters ( A fix to Faraday was committed, but still waiting for them to cut a new gem with it included. Will verify once it is available.

Status: Accepted
Nov 12, 2012 Delete comment #2 michaelcni
Jan 9, 2013 Delete comment #3 simoneau.louis
We've had to fork Faraday to get this working for us. With the new Faraday, you can use:

Faraday::Utils.default_params_encoder = Faraday::FlatParamsEncoder

to specify a parameter encoder that doesn't try to treat multiple occurrences of the same param as nested params and insert []. This required hacking the version number back to 0.8.x as both google-api-client and signet specifically depend on ~> 0.8.4 and ~> 0.8.1 respectively.

However, when the new Faraday is cut, if both of those other gems are updated to use Faraday 0.9.x, that line is all that's required to get things working.
Today (3 hours ago) Delete comment #4 damian.janowski
The new FlatParamsEncoder does indeed fix reports.

However, when Faraday 0.9 is released this option should be set at the APIClient level, that is, not changing the default behavior of Faraday.


sqrrrl commented Jun 7, 2013

Fixed for 0.7 (soon)

@sqrrrl sqrrrl closed this Jun 7, 2013

@Kalmh Kalmh referenced this issue in google/google-api-nodejs-client Sep 26, 2014


Unable to set multiple dimension/metric to generate an adsense report #295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment