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

ga_custom_vars_create

Create a custom dimension


Description

Create a dimension by specifying its attributes.

Usage

ga_custom_vars_create(
  name,
  index,
  accountId,
  webPropertyId,
  active,
  scope = c("HIT", "SESSION", "USER", "PRODUCT")
)

Arguments

name

Name of custom dimension

index

Index of custom dimension - integer between 1 and 20 (200 for GA360)

accountId

AccountId of the custom dimension

webPropertyId

WebPropertyId of the custom dimension

active

TRUE or FALSE if custom dimension is active or not

scope

Scope of custom dimension - one of "HIT","SESSION","USER","PRODUCT"

See Also

Other custom variable functions: ga_custom_vars_list(), ga_custom_vars_patch(), ga_custom_vars()

Examples

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

# create custom var
ga_custom_vars_create("my_custom_dim",
                      index = 15,
                      accountId = 54019251,
                      webPropertyId = "UA-54019251-4",
                      scope = "HIT",
                      active = FALSE)

# view custom dimension in list
ga_custom_vars_list(54019251, webPropertyId = "UA-54019251-4", type = "customDimensions")


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