if (FALSE) {
# create a filter object
Filter <- list(
name = 'googleAnalyticsR test1: Exclude Internal Traffic',
type = 'EXCLUDE',
excludeDetails = list(
field = 'GEO_IP_ADDRESS',
matchType = 'EQUAL',
expressionValue = '199.04.123.1',
caseSensitive = 'False'
)
)
# add a filter (but don't link to a View)
filterId <- ga_filter_add(Filter,
accountId = 123456,
linkFilter = FALSE)
# change the name of the filter
change_name <- "googleAnalyticsR test2: Changed name via PATCH"
# using PATCH semantics, only need to construct what you want to change
filter_to_update <- list(name = test_name)
# update the filter using the filterId
ga_filter_update(filter_to_update, accountId2, filterId, method = "PATCH")
}
Run the code above in your browser using DataLab