Welcome to gtm_manager’s documentation!

Getting Started

Authentication

Simple Authentication

Client Secret

Authentication Options

Scope

class gtm_manager.base.GTMBase(service=None, credentials=None)[source]

GTM Managers

manager.py

class gtm_manager.manager.GTMManager(**kwargs)[source]

Authenticates a users base gtm access.

list_accounts()[source]

Loads from the API and lists all GTM Accounts that a user has access to.

Returns

A list of gtm_manager.account.GTMAccount that the user has access to.

GTM Accounts

account.py

class gtm_manager.account.GTMAccount(account=None, path=None, **kwargs)[source]

Open a specific GTM account.

Parameters
  • account (dict) – An account API representation of the GTM Account. If provided, the account will be not be loaded from the API. account or path argument must be set.

  • path (str) – The GTM API path to the account, i.e “accounts/1234”. If provided instead of account, the account representation will be loaded from the API. path or account argument must be set.

  • **kwargs – Additional keyword args to initialize the base class.

property name

Account display name

Type

str

property shareData

Whether the account shares data anonymously with Google and others

Type

bool

property tagManagerUrl

Auto generated link to the tag manager UI

Type

str

property fingerprint

The fingerprint of the GTM Account as computed at storage time. This value is recomputed whenever the account is modified.

Type

str

property path

GTM Account’s API relative path

Type

str

property raw_body

The raw asset body as returend from the API

Type

obj

property accountId

The Account ID uniquely identifies the GTM Account

Type

str

list_containers(refresh=True)[source]

Load from API and list all containers in this account.

Parameters

refresh (bool) – If containers have already been loaded in the API, force another API request to get the latest list of containers.

Returns

A list of gtm_manager.permission.GTMContainer.

list_permissions(refresh=True)[source]

Load from API and list all permissions in this account.

Parameters

refresh (bool) – If permissions have already been loaded in the API, force another API request to get the latest list of permissions.

Returns

A list of gtm_manager.permission.GTMPermission.

update(name, shareData)[source]

Update the current accounts name and shareData parameters via the API.

Parameters
  • name (str) – Account display name

  • shareData (bool) – Share data setting

create_container(name, usage_context='web', domain_name=None, notes=None)[source]

Create a new container in the current account.

Parameters
  • name (str) – Container display name

  • usage_context (str) – Usage Contexts for the Container. Valid values include: web, android, or ios.

  • domain_name (str) – List of domain names associated with the Container.

  • notes (str) – Container notes

GTM Containers

container.py

class gtm_manager.container.GTMContainer(container=None, path=None, **kwargs)[source]

Open a specific GTM Container.

Parameters
  • container (dict) – An API representation of the GTM Container. If provided, the container will be not be loaded from the API. container or path argument must be set.

  • path (str) – The API path to the resource, i.e “accounts/1234/containers/1234”. If provided instead of container, the api representation will be loaded from the API. path or container argument must be set.

  • **kwargs – Additional keyword args to initialize the base class.

property publicId

Container Public ID. Also known as the GTM-ID.

Type

str

property containerId

The Container ID uniquely identifies the GTM Container.

Type

str

property domainName

List of domain names associated with the Container.

Type

List[str]

property notes

Container Notes

Type

str

property tagManagerUrl

Auto generated link to the tag manager UI

Type

str

property usageContext

List of Usage Contexts for the Container. Valid values include: web, android, or ios.

Type

List[str]

property fingerprint

The fingerprint of the GTM Container as computed at storage time. This value is recomputed whenever the account is modified.

Type

str

property path

GTM Container’s API relative path.

Type

str

property accountId

GTM Account ID

Type

str

property name

Container display name

Type

str

property raw_body

Container raw body

Type

obj

live_version(refresh=True)[source]

Load from API and open the published GTM Version of the current container.

Parameters

refresh (bool) – If live_version has already been loaded from the API, force another API request to get the latest live_version.

Returns

An instance of gtm_manager.version.GTMVersion or None if the GTM Container has no published live version.

