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

ga_goal_update

Updates an existing goal.


Description

Updates an existing goal.

Usage

ga_goal_update(
  Goal,
  accountId,
  webPropertyId,
  viewId,
  goalId,
  method = c("PUT", "PATCH")
)

Arguments

Goal

The Goal object to be updated See examples from ga_goal_add()

accountId

Account Id of the account in which to modify the Goal

webPropertyId

Property Id of the property in which to modify the Goal

viewId

View Id of the view in which to modify the Goal

goalId

The id of the goal to be modified

method

PUT by default. For patch semantics use PATCH

Value

A goalManagement object

See Also

Other goal management functions: ga_goal_add(), ga_goal_list(), ga_goal()

Examples

## Not run: 

# Change the goal 11 to visits over 3 minutes
Goal <- list(
  active = TRUE,
  name = 'Stayed for more than 3 minutes',
  type = 'VISIT_TIME_ON_SITE',
  visitTimeOnSiteDetails = list(
    comparisonType = 'GREATER_THAN',
    comparisonValue = 180
  )
)
ga_goal_update(Goal, accountId, propertyId, viewId, 11)

# Change destination url for goal 17
Goal <- list(
    urlDestinationDetails = list(
      url = '\\/checkout\\/success'
    )
  )

# Only the fields we're changing required because we're using PATCH method  
ga_goal_update(Goal, accountId, propertyId, viewId, 17, method = "PATCH")
  

## 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.