StevenMMortimer / rdfp

This R package connects the DoubleClick for Publishers API from R
https://stevenmmortimer.github.io/rdfp/
Other
16 stars 5 forks source link

options(rdfp.version = "vYYYYMM") not working past "v202202" #16

Closed EmekaNwosu closed 1 year ago

EmekaNwosu commented 1 year ago

I'm trying to use a more recent version of the Google Ad Manager API access some recently addded metrics/features but options(rdfp.version = "v202202") is the only version of the API that works. Using "v202205" or greater results in this unmarshalling error

Error: Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"https://www.google.com/apis/ads/publisher/v202205":timeZoneType}'. One of '{"https://www.google.com/apis/ads/publisher/v202205":statement, "https://www.google.com/apis/ads/publisher/v202205":reportCurrency}' is expected.

Example Code

library(rdfp) dfp_auth() options(rdfp.network_code = "xxxx")

List of rdfp versions to try out

options(rdfp.version = "v202202")

options(rdfp.version = "v202205")

options(rdfp.version = "v202208")

options(rdfp.version = "v202211")

query <- list(reportJob = list(reportQuery = list(dimensions = "DATE", adUnitView = "FLAT", columns = "AD_SERVER_IMPRESSIONS", startDate = list(year = 2023, month = 01, day = 01), endDate = list(year = 2023, month = 01, day = 02), dateRangeType = "CUSTOM_DATE", #must be done after start/end date timeZoneType = "PUBLISHER")))

dfp_full_report_wrapper(query, max_tries = 1000) # This results in error unless options(rdfp.version = "v202202") is used

Not sure what else to do. I've always been able to keep up with APi version updates until this one. Let me know if you need any further details. Appreciate the help

-Emeka

EmekaNwosu commented 1 year ago

Turns out when using recent versions of the API, you can't have the timeZoneType in the query. I removed it and the query worked