create_workspace(name, description='')[source]

Create a new GTM Workspace in the current GTM Container.

Parameters
  • name (str) – Workspace display name

  • description (str) – Workspace description

Returns

A new instance of the created gtm_manager.workspace.GTMWorkspace.

list_workspaces(refresh=True)[source]

Load from API and list all GTM Workspaces in this account.

Parameters

refresh (bool) – If workspaces have already been loaded from the API, force another API request to get the latest list of workspaces.

Returns

A list of gtm_manager.workspace.GTMWorkspace.

list_version_headers(refresh=True)[source]

Load from API and list all GTM Version Headers in this account.

Parameters

refresh (bool) – If version_headers have already been loaded from the API, force another API request to get the latest list of version_headers.

Returns

A list of gtm_manager.version.GTMVersionHeader.

GTM Workspaces

gtm workspace.py

class gtm_manager.workspace.GTMWorkspace(workspace=None, path=None, **kwargs)[source]

Open a specific GTM Workspace.

Parameters
  • workspace (dict) – An API representation of the GTM Workspace. If provided, the resource will be not be loaded from the API. workspace or path argument must be set.

  • path (str) – The API path to the resource, i.e “accounts/1234/containers/1234/workspaces/1234”. If provided instead of workspace, the representation will be loaded from the API. path or workspace argument must be set.

  • **kwargs – Additional keyword args to initialize the base class.

property description

Account display name

Type

str

property name

Account display name

Type

str

property workspaceId

Account display name

Type

str

property tagManagerUrl

Account display name

Type

str

property fingerprint

Account display name

Type

str

property path

Account display name

Type

str

property accountId

Account display name

Type

str

property containerId

Account display name

Type

str

quick_preview(refresh=True)[source]

Get a quick_preview of the current workspace state from the API.

Parameters
  • Args

  • refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

An instance of gtm_manager.version.GTMVersion

delete()[source]

Delete the current workspace.

clear_all_assets(refresh=True)[source]

Clear all assets from the current workspace.

Parameters

refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

trigger_map(refresh=True)[source]

Create a trigger map from the current workspace.

Parameters

refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

A dict having all triggerNames and triggerIds as strings keys with their corresponding triggerIds and triggerNames as string values. The All Pages trigger will always be added as default. For example:

{
    "2147479553": "All Pages",
    "All Pages": "2147479553",
    "Click - My Button": "1",
    "1": "Click - My Button",
}

folder_map(refresh=True)[source]

Create a folder map from the current workspace.

Parameters

refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

A dict having all folderNames and folderIds as strings keys with their corresponding folderIds and folderName as string values. For example:

{
    "My Folder": "1",
    "My Other Folder": "2",
    "1":"My Folder",
    "2": "My Other Folder",
}

disable_built_ins(built_in_type)[source]

Disable built-ins in the current workspace.

Possible values are documented here <https://developers.google.com/tag-manager/api/v2/reference/accounts/containers/workspaces/built_in_variables/create>

Parameters

built_in_type (list of str) – A list of the built in types as strings the call should disable.

create_tag(asset_body)[source]

Create a tag in the current workspace.

@TODO: Add writeable fields.

Parameters

asset_body (dict) – An API representation of a GTM Tag.

Returns

An instance of gtm_manager.tag.GTMTag

create_trigger(asset_body)[source]

Create a trigger in the current workspace.

@TODO: Add writeable fields.

Parameters

asset_body (dict) – An API representation of a GTM Trigger.

Returns

An instance of gtm_manager.trigger.GTMTrigger

create_variable(asset_body)[source]

Create a variable in the current workspace.

@TODO: Add writeable fields.

Parameters

asset_body (dict) – An API representation of a GTM Variable.

Returns

An instance of gtm_manager.variable.GTMVariable

create_folder(name, notes='')[source]

Create a folder in the current workspace.

@TODO: Add writeable fields.

Parameters

asset_body (dict) – An API representation of a GTM Folder.

Returns

