MetricsTriggered
Fires when new metric data is recorded from sale, visit, or other trigger strategies.
Last updated: April 8, 2026
MetricsTriggered
MetricsTriggered fires when new metric data is recorded from a sale, a visit, or another trigger strategy. Metrics are the raw performance numbers that distributions use to calculate each collaborator’s share of a reward pool. Every time a tracked interaction produces measurable data, this event captures it.
The event ID is metrics_triggered, and its fully qualified class is Siren\Metrics\Core\Events\MetricsTriggered.
What does this event carry?
The event carries two things: a metrics array containing the recorded data points, and a strategyId string that identifies which trigger strategy produced the data. The strategy ID allows downstream listeners to filter for specific metric types when building distribution calculations.
use Siren\Metrics\Core\Events\MetricsTriggered;
public function handle(Event $event): void
{
$metrics = $event->getMetrics();
$strategyId = $event->getStrategyId();
// Each metric entry in the array contains the measured values
// that will be accumulated until the next distribution period
}
How do metrics feed into distributions?
Metrics accumulate continuously between distribution periods. When a DistributionCompleted event fires, the distribution system reads the accumulated metrics for each collaborator enrolled in the relevant programs and uses them to calculate proportional shares of the reward pool. After the distribution is processed, metrics are reset for the next period.
What about manual metrics?
Sometimes metric data needs to be recorded outside of an automated trigger. The ManualMetricRequested event (event ID: manual_metric_requested) handles this case. It fires when an administrator or an API call explicitly attributes metric data to a collaborator. The downstream effect is the same: the metric values accumulate and contribute to the next distribution calculation. The distinction exists so that listeners can differentiate between automatically tracked and manually attributed metrics when needed.
For the full lifecycle of distribution events and how they connect to the fulfillment pipeline, see the Distribution Events overview.