Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ga_users_add

Create or update user access to Google Analytics


Description

If you supply more than one email, then batch processing will be applied. Batching has special rules that give you 30 operations for the cost of one API call against your quota. When batching you will only get a TRUE result on successful batch, but individual entries may have failed. Check via ga_users_list afterwards and try to add individual linkIds to get more descriptive error messages.

Usage

ga_users_add(
  email,
  permissions,
  accountId,
  webPropertyId = NULL,
  viewId = NULL
)

Arguments

email

The email(s) of the user(s) to add. Has to have a Google account.

permissions

Which permissions to add as a vector - "MANAGE_USERS","EDIT","COLLABORATE","READ_AND_ANALYZE"

accountId

Account Id

webPropertyId

Web Property Id - set to NULL to operate on account level only

viewId

viewId - set to NULL to operate on webProperty level only

Value

TRUE if successful

See Also

Other User management functions: ga_users_delete_linkid(), ga_users_delete(), ga_users_list(), ga_users_update()

Examples

## Not run: 
library(googleAnalyticsR)
ga_auth()

ga_users_add(c("the_email@company.com", "another_email@company.com"), 
             permissions = "EDIT", accountId = 47480439)


## End(Not run)

googleAnalyticsR

Google Analytics API into R

v1.0.0
MIT + file LICENSE
Authors
Mark Edmondson [aut, cre] (<https://orcid.org/0000-0002-8434-3881>), Artem Klevtsov [ctb], Johann deBoer [ctb], David Watkins [ctb], Olivia Brode-Roger [ctb], Jas Sohi [ctb], Zoran Selinger [ctb], Octavian Corlade [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.