Aller au contenu principal

Matomo Heartbeat !!top!!

sendHeartbeat(type) const now = Date.now(); const timeSinceLastHeartbeat = (now - this.lastHeartbeatTime) / 1000;

$response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); matomo heartbeat

// Standard tracking code follows...

Look for the option in the configuration settings. sendHeartbeat(type) const now = Date

// Example usage in your tracking endpoint if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_GET['action']) && $_GET['action'] === 'heartbeat') $handler = new MatomoHeartbeatHandler( 'https://your-matomo-domain.com', 1, // Your site ID 'your-token-auth' // Optional for API access ); sendHeartbeat(type) const now = Date.now()

startHeartbeat() if (this.intervalId