ga_clientid_deletion: Create or update a user deletion request

View source: R/client_id.R

ga_clientid_deletionR Documentation

Create or update a user deletion request


The Google Analytics User Deletion API allows customers to process deletions of data associated with a given user identifier.


  idType = c("CLIENT_ID", "USER_ID", "APP_INSTANCE_ID"),
  propertyType = c("ga", "firebase")



A character vector of user ID's


The Google Analytics Web property or Firebase ProjectId you are deleting the user from.


Type of user. One of APP_INSTANCE_ID, CLIENT_ID or USER_ID.


Firebase or Google Analytics


The user explorer report in Google Analytics can give you the you need to test.

A data deletion request can be applied to either a Google Analytics web property (specified by propertyType="ga") or Firebase application (propertyType="firebase"). A user whose data will be deleted can be specified by setting one of the identifiers the userId field. The type of the identifier must be specified inside idType field.

There is a quota of 500 queries per day per cloud project.

The API returns a User Deletion Request Resource with deletionRequestTime field set. This field is the point in time up to which all user data will be deleted. This means that all user data for the specified user identifier and Google Analytics property or Firebase project will be deleted up to this date and time - if the user with the same identifier returns after this date/time, they will reappear in reporting.


a data.frame with a row for each userID you sent in, plus a column with its deletionRequestTime

See Also

Other clientid functions: ga_clientid_activity_unnest(), ga_clientid_activity(), ga_clientid_hash()


## Not run: 

# make sure you are authenticated with user deletion scopes
options(googleAuthR.scopes.selected = "")

# a vector of ids
ids <- c("1489547420.1526330722", "1138076389.1526568883")

# do the deletions
ga_clientid_deletion(ids, "UA-1234-2")
#                 userId   id_type  property      deletionRequestTime
#1 1489547420.1526330722 CLIENT_ID UA-1234-2 2018-05-20T19:43:33.540Z
#2 1138076389.1526568883 CLIENT_ID UA-1234-2 2018-05-20T19:43:36.218Z

## End(Not run)

MarkEdmondson1234/googleAnalyticsR_public documentation built on May 5, 2022, 7:49 a.m.