Google Analytics API into R

R library for interacting with the Google Analytics Reporting API v3 and v4.

Get more examples and tutorials at the googleAnalyticsR website

Work is currently focused on quashing bugs and updating the BigQuery parser.

If you find any bugs please log any problems here in the issues tracker.

You also need the version > 0.3.0 of googleAuthR



0.3.0 CRAN

  • Add BigQuery asynch fetch to Google Analytics 360 exports, for over 1,000,000 rows.
  • A GA v4 example Shiny app added that runs on
  • Fix bug for calculated metrics if expression not starting with ga: (#28)
  • Add several management API functions:
    • ga_accounts
    • ga_adwords
    • ga_adwords_list
    • ga_custom_datasource
    • ga_custom_upload
    • ga_custom_upload_list
    • ga_custom_vars
    • ga_custom_vars_list
    • ga_experiment
    • ga_experiment_list
    • ga_filter
    • ga_filter_list
    • ga_filter_view
    • ga_filter_view_list
    • ga_goal
    • ga_goal_list
    • ga_segment_list
    • ga_unsampled
    • ga_unsampled_list
    • ga_view
    • ga_view_list
    • ga_webproperty
    • ga_webproperty_list
  • Fix a parse bug if only metrics and no dimensions were used in google_analytics_4()
  • Refactoring v4 batching
  • New argument anti_sample for google_analytics_4() which will split up the calls into efficient batches to avoid sampling. Includes experimental sub-day hourly batching.
  • Set argument max = -1 in google_analytics_4() to fetch all results.
  • Add fix for google_analytics_account_summary parsing when no views in web properties.
  • New argument anti_sample_batches lets you choose batch sizes (daily is equal to anti_sample_batches=1)


  • Fix v4 bug where batches over 10000 had extra rows added (#19)


  • segment helper as RStudio Addin or gadget_GASegment()
  • Fix order_type() for v4 (#18)
  • Local tests added
  • Multi-account batching for v3 (#17)
  • Add BigQuery fetching for GoogleAnalytics 360 accounts via google_analytics_bq()


  • Patch to fix ignoring first row of v4 API results (#16)


  • v4 API calls implemented

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.4.2 by Mark Edmondson, 3 months ago

Report a bug at

Browse source code at

Authors: Mark Edmondson [aut, cre], Artem Klevtsov [ctb], Johann deBoer [ctb], David Watkins [ctb], Olivia Brode-Roger [ctb], Jas Sohi [ctb]

Documentation:   PDF Manual  

Task views: Web Technologies and Services

MIT + file LICENSE license

Imports assertthat, dplyr, googleAuthR, httr, magrittr, memoise, purrr, rlang, tidyr, utils

Suggests bigQueryR, covr, googleCloudStorageR, httptest, knitr, miniUI, rmarkdown, shiny

See at CRAN