Open thewzhang opened 10 years ago
I got the codes working by adding the following line per a stackoverflow post:
options(RCurlOptions = list(capath = system.file("CurlSSL", "cacert.pem", package = "RCurl"), ssl.verifypeer = FALSE))
The question now is that all the visit stats are zero no matter what web sites I changed to monitor from my Google Analytics Admin.
Any advice? Thanks! Weihong
Could you please provide some code?
Bror, here is the codes I used. They are adapted from somewhere from the web. I passed the authentication and got all data zeros. I took out my Profile ID and used XXXXXXXX instead for purpose. Thanks! --Weihong
library(devtools) library(rga)
library(lubridate)
options(RCurlOptions = list(capath = system.file("CurlSSL", "cacert.pem", package = "RCurl"), ssl.verifypeer = FALSE))
rga.open(instance = "ga", where = "./gaIIapi")
visits_notprovided.df <- ga$getData(XXXXXXXX, start.date = "2010-09-01", end.date = "2013-09-01", metrics = "ga:visits", filters = "ga:keyword==(not provided);ga:source==google;ga:medium==organic", dimensions = "ga:date", max = 1500, sort = "ga:date")
names(visits_notprovided.df)<- c("hit_date", "np_visits")
visits_orgsearch.df <- ga$getData(XXXXXXXX, start.date = "2010-09-01", end.date = "2013-09-01", metrics = "ga:visits", filters = "ga:source==google;ga:medium==organic", dimensions = "ga:date", max = 1500, sort = "ga:date")
names(visits_orgsearch.df)<- c("hit_date", "total_visits")
merged.df <- merge(visits_notprovided.df, visits_orgsearch.df, all=TRUE) merged.df$search_term_provided <- merged.df$total_visits - merged.df$np_visits merged.df$pct_np <- merged.df$np_visits / merged.df$total_visits merged.df$yearmo <- year(merged.df$hit_date)*100 + month(merged.df$hit_date)
final_dataset = subset(merged.df, total_visits > 0)
From: Bror Skardhamar notifications@github.com To: skardhamar/rga rga@noreply.github.com Cc: thewzhang thewzhang@yahoo.com Sent: Wednesday, September 18, 2013 11:46 AM Subject: Re: [rga] rga call cannot pass authenticating (#20)
Could you please provide some code? — Reply to this email directly or view it on GitHub.
Hi there,
I installed rga per the web site https://github.com/skardhamar/rga. Environment is R3.0.1 and Windows 8. The following is R codes (I did not place my real client.id and secret here):
library(devtools) library(rga) rga.open(instance="ga", client.id = "MyClientID(no problem)", client.secret = "MyCientSecret(no problem)")
It still brings me to google site for a code (I do not assume this happens per skardhamar's page). I got the following err after inputting it to the R console. When I used the simplified form rga.open(instance="ga") or rga.open(instance="ga", where="~/ga.rga"), the problem persists.
Error in function (type, msg, asError = TRUE) : SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Any advice? Thanks! Weihong