An instance of gtm_manager.folder.GTMFolder

create_build_ins(asset_body)[source]

Create built-ins in the current workspace.

Parameters

built_in_type (list of str) – A list of the built in types as strings the call should enable.

list_tags(refresh=False)[source]

List all tags from the current workspace.

Parameters

refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

A list of gtm_manager.tag.GTMTag.

list_triggers(refresh=False)[source]

List all triggers from the current workspace.

Parameters

refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

A list of gtm_manager.triggers.GTMTrigger.

list_variables(refresh=False)[source]

List all variables from the current workspace.

Parameters

refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

A list of gtm_manager.variable.GTMVariable.

list_folders(refresh=False)[source]

List all folders from the current workspace.

Parameters

refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

A list of gtm_manager.folder.GTMFolder.

list_built_in_variables(refresh=False)[source]

List all built in variables from the current workspace.

Parameters

refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

A list of gtm_manager.built_in_variable.GTMBuiltInVariable.

get_tag_by_name(tag_name, refresh=False)[source]

Get a GTM Tag from the GTM Workspace by its name.

Parameters
  • tag_name (str) – The exact name to look for in the GTM Workspace.

  • refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

An instance of gtm_manager.tag.GTMTag.

Raises

gtm_manager.exceptions.TagNotFound

get_trigger_by_name(trigger_name, refresh=False)[source]

Get a GTM Trigger from the GTM Workspace by its name.

Parameters
  • trigger_name (str) – The exact name to look for in the GTM Workspace.

  • refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

An instance of gtm_manager.trigger.GTMTrigger.

Raises

gtm_manager.exceptions.TriggerNotFound

get_variable_by_name(variable_name, refresh=False)[source]

Get a GTM Variable from the GTM Workspace by its name.

Parameters
  • variable_name (str) – The exact name to look for in the GTM Workspace.

  • refresh (bool) – If quick_preview has already been loaded from the API, force another API request to get the latest quick_preview.

Returns

An instance of gtm_manager.variable.GTMVariable.

Raises

gtm_manager.exceptions.VariableNotFound

create_version(name, notes='')[source]

Create a new version from the current state of the workspace.

@TODO: add descroption for sync or publishing errors

Parameters
  • name (str) – The GTM Version display name

  • notes (str) –

Returns

An instance of gtm_manager.version.GTMVersion.

get_status()[source]

Get the status with all workspace changes.

@TODO: Add examples

Returns

A list with all workspace changes.

sync()[source]

Synchronize the workspace to the latest GTM Version.

Returns

What is returned?

Return type

@TODO

GTM Tags

tag.py

class gtm_manager.tag.GTMTag(tag=None, path=None, parent=None, **kwargs)[source]

Open a specific GTM Tag.

Parameters
  • tag (dict) – An API representation of the GTM Tag. If provided, the resource will be not be loaded from the API. tag or path argument must be set.

  • path (str) – The API path to the resource, i.e. “accounts/1234/containers/1234/workspaces/1234/tags/123”. If provided instead of tag, the representation will be loaded from the API. path or tag argument must be set.

  • parent (str) – Required, when the instance is initialized with a tag argument to explizitly set the parent path, i.e. “accounts/1234/containers/1234/workspaces/1234”

  • **kwargs – Additional keyword args to initialize the base class.

property paused

Indicates whether the tag is paused, which prevents the tag from firing.

Type

bool

property setupTag

The list of setup tags. Currently we only allow one.

Type

list

property firingRuleId

Firing rule IDs. A tag will fire when any of the listed rules are true and all of its blockingRuleIds (if any specified) are false.

Type

bool

property accountId

GTM Account ID.

Type

str

property teardownTag

The list of teardown tags. Currently we only allow one.

Type

list

property priority

Represents a Google Tag Manager Parameter. # User defined numeric priority of the tag. Tags are fired asynchronously in order of priority. Tags with higher numeric value fire first. A tag’s priority can be a positive or negative value. The default value is 0.

