artemklevtsov / RGA

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

fetch.by = "day" errors #9

Closed victoriadataseer closed 8 years ago

victoriadataseer commented 8 years ago

I've been trying to extract data from Google Analytics and I've been using the RGA package. For this I use the get_ga function. Since I'm handling a lot of data, I've tried to use your fetch.by = "day" attribute, to try and reduce sampling, but it doesn't seem to work. It works for fetch.by = "week", but I need a bigger sample from the dataset. I run this code:

Data = get_ga(profile.id  = "6666666",
                 start.date = "2015-11-15",
                 end.date   = "2015-11-20",
                 metrics    = "ga:sessions,ga:bounces,ga:entrances,ga:pageviews,ga:timeOnPage,ga:exits",
                 dimensions = "ga:date,ga:medium,ga:deviceCategory,ga:country,ga:hostname,ga:pagePath,ga:pageTitle",
                 sampling.level = "HIGHER_PRECISION",
                 token      = token,
                 fetch.by   = "day")

And I get there warning messages:

1: Data contains sampled data. Used 498019 sessions (91% of sessions). Try to use the 'fetch.by' param to avoid sampling. 
2: Data contains sampled data. Used 498098 sessions (80% of sessions). Try to use the 'fetch.by' param to avoid sampling. 
3: Data contains sampled data. Used 498166 sessions (89% of sessions). Try to use the 'fetch.by' param to avoid sampling. 
4: Data contains sampled data. Used 498078 sessions (85% of sessions). Try to use the 'fetch.by' param to avoid sampling. 
5: Data contains sampled data. Used 497895 sessions (88% of sessions). Try to use the 'fetch.by' param to avoid sampling. 

Hope you can help. Thank you.

artemklevtsov commented 8 years ago

Seems data sampled even with the fetch.by. If you got sampled with fetch.by = "day" you should reduce number of the dimensions.