gtm_tags_create: Create a new tag

View source: R/tags.R

gtm_tags_createR Documentation

Create a new tag

Description

This takes a tag resource and creates a new tag in GTM.

Usage

gtm_tags_create(account_id, container_id, workspace_id, tag_object)

Arguments

account_id

Account Id

container_id

Container Id

workspace_id

Workspace Id

tag_object

Tag Object

See Also

https://developers.google.com/tag-platform/tag-manager/api/v2/reference/accounts/containers/workspaces/tags/create

Other tag functions: gtm_tags_delete(), gtm_tags_get(), gtm_tags_list(), gtm_tags_revert(), gtm_tags_update()

Examples

## Not run: 

accountId <- 1234567
containerId <- 7654321
workspaceId <- 5
# In the Tag Object below you will need to substitute your own trigger Id - 
# see \code{gtm_triggers_list} and \code{gtm_triggers_create}
tag <- list(
  name = "Example DataLayer Push",
  type = "html",
  tagFiringOption = "oncePerEvent",
  parameter = list(
    list(
      type = "template",
      key = "html",
      value = "<script>\n   
               window.dataLayer=window.dataLayer||[];\n   
               window.dataLayer.push({\"event\": \"demoEvent\"});\n
               </script>"
    ),
    list(
      type = "boolean",
      key = "supportDocumentWrite",
      value = "false"
    )
  ),
  firingTriggerId = 20,
  tagFiringOption = "oncePerPage"
)

newTag <- gtm_tags_create(accountId, containerId, workspaceId, tag)

## End(Not run)

googleTagManageR documentation built on April 17, 2022, 1:05 a.m.