Matomo Tag Manager API
Exposes the Tag Manager API for managing containers, versions, tags, triggers, and variables. The endpoints also provide installation metadata, publishing workflows, preview controls, and import/export operations. A container may have several versions, and the current editable version is exposed as the "draft" version by {@link TagManager.getContainer}.
Operations 47
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
GET
/index.php?module=API&method=TagManager.getAvailableContexts
List contexts that support tag types · Tag manager get available contexts
#
Ask an LLM
“Which container contexts, like web or Android, does Tag Manager currently support?”
“What contexts can I choose from when I set up a new container?”
Tell an agent
List the Tag Manager contexts that expose at least one tag type.
Show me which container contexts I can pick from.
GET
/index.php?module=API&method=TagManager.getAvailableEnvironments
List environments for container releases · Tag manager get available environments
#
Ask an LLM
“Which release environments exist for publishing Tag Manager containers?”
“Is there a staging environment I can release a container to besides live?”
Tell an agent
List every environment a container release can go to.
Show the available container release environments across the instance.
GET
/index.php?module=API&method=TagManager.getAvailableEnvironmentsWithPublishCapability
List environments I can publish to for a site · Tag manager get available environments with publish capability
#
Ask an LLM
“Which environments am I personally allowed to publish containers to on this site?”
“Can my user account release to the live environment for a given website?”
Tell an agent
List the environments I have permission to publish to on site {idSite}.
Check which release environments my user can publish containers to for website {idSite}.
GET
/index.php?module=API&method=TagManager.getAvailableTagFireLimits
List the fire limit options for tags · Tag manager get available tag fire limits
#
Ask an LLM
“What fire limit options can I set so a tag only fires once per page or once ever?”
“Which values are valid for a tag's fire limit?”
Tell an agent
List the supported tag fire limit options.
Show me the choices for limiting how often a tag fires.
GET
/index.php?module=API&method=TagManager.getAvailableComparisons
List comparison operators for trigger conditions · Tag manager get available comparisons
#
Ask an LLM
“Which comparison operators, like contains or starts with, can trigger conditions use?”
“What matching options are available for variable lookup tables?”
Tell an agent
List the comparison operators available for trigger conditions and lookup tables.
Show the matching operators I can use in a trigger condition.
GET
/index.php?module=API&method=TagManager.getAvailableTagTypesInContext
List tag templates for a context · Tag manager get available tag types in context
#
Ask an LLM
“What tag types can I add to a web container?”
“Which tag templates are supported in a particular container context?”
Tell an agent
List the tag templates supported in context {idContext}.
Show which kinds of tags I can create for the {idContext} context.
GET
/index.php?module=API&method=TagManager.getAvailableTriggerTypesInContext
List trigger templates for a context · Tag manager get available trigger types in context
#
Ask an LLM
“What trigger types, like page view or click, are available in a web container?”
“Which trigger templates does a given container context support?”
Tell an agent
List the trigger templates available in context {idContext}.
Show the trigger types I can set up for a {idContext} container.
GET
/index.php?module=API&method=TagManager.getAvailableVariableTypesInContext
List variable templates for a context · Tag manager get available variable types in context
#
Ask an LLM
“Which variable types can I create manually in a web container?”
“What variable templates does a given context let me add by hand?”
Tell an agent
List the manually creatable variable templates for context {idContext}.
Show the variable types I can define myself in the {idContext} context.
GET
/index.php?module=API&method=TagManager.getContainerEmbedCode
Get the embed code for a container · Tag manager get container embed code
#
Ask an LLM
“Where do I get the snippet to paste into my site so a Matomo Tag Manager container loads?”
“Is the container embed code different for each release environment?”
Tell an agent
Get the embed code for container {idContainer} on site {idSite} in the {environment} environment.
Give me the script snippet that loads container {idContainer} live on website {idSite}.
GET
/index.php?module=API&method=TagManager.getContainerInstallInstructions
Get install instructions for a container · Tag manager get container install instructions
#
Ask an LLM
“Are there step-by-step instructions for installing a container in a JavaScript framework like React?”
“How should I install a container release on a single-page app?”
Tell an agent
Get installation instructions for container {idContainer} on site {idSite} for the {environment} environment.
Show how to install container {idContainer} in a {jsFramework} app for site {idSite}.
GET
/index.php?module=API&method=TagManager.getContainerTags
List tags in a container version · Tag manager get container tags
#
Ask an LLM
“Which tags are configured in my container's current version?”
“Can I see every tag set up in a specific container version at once?”
Tell an agent
List all tags in version {idContainerVersion} of container {idContainer} on site {idSite}.
Show every configured tag in container {idContainer}, version {idContainerVersion}.
GET
/index.php?module=API&method=TagManager.createDefaultContainerForSite
Create a default web container for a site · Tag manager create default container for site
#
Ask an LLM
“Can I generate a ready-made container with the standard Matomo tracking already set up?”
“What's the quickest way to get a working web container on a new site?”
Tell an agent
Create the default web container with standard tracking for site {idSite}.
Set up a starter Tag Manager container for website {idSite}.
GET
/index.php?module=API&method=TagManager.addContainerTag
Add a tag to a container version · Tag manager add container tag
#
Ask an LLM
“How do I add a new tag to a Tag Manager container?”
“Can a new tag be scheduled to only run between a start and end date?”
Tell an agent
Add a {type} tag named {name} to version {idContainerVersion} of container {idContainer} on site {idSite}.
Create tag {name} of type {type} in container {idContainer} that fires on triggers {fireTriggerIds}.
GET
/index.php?module=API&method=TagManager.updateContainerTag
Update an existing tag · Tag manager update container tag
#
Ask an LLM
“How do I change the triggers on a tag that already exists?”
“Can I adjust an existing tag's fire delay or priority?”
Tell an agent
Rename tag {idTag} in container {idContainer} version {idContainerVersion} to {name}.
Change the fire limit of existing tag {idTag} to {fireLimit}.
GET
/index.php?module=API&method=TagManager.deleteContainerTag
Delete a tag from a container · Tag manager delete container tag
#
Ask an LLM
“How do I remove a tag from a container version entirely?”
“Is deleting a tag different from pausing it?”
Tell an agent destructive · confirm first
Delete tag {idTag} from version {idContainerVersion} of container {idContainer} on site {idSite}.
Remove tag {idTag} from container {idContainer} for good.
GET
/index.php?module=API&method=TagManager.pauseContainerTag
Pause a tag · Tag manager pause container tag
#
Ask an LLM
“Can I temporarily stop a tag from firing without deleting it?”
“How do I disable a single tag in a container for now?”
Tell an agent
Pause tag {idTag} in container {idContainer} version {idContainerVersion}.
Stop tag {idTag} from firing on site {idSite} without removing it.
GET
/index.php?module=API&method=TagManager.resumeContainerTag
Resume a paused tag · Tag manager resume container tag
#
Ask an LLM
“How do I turn a paused tag back on?”
“Can a tag I paused earlier start firing again?”
Tell an agent
Resume paused tag {idTag} in container {idContainer} version {idContainerVersion}.
Re-enable tag {idTag} on site {idSite} so it fires again.
GET
/index.php?module=API&method=TagManager.getContainerTag
Get one tag's configuration · Tag manager get container tag
#
Ask an LLM
“What triggers and parameters does a specific tag use?”
“Can I look up the full settings of one tag by its ID?”
Tell an agent
Show the configuration of tag {idTag} in container {idContainer} version {idContainerVersion}.
Fetch the settings for tag {idTag} on site {idSite}.
GET
/index.php?module=API&method=TagManager.getContainerTriggerReferences
Find where a trigger is used · Tag manager get container trigger references
#
Ask an LLM
“Which tags depend on a trigger before I delete it?”
“Where is a particular trigger referenced inside a container version?”
Tell an agent
Find every place trigger {idTrigger} is referenced in container {idContainer} version {idContainerVersion}.
Show which tags use trigger {idTrigger} on site {idSite}.
GET
/index.php?module=API&method=TagManager.getContainerTriggers
List triggers in a container version · Tag manager get container triggers
#
Ask an LLM
“What triggers are configured in a container version?”
“Can I get every trigger defined in my container in one call?”
Tell an agent
List all triggers in version {idContainerVersion} of container {idContainer} on site {idSite}.
Show every configured trigger in container {idContainer}.
GET
/index.php?module=API&method=TagManager.addContainerTrigger
Add a trigger to a container version · Tag manager add container trigger
#
Ask an LLM
“How do I create a trigger that fires on a click or page view?”
“Can a new trigger include conditions such as a URL that contains a value?”
Tell an agent
Add a {type} trigger named {name} to container {idContainer} version {idContainerVersion} on site {idSite}.
Create trigger {name} of type {type} with conditions {conditions} in container {idContainer}.
GET
/index.php?module=API&method=TagManager.updateContainerTrigger
Update an existing trigger · Tag manager update container trigger
#
Ask an LLM
“How do I change the conditions on a trigger I already created?”
“Can I rename an existing trigger in a container version?”
Tell an agent
Rename trigger {idTrigger} in container {idContainer} version {idContainerVersion} to {name}.
Replace the conditions on existing trigger {idTrigger} with {conditions}.
GET
/index.php?module=API&method=TagManager.deleteContainerTrigger
Delete a trigger from a container · Tag manager delete container trigger
#
Ask an LLM
“How do I remove a trigger I no longer need from a container?”
“Can I delete a trigger out of a specific container version?”
Tell an agent destructive · confirm first
Delete trigger {idTrigger} from container {idContainer} version {idContainerVersion} on site {idSite}.
Remove trigger {idTrigger} from container {idContainer}.
GET
/index.php?module=API&method=TagManager.getContainerTrigger
Get one trigger's configuration · Tag manager get container trigger
#
Ask an LLM
“What conditions does a specific trigger check?”
“Can I look up a single trigger's settings by its ID?”
Tell an agent
Show the configuration of trigger {idTrigger} in container {idContainer} version {idContainerVersion}.
Fetch trigger {idTrigger} details for site {idSite}.
GET
/index.php?module=API&method=TagManager.getContainerVariableReferences
Find where a variable is used · Tag manager get container variable references
#
Ask an LLM
“Which tags or triggers reference a variable before I change it?”
“Where is a particular variable used inside a container version?”
Tell an agent
Find every reference to variable {idVariable} in container {idContainer} version {idContainerVersion}.
Show what depends on variable {idVariable} on site {idSite}.
GET
/index.php?module=API&method=TagManager.getContainerVariables
List manually configured variables · Tag manager get container variables
#
Ask an LLM
“Which variables have I created myself in a container version?”
“Can I list only my custom variables, not the built-in ones?”
Tell an agent
List the manually configured variables in container {idContainer} version {idContainerVersion} on site {idSite}.
Show the custom variables I defined in container {idContainer}.
GET
/index.php?module=API&method=TagManager.getAvailableContainerVariables
List manual and preconfigured variables · Tag manager get available container variables
#
Ask an LLM
“What built-in variables like page URL can I reference alongside my own?”
“Which variables, preconfigured and manual, are usable in a container version?”
Tell an agent
List all usable variables, built-in and manual, in container {idContainer} version {idContainerVersion}.
Show the preconfigured variables available for container {idContainer} on site {idSite}.
GET
/index.php?module=API&method=TagManager.addContainerVariable
Add a variable to a container version · Tag manager add container variable
#
Ask an LLM
“How do I create a custom variable in Tag Manager?”
“Can a new variable have a default value or a lookup table?”
Tell an agent
Add a {type} variable named {name} to container {idContainer} version {idContainerVersion} on site {idSite}.
Create variable {name} of type {type} with default value {defaultValue}.
GET
/index.php?module=API&method=TagManager.updateContainerVariable
Update an existing variable · Tag manager update container variable
#
Ask an LLM
“How do I change the lookup table on a variable I already made?”
“Can I rename an existing variable in my container?”
Tell an agent
Rename variable {idVariable} in container {idContainer} version {idContainerVersion} to {name}.
Set the default value of existing variable {idVariable} to {defaultValue}.
GET
/index.php?module=API&method=TagManager.deleteContainerVariable
Delete a variable from a container · Tag manager delete container variable
#
Ask an LLM
“How do I remove a variable I don't use anymore?”
“Can I delete a custom variable from a container version?”
Tell an agent destructive · confirm first
Delete variable {idVariable} from container {idContainer} version {idContainerVersion} on site {idSite}.
Remove variable {idVariable} from container {idContainer}.
GET
/index.php?module=API&method=TagManager.getContainerVariable
Get one variable's configuration · Tag manager get container variable
#
Ask an LLM
“What type and default value does a particular variable have?”
“Can I look up a single variable's settings by its ID?”
Tell an agent
Show the configuration of variable {idVariable} in container {idContainer} version {idContainerVersion}.
Fetch variable {idVariable} details for site {idSite}.
GET
/index.php?module=API&method=TagManager.getContainers
List containers for a site · Tag manager get containers
#
Ask an LLM
“Which Tag Manager containers exist for my website?”
“Can I see all containers set up on one site?”
Tell an agent
List all containers for site {idSite}.
Show me the Tag Manager containers on website {idSite}.
GET
/index.php?module=API&method=TagManager.addContainer
Create a new container · Tag manager add container
#
Ask an LLM
“How do I create a new container for a website from scratch?”
“Can a new container ignore or sync the GTM data layer?”
Tell an agent
Create a {context} container named {name} on site {idSite}.
Add container {name} for site {idSite} with description {description}.
GET
/index.php?module=API&method=TagManager.updateContainer
Update a container's settings · Tag manager update container
#
Ask an LLM
“How do I rename a container or change its description?”
“Can I turn on GTM data layer syncing for a container that already exists?”
Tell an agent
Rename container {idContainer} on site {idSite} to {name}.
Set activelySyncGtmDataLayer to {activelySyncGtmDataLayer} on existing container {idContainer}.
GET
/index.php?module=API&method=TagManager.createContainerVersion
Save a new container version · Tag manager create container version
#
Ask an LLM
“How do I snapshot my current draft into a named container version?”
“Can I create a new version based on an older container version instead of the draft?”
Tell an agent
Create version {name} from the current draft of container {idContainer} on site {idSite}.
Make a new version called {name} copied from version {idContainerVersion} of container {idContainer}.
GET
/index.php?module=API&method=TagManager.updateContainerVersion
Rename or describe a container version · Tag manager update container version
#
Ask an LLM
“Can I change the name or description of a saved container version?”
“How do I relabel a container version after creating it?”
Tell an agent
Rename version {idContainerVersion} of container {idContainer} to {name}.
Update the description of container version {idContainerVersion} on site {idSite} to {description}.
GET
/index.php?module=API&method=TagManager.getContainerVersions
List versions of a container · Tag manager get container versions
#
Ask an LLM
“What versions have been saved for a container?”
“Can I see a container's version history?”
Tell an agent
List all versions of container {idContainer} on site {idSite}.
Show the version history for container {idContainer}.
GET
/index.php?module=API&method=TagManager.getContainerVersion
Get details of a container version · Tag manager get container version
#
Ask an LLM
“What's in a specific container version and where is it released?”
“Can I get the details of one container version by its ID?”
Tell an agent
Get details for version {idContainerVersion} of container {idContainer} on site {idSite}.
Look up container version {idContainerVersion}.
GET
/index.php?module=API&method=TagManager.deleteContainerVersion
Delete a container version · Tag manager delete container version
#
Ask an LLM
“How do I delete an old container version I no longer need?”
“Can I remove a single version without deleting the whole container?”
Tell an agent destructive · confirm first
Delete version {idContainerVersion} of container {idContainer} on site {idSite}.
Remove container version {idContainerVersion} but keep container {idContainer}.
GET
/index.php?module=API&method=TagManager.publishContainerVersion
Publish a container version to an environment · Tag manager publish container version
#
Ask an LLM
“How do I release a container version to the live site?”
“Can I publish a version to staging first before production?”
Tell an agent
Publish version {idContainerVersion} of container {idContainer} to the {environment} environment.
Release container {idContainer} version {idContainerVersion} live on site {idSite} in {environment}.
GET
/index.php?module=API&method=TagManager.deleteContainer
Delete a container and all its versions · Tag manager delete container
#
Ask an LLM
“How do I delete a whole container, including its versions and releases?”
“What happens to releases when I remove a container entirely?”
Tell an agent destructive · confirm first
Delete container {idContainer} on site {idSite} with all its versions and releases.
Permanently remove the entire container {idContainer}.
GET
/index.php?module=API&method=TagManager.getContainer
Get a container's details · Tag manager get container
#
Ask an LLM
“What's the ID of my container's draft version, and which releases does it have?”
“Can I see one container's settings along with its versions and releases?”
Tell an agent
Get the details of container {idContainer} on site {idSite}, including its draft ID and releases.
Look up container {idContainer} and tell me which version is the draft.
GET
/index.php?module=API&method=TagManager.enablePreviewMode
Turn on preview/debug mode for a container · Tag manager enable preview mode
#
Ask an LLM
“How do I debug my tags in preview mode before publishing?”
“Can I preview a specific container version instead of the current draft?”
Tell an agent
Enable preview mode for container {idContainer} on site {idSite}.
Turn on debug mode for version {idContainerVersion} of container {idContainer}.
GET
/index.php?module=API&method=TagManager.disablePreviewMode
Turn off preview/debug mode for a container · Tag manager disable preview mode
#
Ask an LLM
“How do I exit preview mode once I'm done debugging tags?”
“Can I switch off the debug overlay for a container?”
Tell an agent
Disable preview mode for container {idContainer} on site {idSite}.
Turn off the debugger for container {idContainer}.
GET
/index.php?module=API&method=TagManager.changeDebugUrl
Change the debug site URL · Tag manager change debug url
#
Ask an LLM
“Can I point the Tag Manager debugger at a different page URL?”
“How do I update the site URL used while debugging tags?”
Tell an agent
Set the debug site URL for site {idSite} to {url}.
Change the tag debugging URL to {url}.
GET
/index.php?module=API&method=TagManager.exportContainerVersion
Export a container version · Tag manager export container version
#
Ask an LLM
“Can I export all tags, triggers and variables from a container to copy elsewhere?”
“Does exporting default to the current draft if I don't pick a version?”
Tell an agent
Export the current draft of container {idContainer} on site {idSite}.
Export version {idContainerVersion} of container {idContainer} with its tags, triggers and variables.
GET
/index.php?module=API&method=TagManager.importContainerVersion
Import an exported version into the draft · Tag manager import container version
#
Ask an LLM
“Will importing a container export overwrite the tags in my current draft?”
“Can I back up my draft under a name before importing an export?”
Tell an agent destructive · confirm first
Import {exportedContainerVersion} into the draft of container {idContainer} on site {idSite}.
Replace container {idContainer}'s draft with {exportedContainerVersion}, saving a backup as {backupName}.
Documentation
📖
Documentation
https://developer.matomo.org/api-reference/reporting-api
📖
Documentation
https://developer.matomo.org/api-reference/reporting-api#Live
📖
Documentation
https://developer.matomo.org/api-reference/reporting-api#Goals
📖
Documentation
https://developer.matomo.org/api-reference/reporting-api-segmentation