View source: R/custom_dims_mets.R
ga_custom_vars_create | R Documentation |
Create a dimension by specifying its attributes.
ga_custom_vars_create(
name,
index,
accountId,
webPropertyId,
active,
scope = c("HIT", "SESSION", "USER", "PRODUCT")
)
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 |
|
scope |
Scope of custom dimension - one of |
Custom dimensions support article
Other custom variable functions:
ga_custom_vars_list()
,
ga_custom_vars_patch()
,
ga_custom_vars()
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.