一键导入
sync-events
Synchronize Matomo event documentation with codebase tracking. Methodology guide, script planned. (project)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Synchronize Matomo event documentation with codebase tracking. Methodology guide, script planned. (project)
用 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 | sync_events |
| description | Synchronize Matomo event documentation with codebase tracking. Methodology guide, script planned. (project) |
Methodology for synchronizing Matomo event documentation with actual codebase tracking.
from scripts.matomo import MatomoAPI
api = MatomoAPI()
# Get event categories with counts
cats = api.get_event_categories(site_id=SITE_ID, period='month', date='last3')
# Get event actions
actions = api.get_event_actions(site_id=SITE_ID, period='month', date='last3')
# Get event names
names = api.get_event_names(site_id=SITE_ID, period='month', date='last3')
This shows what's actually being tracked in production.
Use a subagent to explore the repository:
Search for:
- `_paq.push` - direct Matomo calls
- `trackEvent` - tracking function calls
- `matomo_event` - Django template tags
- `data-matomo-` - HTML data attributes
- Analytics/tracking modules
Django (les-emplois):
{% matomo_event "category" "action" "name" %}data-matomo-* attributesReact/Vue:
Matomo often shows categories/names that don't appear as literals in the code.
Look for string concatenation in templates:
{% matomo_event "connexion "|add:matomo_account_type "clic" "..." %}
Trace the variable to its source (often an enum):
# itou/users/enums.py
MATOMO_ACCOUNT_TYPE = {
UserKind.PRESCRIBER: "prescripteur",
UserKind.EMPLOYER: "employeur inclusif",
}
Look for patterns like:
{% matomo_event "category" "clic" "prefix-"|add:variable %}
Examples found in les-emplois:
"voir-liste-candidatures-"|add:category.name → appends status (À traiter, En attente)"candidature_"|add:request.user.get_kind_display → appends user typeMulti-step wizards often build names dynamically:
matomo_event_name = f"batch-refuse-application-{self.step}-submit"
|add: in templates (Django concatenation)f"...{ in Python (f-strings)+ near matomo/tracking keywordsUserKind, MATOMO_ACCOUNT_TYPE)Compare the two sources:
| Status | Meaning |
|---|---|
| ✓ In code + In Matomo | Working, documented |
| ⚠ In code, not in Matomo | Dead code or new/rare event |
| ⚠ In Matomo, not in code | Legacy or external source |
Update the site's knowledge file with:
## Matomo Events
Scraped from codebase YYYY-MM-DD. ~N events tracked.
### Implementation
[How events are tracked in this codebase]
### Event Categories
#### category_name (N events)
[Business context for this category]
| Action | Name | Description |
|--------|------|-------------|
| action | name | What triggers this |
Matomo segments like pageUrl=@/gps/ filter VISITS, not EVENTS.
When you query events with a segment, you get all events triggered during visits that included at least one matching page — NOT events triggered ON those pages.
Example: A user visits /dashboard/, clicks "Statistiques" (fires statistiques
event), then navigates to /gps/groups/list. The segment pageUrl=@/gps/ will
include the statistiques event because it happened during a visit that included
a GPS page, even though it was triggered on the dashboard.
The only reliable method is to search the codebase.
git clone --depth 1 https://github.com/gip-inclusion/les-emplois.git /tmp/les-emplois
For Django apps using matomo_event template tags:
# Find all matomo events in templates
grep -r "matomo_event" /tmp/les-emplois/itou/templates/ --include="*.html"
# Search for a specific event name
grep -r "consulter_fiche_candidat" /tmp/les-emplois/
# Find data-matomo attributes (JS-triggered events)
grep -r "data-matomo-" /tmp/les-emplois/itou/templates/
Django templates are organized by app/feature:
templates/gps/ → /gps/* pagestemplates/dashboard/ → /dashboard/* pagestemplates/apply/ → /apply/* pagestemplates/companies/ → company cards and search resultsCheck urls.py files to confirm URL→template mappings.
Events in navigation components fire BEFORE the user lands on the target page:
<!-- This fires when CLICKING the link, not when ON the GPS page -->
<a href="/gps/groups/list" data-matomo-option="tdb_liste_beneficiaires">
Look for the template location:
includes/nav.html, layout.html → Navigation events (fire before page load)gps/memberships.html → Actual GPS page events{% matomo_event "category" "action" "name" %}
This generates data-matomo-* attributes. The template file location tells you
which page triggers the event.
nav.py or similar)# itou/utils/templatetags/nav.py
NavItem(
url="/gps/groups/list",
matomo_event_option="tdb_liste_beneficiaires", # Fires on CLICK, not on page
)
| Check | Meaning |
|---|---|
Event in templates/{feature}/ | Fires ON feature pages |
Event in templates/includes/ | May fire anywhere (shared component) |
| Event in nav.py/layout.html | Navigation click, fires BEFORE target page |
| Event in JS file | Check which pages include that JS |