Alok Swain
Alok Swain

Reputation: 6519

Is Google Analytics data fetched via Garb ruby gem sampled

Is the data fetched from Google Analytics profile via Garb sampled? We fetch results via Garb from a GA profile for a certain date range as follows:

class Downloads
  extend Garb::Model
  metrics :totalEvents
  dimensions :eventAction, :eventLabel, :eventCategory, :date
end

downloads = Downloads.results(<profile id of view in GA>, start_date: Date.civil(2015,8,10), end_date: Date.today, offset: 1, limit: 800)

When I view the same data in GA profile for the same date range in the Google Analytics dashboard I see the sampling message on top. Does this mean the data fetched via Garb is also sampled ?

Upvotes: 2

Views: 118

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116868

From documentation

About sampled data

When a report is based on data from a large number of sessions, you may see the following notice at the top of the report: This report is based on N sessions. This notice alerts you that the report is based on sampled data. Sampling occurs automatically when more than 500,000 sessions (25M for Premium) are collected for a report, allowing Google Analytics to generate reports more quickly for those large data sets. When your report is based on sampled data, you have the option to adjust the sample size to increase accuracy or increase speed. Note that Flow Visualization reports are sampled after 100,000 sessions and 1 million conversions in the Multi-Channel Funnel reports.

explained:

All reports in Google analytics website and data returned from the Google Analytics API can be sampled. It depends upon the size of your query and the amount of data it will return.

Is the data fetched from Google Analytics profile via Garb sampled? Yes it can be.

Does this mean the data fetched via Garb is also sampled? Yes

Tips: I cant help with ruby much but you can send a request to the Google analytics api called samplingLevel if you set it to HIGHER_PRECISION you can lessen the amount the data is sampled not totally remove it but you can reduce it.

Response:

Again I cant help much with ruby but the API returns information about the sampling of your request. look for a field called containsSampledData if its set to true the data return by the API is sampled.

Upvotes: 1

Related Questions