Shino1024 / google-api-go-client

Automatically exported from code.google.com/p/google-api-go-client
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

adsense, multiple metrics and dimensions are not supported #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The adsense client doesn't support multiple metrics and dimensions when 
generating a report 
(https://github.com/google/google-api-go-client/blob/master/adsense/v1.4/adsense
-gen.go#L2335)

Methods "Dimension" and "Metric" accepts a single value string instead of an 
expected []string slice 
(https://github.com/google/google-api-go-client/blob/master/adsense/v1.4/adsense
-gen.go#L2353, 
https://github.com/google/google-api-go-client/blob/master/adsense/v1.4/adsense-
gen.go#L2382).
Those accepted values currently are considered a single query param 
(https://github.com/google/google-api-go-client/blob/master/adsense/v1.4/adsense
-gen.go#L2430)

AdSense Management API supports multiple metrics and dimensions 
(https://developers.google.com/adsense/management/metrics-dimensions), on API 
Explorer 
(https://developers.google.com/apis-explorer/#p/adsense/v1.4/adsense.accounts.re
ports.generate) you can see that there is an "add more" button to add multiple 
metrics and dimension, those are appended as multiple query parameters: 
"&dimension=AD_UNIT_ID&dimension=AD_UNIT_NAME&metric=AD_REQUESTS&metric=EARNINGS
"

Just to get it working i have forked the repository and committed a simple fix 
(https://github.com/Idhor/google-api-go-client/commit/9e09a005b99267d895e0bf82c8
66af73ae3b0028)

Original issue reported on code.google.com by luca.loo...@gmail.com on 29 Mar 2015 at 8:38

GoogleCodeExporter commented 9 years ago
Successfully auto-migrated to github:
https://github.com/google/google-api-go-client/issues/74
Closing.

Original comment by gmle...@google.com on 9 Apr 2015 at 7:42