Google Tag Manager · Arazzo Workflow

Google Tag Manager Build and Publish a Tag End to End

Version 1.0.0

Workspace, trigger, tag, version, and publish in a single release flow.

1 workflow 1 source API 1 provider
View Spec View on GitHub AnalyticsConversion TrackingMarketingTag ManagementTrackingArazzoWorkflows

Provider

google-tag-manager

Workflows

build-and-publish-tag
Author a trigger and tag in a fresh workspace, then version and publish.
Creates a workspace, a trigger, and a trigger-fired tag under the supplied container, then creates a container version from the workspace and publishes it when it compiles cleanly.
5 steps inputs: accessToken, containerPath, tagName, tagType, triggerName, triggerType, versionName, workspaceName outputs: publishedVersionPath, versionPath, workspacePath
1
createWorkspace
createWorkspace
Open a new workspace inside the supplied container.
2
createTrigger
createTrigger
Create a trigger in the new workspace.
3
createTag
createTag
Create a tag that fires on the new trigger.
4
createVersion
createWorkspaceVersion
Freeze the workspace into a container version.
5
publishVersion
publishContainerVersion
Publish the new container version so it becomes the live version.

Source API Descriptions

Arazzo Workflow Specification

google-tag-manager-build-and-publish-tag-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Google Tag Manager Build and Publish a Tag End to End
  summary: Workspace, trigger, tag, version, and publish in a single release flow.
  description: >-
    The complete authoring-to-release path. The workflow opens a workspace,
    creates a trigger, creates a tag that fires on that trigger, freezes the
    workspace into a container version, and publishes the version live when it
    compiles cleanly. Each step spells out its request inline, including the
    inline bearer authorization, so the flow can be read and executed without
    opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: googleTagManagerApi
  url: ../openapi/google-tag-manager-api-v2-openapi.yml
  type: openapi
workflows:
- workflowId: build-and-publish-tag
  summary: Author a trigger and tag in a fresh workspace, then version and publish.
  description: >-
    Creates a workspace, a trigger, and a trigger-fired tag under the supplied
    container, then creates a container version from the workspace and publishes
    it when it compiles cleanly.
  inputs:
    type: object
    required:
    - accessToken
    - containerPath
    - workspaceName
    - triggerName
    - triggerType
    - tagName
    - tagType
    - versionName
    properties:
      accessToken:
        type: string
        description: OAuth 2.0 bearer access token for the Tag Manager API.
      containerPath:
        type: string
        description: >-
          The container API relative path, e.g.
          accounts/{accountId}/containers/{containerId}.
      workspaceName:
        type: string
        description: Display name for the new workspace.
      triggerName:
        type: string
        description: Display name for the new trigger.
      triggerType:
        type: string
        description: GTM trigger event type (e.g. pageview, click).
      tagName:
        type: string
        description: Display name for the new tag.
      tagType:
        type: string
        description: GTM tag type identifier (e.g. html, gaawe).
      versionName:
        type: string
        description: Display name for the container version that will be published.
  steps:
  - stepId: createWorkspace
    description: >-
      Open a new workspace inside the supplied container.
    operationId: createWorkspace
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: parent
      in: path
      value: $inputs.containerPath
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.workspaceName
        description: Workspace for an end-to-end build-and-publish flow.
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      workspacePath: $response.body#/path
  - stepId: createTrigger
    description: >-
      Create a trigger in the new workspace.
    operationId: createTrigger
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: parent
      in: path
      value: $steps.createWorkspace.outputs.workspacePath
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.triggerName
        type: $inputs.triggerType
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      triggerId: $response.body#/triggerId
  - stepId: createTag
    description: >-
      Create a tag that fires on the new trigger.
    operationId: createTag
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: parent
      in: path
      value: $steps.createWorkspace.outputs.workspacePath
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.tagName
        type: $inputs.tagType
        firingTriggerId:
        - $steps.createTrigger.outputs.triggerId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      tagPath: $response.body#/path
  - stepId: createVersion
    description: >-
      Freeze the workspace into a container version.
    operationId: createWorkspaceVersion
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: workspacePath
      in: path
      value: $steps.createWorkspace.outputs.workspacePath
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.versionName
        notes: Created by the Arazzo build-and-publish flow.
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      versionPath: $response.body#/containerVersion/path
      compilerError: $response.body#/compilerError
    onSuccess:
    - name: compiled
      type: goto
      stepId: publishVersion
      criteria:
      - context: $response.body
        condition: $.compilerError == false
        type: jsonpath
    - name: compileFailed
      type: end
      criteria:
      - context: $response.body
        condition: $.compilerError == true
        type: jsonpath
  - stepId: publishVersion
    description: >-
      Publish the new container version so it becomes the live version.
    operationId: publishContainerVersion
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: versionPath
      in: path
      value: $steps.createVersion.outputs.versionPath
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      publishedVersionPath: $response.body#/containerVersion/path
  outputs:
    workspacePath: $steps.createWorkspace.outputs.workspacePath
    versionPath: $steps.createVersion.outputs.versionPath
    publishedVersionPath: $steps.publishVersion.outputs.publishedVersionPath