gtm_triggers_create: Create a new trigger

View source: R/triggers.R

gtm_triggers_createR Documentation

Create a new trigger

Description

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

Usage

gtm_triggers_create(account_id, container_id, workspace_id, trigger_object)

Arguments

account_id

Account Id

container_id

Container Id

workspace_id

Workspace Id

trigger_object

Trigger Object

See Also

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

https://developers.google.com/tag-platform/tag-manager/api/v2/reference/accounts/containers/workspaces/triggers#resource

Other trigger functions: gtm_triggers_delete(), gtm_triggers_get(), gtm_triggers_list(), gtm_triggers_revert(), gtm_triggers_update()

Examples


## Not run: 
accountId <- 1234567
containerId <- 7654321
workspaceId <- 3

trigger <- list(
  name = 'Demo Trigger',
  type = 'pageview'
)

newTrigger <- gtm_triggers_create(accountId, containerId, workspaceId, trigger)

trigger2 <- list(
name = 'More Complex Trigger',
type = 'pageview',
filter = list(
  list(
    type = 'contains',
    parameter = list(
     list(
       type='template',
       key = 'arg0',
       value='{{Lookup Table}}'
     ),
     list(
       type='template',
       key = 'arg1',
       value='Lookup Value'
     )
    )
   )
  )
 )

newTrigger2 <- gtm_triggers_create(accountId, containerId, workspaceId, trigger2)


## End(Not run)

jamescottrill/googleTagManageR documentation built on April 21, 2022, 5:40 p.m.