Type

obj

property workspaceId

GTM Workspace ID.

Type

str

property parameter

The tag’s parameters.

Type

list

property parentFolderId

Parent folder id.

Type

str

property scheduleStartMs

The start timestamp in milliseconds to schedule a tag.

Type

str

property scheduleEndMs

The end timestamp in milliseconds to schedule a tag.

Type

str

property containerId

GTM Container ID.

Type

str

property tagFiringOption

Option to fire this tag.

Type

str

property tagId

The Tag ID uniquely identifies the GTM Tag.

Type

str

property blockingRuleId

Blocking rule IDs. If any of the listed rules evaluate to true, the tag will not fire.

Type

list

property tagManagerUrl

Auto generated link to the tag manager UI

Type

str

property fingerprint

The fingerprint of the GTM Tag as computed at storage time. This value is recomputed whenever the tag is modified.

Type

str

property path

GTM Tag’s API relative path.

Type

str

property firingTriggerId

Firing trigger IDs. A tag will fire when any of the listed triggers are true and all of its blockingTriggerIds (if any specified) are false.

Type

list

property name

Tag display name.

Type

str

property type

GTM Tag Type.

Type

str

property notes

User notes on how to apply this tag in the container.

Type

str

property liveOnly

If set to true, this tag will only fire in the live environment (e.g. not in preview or debug mode).

Type

bool

property blockingTriggerId

Blocking trigger IDs. If any of the listed triggers evaluate to true, the tag will not fire.

Type

list

property parameter_dict

Deepcopy of GTMParameters acceable via their key value.

Type

dict

update(refresh=False, parameter=None, **kwargs)[source]

Update the current tag. The GTM API does not support a partial update. Therfore, this method will send all fields expliztily set in the method arguments and those cached in the instance properties.

GTMParameters passed in a list as the parameter argument, will be merged recursivly with the exsisting parameters based on their parameter key.

All other API resource properties can be overwritten by specifying the property name as keyword arguments on the method call.

Parameters
  • refresh (bool) – Force a refresh of the entire GTMTag instance to prevent implicitly sending stale property data.

  • parameter (list) – gtm_manager.parameter.GTMParameter s to be merged recursivly with the exsisting parameters based on their parameter key.

  • **kwargs – Additional resource properties to update with this call.

Raises

ValueError

delete()[source]

Delete the current tag.

GTM Triggers

trigger.py

class gtm_manager.trigger.GTMTrigger(trigger=None, path=None, parent=None, **kwargs)[source]

Open a specific GTM Trigger.

Parameters
  • trigger (dict) – An API representation of the GTM Trigger. If provided, the resource will be not be loaded from the API. trigger or path argument must be set.

  • path (str) – The API path to the resource, i.e. “accounts/1234/containers/1234/workspaces/1234/trigger/123”. If provided instead of trigger, the representation will be loaded from the API. path or trigger argument must be set.

  • parent (str) – Required, when the instance is initialized with a trigger argument to explizitly set the parent path, i.e. “accounts/1234/containers/1234/workspaces/1234”

  • **kwargs – Additional keyword args to initialize the base class.

property maxTimerLengthSeconds

Represents a Google Tag Manager Parameter. - Max time to fire Timer Events (in seconds). Only valid for AMP Timer trigger.

Type

obj

property totalTimeMinMilliseconds

Represents a Google Tag Manager Parameter. - A visibility trigger minimum total visible time (in milliseconds). Only valid for AMP Visibility trigger.

Type

obj

property uniqueTriggerId

Represents a Google Tag Manager Parameter. - Globally unique id of the trigger that auto-generates this (a Form Submit, Link Click or Timer listener) if any. Used to make incompatible auto-events work together with trigger filtering based on trigger ids. This value is populated during output generation since the tags implied by triggers don”t exist until then. Only valid for Form Submit, Link Click and Timer triggers.

Type

obj

property verticalScrollPercentageList

Represents a Google Tag Manager Parameter. - List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled vertically. Only valid for AMP scroll triggers.

