Skip to content

Quick Start

This content is for v0.2.1. Switch to the latest version for up-to-date documentation.

Set Matomo runtime configuration, then copy the example from a v0.2.1 checkout or release archive:

Terminal window
export MATOMO_URL=https://matomo.example.com
export MATOMO_TOKEN_AUTH=replace-with-your-api-token
export MATOMO_SITE_ID=1
export MATOMO_CONTAINER_ID=replace-with-your-container-id
cp examples/matomo-conversion/agoraform.yaml agoraform.yaml

The target container must already contain a Matomo Configuration variable. v0.2 does not manage MatomoConfiguration variables declaratively.

apiVersion: agoraform.io/v1alpha1
providers:
matomo:
publish: true
environment: live
resources:
- address: matomo.variable.user_id
attributes:
type: dataLayer
key: userId
name: Trial user ID
- address: matomo.trigger.trial_started
attributes:
type: customEvent
event: trialStarted
name: Trial started
- address: matomo.tag.trial_started
attributes:
type: matomoAnalytics
name: Track trial started
trigger:
$ref: matomo.trigger.trial_started
eventCategory: trial
eventAction: started
eventName:
$ref: matomo.variable.user_id
Terminal window
agoraform validate
agoraform plan
agoraform apply
agoraform plan

With publication enabled, the plan makes potential container publication visible before mutation. apply performs draft resource changes in dependency order and only then creates and publishes a container version when the converged draft still differs from the published environment. Repeated unchanged apply must not create duplicate container versions.

Application event after window._mtm is initialized:

window._mtm.push({
event: "trialStarted",
userId: "..."
});

See the tagged conversion example.