-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
EnhancementFor new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone
Description
In some other plugin we're detecting GA based on these rules:
//only one of these has to match to detect ga3, ga4 or gtm
$this->tests['GA3'][] = "/UA-\d{5,}-\d{1,}/";
$this->tests['GA3'][] = "/google\-analytics\.com\/analytics\.js/";
$this->tests['GA3'][] = "/window\.ga\s?=\s?window\.ga/";
$this->tests['GA3'][] = "/google[ _\-]{0,1}analytics/i";
// GA4 Measurement ID
$this->tests['GA4'][] = "/properties\/[^\/]/";
$this->tests['GA4'][] = "/G-[A-Z0-9]{7,10}/";
$this->tests['GA4'][] = "/gtag\/js\?id=G-/";
and also additionally for GTM we can look for this
$this->tests['GTM'][] = "/googletagmanager/i";
$this->tests['GTM'][] = "/gtm\.start/i";
Noticed we have two different detections for this in core in SiteContentDetector
and GtmSiteTypeGuesser
. And we currently might not detect as many GA installs as we could
Metadata
Metadata
Assignees
Labels
EnhancementFor new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.