Type

obj

property horizontalScrollPercentageList

Represents a Google Tag Manager Parameter. - List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled horizontally. Only valid for AMP scroll triggers.

Type

obj

property containerId

GTM Container ID.

Type

str

property waitForTagsTimeout

Represents a Google Tag Manager Parameter. - How long to wait (in milliseconds) for tags to fire when “waits_for_tags” above evaluates to true. Only valid for Form Submission and Link Click triggers.

Type

obj

property accountId

GTM Account ID.

Type

str

property waitForTags

Represents a Google Tag Manager Parameter. - Whether or not we should delay the form submissions or link opening until all of the tags have fired (by preventing the default action and later simulating the default action). Only valid for Form Submission and Link Click triggers.

Type

str

property intervalSeconds

Represents a Google Tag Manager Parameter. - Time between Timer Events to fire (in seconds). Only valid for AMP Timer trigger.

Type

obj

property eventName

Represents a Google Tag Manager Parameter. - Name of the GTM event that is fired. Only valid for Timer triggers.

Type

obj

property visibilitySelector

Represents a Google Tag Manager Parameter. - A visibility trigger CSS selector (i.e. “-id”). Only valid for AMP Visibility trigger.

Type

obj

property workspaceId

GTM Workspace ID.

Type

str

property customEventFilter

Used in the case of custom event, which is fired iff all Conditions are true.

Type

list

property parameter

Additional parameters.

Type

list

property parentFolderId

Parent folder id.

Type

str

property continuousTimeMinMilliseconds

Represents a Google Tag Manager Parameter. - A visibility trigger minimum continuous visible time (in milliseconds). Only valid for AMP Visibility trigger.

Type

obj

property selector

Represents a Google Tag Manager Parameter. - A click trigger CSS selector (i.e. “a”, “button” etc.). Only valid for AMP Click trigger.

Type

obj

property triggerId

The Trigger ID uniquely identifies the GTM Trigger.

Type

str

property tagManagerUrl

Auto generated link to the tag manager UI

Type

str

property fingerprint

The fingerprint of the GTM Trigger as computed at storage time. This value is recomputed whenever the trigger is modified.

Type

str

property visiblePercentageMax

Represents a Google Tag Manager Parameter. - A visibility trigger maximum percent visibility. Only valid for AMP Visibility trigger.

Type

obj

property path

GTM Trigger”s API relative path.

Type

str

property name

Trigger display name.

Type

str

property visiblePercentageMin

Represents a Google Tag Manager Parameter. - A visibility trigger minimum percent visibility. Only valid for AMP Visibility trigger.

Type

obj

property type

Defines the data layer event that causes this trigger.

Type

str

property notes

User notes on how to apply this trigger in the container.

Type

str

property interval

Represents a Google Tag Manager Parameter. - Time between triggering recurring Timer Events (in milliseconds). Only valid for Timer triggers.

Type

obj

property filter

The trigger will only fire iff all Conditions are true.

Type

list

property autoEventFilter

Used in the case of auto event tracking.

Type

list

property limit

Represents a Google Tag Manager Parameter. - Limit of the number of GTM events this Timer Trigger will fire. If no limit is set, we will continue to fire GTM events until the user leaves the page. Only valid for Timer triggers.

Type

obj

property checkValidation

Represents a Google Tag Manager Parameter. - Whether or not we should only fire tags if the form submit or link click event is not cancelled by some other event handler (e.g. because of validation). Only valid for Form Submission and Link Click triggers.

Type

obj

update(refresh=False, parameter=None, **kwargs)[source]

Update the current trigger. The GTM API does not support a partial update. Therfore, this method will send all fields expliztily set in the method arguments and those cached in the instance properties.

GTMParameters passed in a list as the parameter argument, will be merged recursivly with the exsisting parameters based on their parameter key.

All other API resource properties can be overwritten by specifying the property name as keyword arguments on the method call.

