googleAnalyticsR (version 0.5.0)

ga_filter_update: Updates an existing filter.

Description

Updates an existing filter.

Usage

ga_filter_update(Filter, accountId, filterId, method = c("PUT", "PATCH"))

Arguments

Filter

The Filter object to be updated See examples from ga_filter_add()

accountId

Account Id of the account that contains the filter

filterId

The id of the filter to be modified

method

PUT by default. For patch semantics use PATCH

Value

A filterManagement object

See Also

https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/#Filters

Other managementAPI functions: ga_accounts, ga_adwords_list, ga_adwords, ga_custom_vars_list, ga_custom_vars, ga_experiment_list, ga_experiment, ga_filter_add, ga_filter_apply_to_view, ga_filter_delete, ga_filter_list, ga_filter_update_filter_link, ga_filter_view_list, ga_filter_view, ga_filter, ga_goal_list, ga_goal, ga_remarketing_estimate, ga_remarketing_get, ga_remarketing_list, ga_segment_list, ga_unsampled_list, ga_unsampled, ga_users_list, ga_view_list, ga_view, ga_webproperty_list, ga_webproperty, google_analytics_account_list

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# 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")

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab