Matomo Heartbeat [new] 〈FHD〉
<?php // matomo-heartbeat-handler.php class MatomoHeartbeatHandler private $matomoUrl; private $siteId; private $tokenAuth; public function __construct($matomoUrl, $siteId, $tokenAuth = null) $this->matomoUrl = rtrim($matomoUrl, '/'); $this->siteId = $siteId; $this->tokenAuth = $tokenAuth;
To enable the heartbeat, you must add a specific line to your existing Matomo JavaScript tracking code . javascript _paq.push(['enableHeartBeatTimer', 15]); Use code with caution. Copied to clipboard matomo heartbeat
// Calculate engaged time for this session if (this.lastHeartbeatTime) const engagedTime = Math.floor((Date.now() - this.lastHeartbeatTime) / 1000); if (engagedTime >= this.options.minVisitLength) this.totalEngagedTime += engagedTime; public function __construct($matomoUrl



Publicera kommentar