artemklevtsov / RGA

A Google Analytics API client for R
http://cran.r-project.org/package=RGA
32 stars 13 forks source link

Error in names(res$query) <- rename_params(names(res$query)) #23

Closed Timlri closed 8 years ago

Timlri commented 8 years ago

get_ga() runs for several minutes. Once it reaches 100% it halts with the error at the bottom. This is with RGA_0.4.1 from sessionInfo().

> ga.data  <- get_ga(start.date  = "2013-02-01",
+                    end.date    = "2016-01-31",
+                    dimensions  = c("ga:date", "ga:pagePath"),
+                    metrics     = "ga:pageviews",
+                    max.results = NULL,
+                    fetch.by    = "day",
+                    filter      = "ga:pagePath=~/knowledgebase-articles/",
+                    #sort       = "-ga:transactions",
+                    profileId  = "ga:82227017")      # All Web Site Data (Historical)
Batch processing mode enabled.
Fetch data by day: from 2013-02-01 to 2016-01-31.
  |                                                                                                                              |   0%
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
  |==============================================================================================================================| 100%
Error in names(res$query) <- rename_params(names(res$query)) : 
  attempt to set an attribute on NULL
> 
> traceback()
3: fetch_by(path, query, by, token)
2: get_report("data/ga", query, token, fetch.by)
1: get_ga(start.date = "2013-02-01", end.date = "2016-01-31", dimensions = c("ga:date", 
       "ga:pagePath"), metrics = "ga:pageviews", max.results = NULL, 
       fetch.by = "day", filter = "ga:pagePath=~/knowledgebase-articles/", 
       profileId = "ga:82227017")

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] xlsx_0.5.7     xlsxjars_0.6.1 rJava_0.9-7    gdata_2.17.0   RGA_0.4.1     

loaded via a namespace (and not attached):
[1] httr_1.1.0      plyr_1.8.3      R6_2.1.1        tools_3.2.3     curl_0.9.4      Rcpp_0.12.2     jsonlite_0.9.19 httpuv_1.3.3   
[9] gtools_3.5.0   
artemklevtsov commented 8 years ago

Thank you for the report. Bug occurs when some or all pages is NULL. It should be fixed now. Please try with the latest dev-version from git.

devtools::install_github("artemklevtsov/RGA@f16b12ccc781e9c5c2ba4f40a40342e7c3c5247e")
Timlri commented 8 years ago

Hi,

I installed the update but now I get a different error at that same point. The query runs for about 20 minutes, gets to 100%, and then the error.

> ga.data  <- get_ga(start.date  = "2013-02-01",
+                    end.date    = "2016-01-31",
+                    dimensions  = c("ga:date", "ga:pagePath"),
+                    metrics     = "ga:pageviews",
+                    max.results = NULL,
+                    fetch.by    = "day",
+                    filter      = "ga:pagePath=~/knowledgebase-articles/",
+                    #sort       = "-ga:transactions",
+                    profileId  = "ga:82227017")      # All Web Site Data (Historical)
Batch processing mode enabled.
Fetch data by day: from 2013-02-01 to 2016-01-31.
  |==============================================================================================================================| 100%
Error in pages[[n]] : subscript out of bounds
> traceback()
3: fetch_by(path, query, by, token)
2: get_report("data/ga", query, token, fetch.by)
1: get_ga(start.date = "2013-02-01", end.date = "2016-01-31", dimensions = c("ga:date",
       "ga:pagePath"), metrics = "ga:pageviews", max.results = NULL,
       fetch.by = "day", filter = "ga:pagePath=~/knowledgebase-articles/",
       profileId = "ga:82227017")
artemklevtsov commented 8 years ago

The latest error fixed in 253feaa026724c22c1d8de76e892768d9178236d.

Timlri commented 8 years ago

That fixed it. All set now. Thanks for the quick response.

From: Artem Klevtsov [mailto:notifications@github.com] Sent: Thursday, February 25, 2016 11:30 AM To: artemklevtsov/RGA RGA@noreply.github.com Cc: Reid, Tim Tim.Reid@ca.com Subject: Re: [RGA] Error in names(res$query) <- rename_params(names(res$query)) (#23)

The latest error fixed in 253feaahttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_artemklevtsov_RGA_commit_253feaa026724c22c1d8de76e892768d9178236d&d=CwMCaQ&c=hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=J9MWkpH5-ibG8HQD95YZA&m=jKbxoPA2jBq2myvR06veOvXmMJKKcDBqnPGV89A-_MY&s=JU0NZI_9gCK2XnOhkO65hgIpjyMdoG43vDrtx7GenzM&e=.

— Reply to this email directly or view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_artemklevtsov_RGA_issues_23-23issuecomment-2D188864112&d=CwMCaQ&c=hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=J9MWkpH5-ibG8HQD95YZA&m=jKbxoPA2jBq2myvR06veOvXmMJKKcDBqnPGV89A-_MY&s=GKDSMR7whw4RhCa073qewwKagWV-vHicq96MOVuL02Q&e=.