Parameters
  • refresh (bool) – Force a refresh of the entire GTMTrigger instance to prevent implicitly sending stale property data.

  • parameter (list) – gtm_manager.parameter.GTMParameter list to be merged recursivly with the exsisting parameters based on their parameter key.

  • **kwargs – Additional resource properties to update with this call.

Raises

ValueError

delete()[source]

Delete the current trigger.

GTM Variables

variable.py

class gtm_manager.variable.GTMVariable(variable=None, path=None, parent=None, **kwargs)[source]

Open a specific GTM Variable.

Parameters
  • trigger (dict) – An API representation of the GTM trigger. If provided, the resource will be not be loaded from the API. trigger or path argument must be set.

  • path (str) – The API path to the resource, i.e. “accounts/1234/containers/1234/workspaces/1234/trigger/123”. If provided instead of trigger, the representation will be loaded from the API. path or trigger argument must be set.

  • parent (str) – Required, when the instance is initialized with a trigger argument to explizitly set the parent path, i.e. “accounts/1234/containers/1234/workspaces/1234”

  • **kwargs – Additional keyword args to initialize the base class.

property scheduleStartMs

The start timestamp in milliseconds to schedule a variable.

Type

str

property scheduleEndMs

The end timestamp in milliseconds to schedule a variable.

Type

str

property name

Variable display name.

Type

str

property variableId

The Variable ID uniquely identifies the GTM Variable.

Type

str

property type

GTM Variable Type.

Type

str

property notes

User notes on how to apply this variable in the container.

Type

str

property enablingTriggerId

For mobile containers only - A list of trigger IDs for enabling conditional variables; the variable is enabled if one of the enabling triggers is true while all the disabling triggers are false. Treated as an unordered set.

Type

list

property workspaceId

GTM Workspace ID.

Type

str

property tagManagerUrl

Auto generated link to the tag manager UI

Type

str

property fingerprint

The fingerprint of the GTM Variable as computed at storage time. This value is recomputed whenever the variable is modified.

Type

str

property path

GTM Variable’s API relative path.

Type

str

property accountId

GTM Account ID.

Type

str

property parameter

The variable’s parameters.

Type

list

property parentFolderId

Parent folder id.

Type

str

property disablingTriggerId

For mobile containers only - A list of trigger IDs for disabling conditional variables; the variable is enabled if one of the enabling trigger is true while all the disabling trigger are false. Treated as an unordered set.

Type

list

property containerId

GTM Container ID.

Type

str

property parameter_dict

GTM parameters acceable via their key value.

Type

dict

constant_value()[source]
update(refresh=False, parameter=None, **kwargs)[source]

Update the current variable. The GTM API does not support a partial update. Therfore, this method will send all fields expliztily set in the method arguments and those cached in the instance properties.

GTMParameters passed in a list as the parameter argument, will be merged recursivly with the exsisting parameters based on their parameter key.

All other API resource properties can be overwritten by specifying the property name as keyword arguments on the method call.

Parameters
  • refresh (bool) – Force a refresh of the entire GTMVariable instance to prevent implicitly sending stale property data.

  • parameter (list) – gtm_manager.parameter.GTMParameter list to be merged recursivly with the exsisting parameters based on their parameter key.

  • **kwargs – Additional resource properties to update with this call.

Raises

ValueError

delete()[source]

Delete the current variable.

GTM Folders

folder.py

class gtm_manager.folder.GTMFolder(folder=None, path=None, parent=None, **kwargs)[source]

Open a specific GTM Folder.

Parameters
  • folder (dict) – An API representation of the GTM Folder. If provided, the resource will be not be loaded from the API. folder or path argument must be set.

  • path (str) – The API path to the resource, i.e. “accounts/1234/containers/1234/workspaces/1234/folders/123”. If provided instead of folder, the representation will be loaded from the API. path or folder argument must be set.

  • parent (str) – Required, when the instance is initialized with a folder argument to explizitly set the parent path, i.e. “accounts/1234/containers/1234/workspaces/1234”

  • **kwargs – Additional keyword args to initialize the base class.

