Commit c9b017c3 authored by Marco Aresu's avatar Marco Aresu Committed by Florent Torregrosa
Browse files

Issue #3280840 by marco.aresu, Grimreaper: Track all account IDs

parent 5219bde0
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -49,6 +49,11 @@ function matomo_page_attachments(array &$page) {
  $id = $config->get('site_id') ?? '';
  $request = \Drupal::request();

  if (empty($id)) {
    // Tracking is disabled if no site ID had been configured yet.
    return;
  }

  // Add module cache tags.
  $page['#cache']['tags'] = Cache::mergeTags($page['#cache']['tags'] ?? [], $config->getCacheTags());

@@ -77,10 +82,9 @@ function matomo_page_attachments(array &$page) {
    '404',
  ];

  // 1. Check if the matomo account number has a valid value.
  // 2. Track page views based on visibility value.
  // 3. Check if we should track the currently active user's role.
  if (preg_match('/^\d{1,}$/', $id) && (_matomo_visibility_pages() || in_array($status, $trackable_status_codes)) && _matomo_visibility_user($account)) {
  // 1. Track page views based on visibility value.
  // 2. Check if we should track the currently active user's role.
  if ((_matomo_visibility_pages() || in_array($status, $trackable_status_codes)) && _matomo_visibility_user($account)) {

    $url_http = $config->get('url_http');
    $url_https = $config->get('url_https');