Closed elalbaicin closed 2 years ago
Same error here, I switched to the raw json method in order to do some urgent work, and it was working for a while, but know I also have an error while parsing the response :
Error in if (pq$tokensPerDay$consumed > (care_factor * tpd_remaining) || : missing value where TRUE/FALSE needed Error: API Data failed to parse.
I can see the correct API response in the debug file (so I guess the request is fine and I'm not over quotas), but I'm not technical enough so I have no idea if it is connected to the firt issue or why it stopped working suddenly. Given I've just started using the package and I'm not sure what I'm doing half of the time, I would guess the problem might be unrelated!
Might add debug files later if needed.
Thanks, sessionInfo will be helpful - upgraded to a new version of R? It may have caught an error that was a warning but raises an error now in new version.
Was the same query working in a previous version of R?
From the error messages, it looks like part of the api response that is expected to be a scalar (length 1) is now receiving a vector (length 2)
Thanks, sessionInfo will be helpful - upgraded to a new version of R? It may have caught an error that was a warning but raises an error now in new version.
Was the same query working in a previous version of R?
I did upgrade to R 4.2.1 from R 4.2.0 recently, but when I downgraded back to 4.2.0 the exact same error ocurred. By the way, it stopped working on October 10, if it's any help.
upgraded to a new version of R?
I'm on a brand new install (R, R Studio, googleanalyticsr)
Thanks for your work.
It may be the API changed it's response, but will check it out
Hi all,
I have the same issue with same error message. The error gets triggered with ga_data()
à but not with google_analytics()
Thanks for your support !
Best, D.
Should be fixed now, it was a change in the API response related to quotas.
> options(googleAuthR.verbose = 2)
> ga_data(ga_id,
+ date_range = c("2022-10-10", "2022-10-10"),
+ dimensions = c("date"),
+ metrics = c("sessions"),
+ limit = -1)
ℹ 2022-10-12 11:14:45 > Request: https://analyticsdata.googleapis.com/v1beta/properties/206670707:runReport/
ℹ 2022-10-12 11:14:45 > Reading cache
ℹ 2022-10-12 11:14:45 > tokensPerDay: Query Cost [ 1 ] / Remaining [ 24992 ]
ℹ 2022-10-12 11:14:45 > tokensPerHour: Query Cost [ 1 ] / Remaining [ 4996 ]
ℹ 2022-10-12 11:14:45 > concurrentRequests Consumed / Remaining: 0 / 10
ℹ 2022-10-12 11:14:45 > serverErrorsPerProjectPerHour Consumed / Remaining: 0 / 10
ℹ 2022-10-12 11:14:45 > Downloaded [ 1 ] of total [ 1 ] rows
# A tibble: 1 × 2
date sessions
<date> <dbl>
1 2022-10-10 86
To install the fix now use remotes::install_github("MarkEdmondson1234/googleAnalyticsR")
and I'll submit it to CRAN ASAP
Fixed, thanks a lot !!!
It's working now. Thank you very much, Mark.
Thanks for the fix!!!
This fix is on CRAN now so you can install normally, v1.1.0
Thank you for the great software and support!
What goes wrong
Whenever I try to extract data from GA4 with
ga_data()
, I get the following error:Steps to reproduce the problem
All session info is at the "Session Info" section; then it should suffice to run:
By the way, I've tried omitting the
limit
argument to see if the issue persisted, and it still threw an error.Expected output
A dataframe.
Actual output
The aforementioned error message.
Running
options(googleAuthR.verbose=2)
does not yield any output.'API Data failed to parse' diagnostics
I've written the output of
googleAuthR::gar_debug_parsing("gar_parse_error.rds")
on this file: gar_parse_error.txtSession Info
This file contains the output of
sessionInfo()
: session_info.txt