property containerId

The container that this version was taken from.

Type

str

property notes

The container that this version was taken from.

Type

str

property workspaceId

The container that this version was taken from.

Type

str

property tagManagerUrl

The container that this version was taken from.

Type

str

property fingerprint

The container that this version was taken from.

Type

str

property folderId

The container that this version was taken from.

Type

str

property accountId

The container that this version was taken from.

Type

str

property name

The container that this version was taken from.

Type

str

property path

The container that this version was taken from.

Type

str

delete()[source]

Delete the current folder.

GTM Versions

version

class gtm_manager.version.GTMVersion(version=None, path=None, workspaceId=None, **kwargs)[source]

Open a specific GTM Version.

Parameters
  • version (dict) – An API representation of the GTM Forlder. If provided, the resource will be not be loaded from the API. version or path argument must be set.

  • path (str) – The API path to the resource, i.e. “accounts/1234/containers/1234/version/123”. If provided instead of version, the representation will be loaded from the API. path or version argument must be set.

  • parent (str) – Required, when the instance is initialized with a version argument to explizitly set the parent path, i.e. “accounts/1234/containers/1234/workspaces/1234”

  • **kwargs – Additional keyword args to initialize the base class.

property container

The container that this version was taken from.

Type

gtm_manager.container.GTMContainer

property containerId

GTM Container ID.

Type

str

property zone

The zones in the container that this version was taken from.

Type

list

property deleted

A value of true indicates this container version has been deleted.

Type

bool

property trigger

The triggers in the container that this version was taken from.

Type

list

property description

Container version description.

Type

str

property builtInVariable

The built-in variables in the container that this version was taken from.

Type

list

property name

Container version display name.

Type

str

property tag

The tags in the container that this version was taken from.

Type

list

property tagManagerUrl

Auto generated link to the tag manager UI

Type

str

property containerVersionId

The Container Version ID uniquely identifies the GTM Container Version.

Type

str

property fingerprint

The fingerprint of the GTM Container Version as computed at storage time. This value is recomputed whenever the container version is modified.

Type

str

property variable

The variables in the container that this version was taken from.

Type

list

property path

GTM ContainerVersions’s API relative path.

Type

str

property folder

The folders in the container that this version was taken from.

Type

list

property accountId

GTM Account ID.

Type

str

publish()[source]
class gtm_manager.version.GTMVersionHeader(versionHeader)[source]

GTM Permissions

permission.py

class gtm_manager.permission.GTMPermission(permission=None, path=None, **kwargs)[source]

Open a specific GTM Permission.

Parameters
  • permission (dict) – An API representation of the GTM Permission. If provided, the resource will be not be loaded from the API. permission or path argument must be set.

  • path (str) – The API path to the resource, i.e. “accounts/1234/permissions/1234”. If provided instead of permission, the representation will be loaded from the API. path or permission argument must be set.

  • **kwargs – Additional keyword args to initialize the base class.

property path

GTM Permission’s API relative path.

Type

str

property containerAccess

GTM Permission’s API relative path.

Type

str

property accountAccess

GTM Permission’s API relative path.

Type

str

property emailAddress

GTM Permission’s API relative path.

Type

str

property accountId

GTM Permission’s API relative path.

Type

str

class gtm_manager.permission.GTMContainerAccess(containerAccess)[source]

GTM Parameters

parameter.py

class gtm_manager.parameter.GTMParameter(parameter)[source]
to_obj()[source]
copy()[source]

Rate Limiting

Exceptions

excpetions.py

exception gtm_manager.exceptions.GTMManagerException[source]
exception gtm_manager.exceptions.AuthError[source]
exception gtm_manager.exceptions.VariableNotFound(variable_name, parent)[source]
exception gtm_manager.exceptions.TagNotFound(tag_name, parent)[source]
exception gtm_manager.exceptions.TriggerNotFound(trigger_name, parent)[source]
exception gtm_manager.exceptions.RateLimitExceeded[source]

Indices and tables