ワンクリックで
tag-manager
Manage Matomo Tag Manager triggers, tags, and deployments with POST operations and validation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Manage Matomo Tag Manager triggers, tags, and deployments with POST operations and validation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Query Zendesk support tickets and comments for Emplois de l'Inclusion (read-only). (project)
Indicateurs du Réseau pour l'emploi (France Travail) — accès/présence en emploi, formation, recrutement, RSA, par territoire et par mois. Données agrégées, nationales, couvrant tout le réseau (pas seulement nos services). À distinguer d'autometa_tables_db.
Lire et écrire dans Notion — interroger une base de données ou une page, et publier des rapports. À utiliser dès qu'une demande référence une page/base Notion (URL app.notion.com, ou ancien notion.so).
Create a new dashboard (TDB) — scaffolds files and inserts a row in the dashboards table. Use this skill instead of writing files directly.
Update a dashboard's metadata (title, description, tags, flags, archive). MUST be invoked whenever the user wants to modify an existing dashboard — guarantees the right slug is targeted and reloads coding conventions.
Composer un system prompt riche en contexte métier et lancer un run autometa-jobs à partir de l'intention de l'utilisateur. À utiliser quand l'utilisateur veut une analyse autonome et longue (minutes à heures), trop lourde ou trop lente pour le chat interactif — par ex. « lance un job qui analyse tous les services Dora ».
| name | tag_manager |
| description | Manage Matomo Tag Manager triggers, tags, and deployments with POST operations and validation |
Use this skill when you need to:
Before using Tag Manager operations:
knowledge/sites/ for site detailsknowledge/matomo/tag-manager.md for conceptsAll Tag Manager operations use lib.query:
from lib.query import get_matomo
api = get_matomo("inclusion")
from lib.query import get_matomo
api = get_matomo("inclusion")
# 1. Get draft version
draft_id = api.get_draft_version(site_id=210, container_id="xg8aydM9")
# 2. Create trigger
trigger_id = api.add_trigger(
site_id=210,
container_id="xg8aydM9",
version_id=draft_id,
trigger_type="AllElementsClick",
name="Button clicks",
conditions=[
{"comparison": "contains", "actual": "ClickClasses", "expected": "btn-primary"}
]
)
# 3. Create tag
tag_id = api.add_tag(
site_id=210,
container_id="xg8aydM9",
version_id=draft_id,
tag_type="CustomHtml",
name="Log clicks",
parameters={
"customHtml": "<script>console.log('clicked!');</script>",
"htmlPosition": "bodyEnd"
},
fire_trigger_ids=[trigger_id],
fire_limit="once_page"
)
# 4. Test with preview
api.enable_preview(site_id=210, container_id="xg8aydM9")
# → Visit site in browser, verify behavior
# 5. Publish
api.publish_version(
site_id=210,
container_id="xg8aydM9",
version_id=draft_id,
environment="live"
)
# 6. Cleanup (optional - delete from BOTH draft and live)
api.disable_preview(site_id=210, container_id="xg8aydM9")
Trigger a Tally feedback form when users view a specific page (bottom-right popup).
from lib.query import get_matomo
api = get_matomo("inclusion")
draft_id = api.get_draft_version(site_id=210, container_id="xg8aydM9") # Dora staging
# 1. Trigger: PageView on service detail pages
trigger_id = api.add_trigger(
site_id=210,
container_id="xg8aydM9",
version_id=draft_id,
trigger_type="PageView",
name="XP BENEF - Vue d'une page Service",
conditions=[
{"comparison": "starts_with", "actual": "PageUrl",
"expected": "https://dora-staging.inclusion.beta.gouv.fr/services/"}
]
)
# 2. Tag: Tally embed code (bottom-right popup)
tag_id = api.add_tag(
site_id=210,
container_id="xg8aydM9",
version_id=draft_id,
tag_type="CustomHtml",
name="XP - appel tag Tally",
parameters={
"customHtml": """<script>
(function(d,t) {
var s=d.createElement(t),options={'formId':'YOUR_FORM_ID','popup':{'open':{'trigger':'time','ms':2000},'layout':'default','autoClose':30000}};
s.src='https://tally.so/widgets/embed.js';
s.onload=function(){Tally.loadEmbeds(options);};
d.head.appendChild(s);
})(document,'script');
</script>""",
"htmlPosition": "bodyEnd"
},
fire_trigger_ids=[trigger_id],
fire_limit="once_24hours", # Don't annoy users every page
status="active"
)
# 3. Test with preview before publishing
api.enable_preview(site_id=210, container_id="xg8aydM9")
# Visit the service page in your browser to test
# 4. Publish when ready
api.publish_version(
site_id=210,
container_id="xg8aydM9",
version_id=draft_id,
environment="live"
)
Key parameters explained:
trigger_type="PageView" — fires when page loadsconditions with starts_with — matches all service detail pagesfire_limit="once_24hours" — prevents popup spampopup config controls timing and positionWhen you publish, Matomo creates a new version and assigns new IDs to all objects:
draft (v420) publication v972 (live)
trigger 13994 ──────────────────────────→ trigger 14030
tag 11149 ──────────────────────────→ tag 11170
Keep draft IDs if you need to update/delete later in the draft.
Deleting from draft doesn't remove from published versions. To fully remove:
# Delete from draft
api.delete_trigger(site_id=210, container_id="xg8aydM9", version_id=DRAFT_ID, trigger_id=DRAFT_TRIGGER_ID)
# Also delete from live version
api.delete_trigger(site_id=210, container_id="xg8aydM9", version_id=LIVE_VERSION, trigger_id=LIVE_TRIGGER_ID)
# Then re-publish
api.publish_version(site_id=210, container_id="xg8aydM9", version_id=DRAFT_ID, environment="live")
enable_preview() sets a cookie in your browser. The site loads the draft version when the cookie is present. Clear cookies or use disable_preview() to return to live.
# Get container info (includes draft and releases)
container = api.get_container(site_id=210, container_id="xg8aydM9")
# Quick access to draft version ID
draft_id = api.get_draft_version(site_id=210, container_id="xg8aydM9")
# Add trigger (validates trigger_type)
trigger_id = api.add_trigger(
site_id, container_id, version_id,
trigger_type="PageView", # AllElementsClick, FormSubmit, etc.
name="My Trigger",
conditions=[{"comparison": "equals", "actual": "PageUrl", "expected": "/test"}]
)
# Update trigger
api.update_trigger(site_id, container_id, version_id, trigger_id, name="New Name")
# Delete trigger
api.delete_trigger(site_id, container_id, version_id, trigger_id)
Valid trigger types: AllElementsClick, AllLinksClick, PageView, FormSubmit, HistoryChange, WindowLoaded, ElementVisibility, CustomEvent
Condition operators: equals, contains, starts_with, ends_with, matches_regex, etc.
# Add tag (validates tag_type and fire_limit)
tag_id = api.add_tag(
site_id, container_id, version_id,
tag_type="CustomHtml",
name="My Tag",
parameters={"customHtml": "<script>...</script>", "htmlPosition": "bodyEnd"},
fire_trigger_ids=[trigger_id],
fire_limit="unlimited", # or once_page, once_24hours, once_lifetime
status="active",
priority=999
)
# Update tag
api.update_tag(site_id, container_id, version_id, tag_id, name="New Name")
# Delete tag
api.delete_tag(site_id, container_id, version_id, tag_id)
# Pause tag (temporarily disable)
api.pause_tag(site_id, container_id, version_id, tag_id)
# Resume tag (re-enable)
api.resume_tag(site_id, container_id, version_id, tag_id)
Valid tag types: CustomHtml, Matomo, LinkedinInsight
Valid fire limits: unlimited, once_page, once_24hours, once_lifetime
Valid HTML positions: headStart, headEnd, bodyStart, bodyEnd
# Publish draft to environment (validates environment)
api.publish_version(
site_id, container_id, version_id,
environment="live" # or staging, dev, production, pentest, preview
)
# Enable preview mode (test draft without publishing)
api.enable_preview(site_id, container_id)
# Disable preview mode
api.disable_preview(site_id, container_id)
# Export version for debugging
data = api.export_version(site_id, container_id, version_id)
print(f"Triggers: {len(data['triggers'])}, Tags: {len(data['tags'])}")
Valid environments: live, staging, dev, production, pentest, preview
All helper methods validate parameters before making API calls:
VALID_TRIGGER_TYPESVALID_TAG_TYPESVALID_FIRE_LIMITSVALID_ENVIRONMENTSInvalid values raise ValueError with clear error messages listing valid options.
For Tag Manager operations not covered by helpers, use the generic post() method:
# Generic POST with automatic parameter flattening
result = api.post(
"TagManager.addContainerVariable",
idSite=210,
idContainer="xg8aydM9",
idContainerVersion=420,
type="DataLayer",
name="myVariable",
parameters={"dataLayerName": "customData"}
)
Python dicts/lists are automatically flattened to PHP array notation.
knowledge/matomo/tag-manager.mdknowledge/sites/<site-name>.md