Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

sfp_webanalytics: Add match for Google Tag Manager (#1816)

bcoles0373676c3952
diff --git a/modules/sfp_webanalytics.py b/modules/sfp_webanalytics.py
index 46b24d59..a8c55fac 100644
--- a/modules/sfp_webanalytics.py
+++ b/modules/sfp_webanalytics.py
@@ -97,6 +97,22 @@ class sfp_webanalytics(SpiderFootPlugin):
evt.moduleDataSource = datasource
self.notifyListeners(evt)
+ # Google Tag Manager
+ matches = re.findall(r"\b(GTM-[0-9a-zA-Z]{6,10})\b", eventData)
+ for m in set(matches):
+ if m.lower().startswith('GTM-XXXXXX'):
+ continue
+
+ self.debug(f"Google Tag Manager match: {m}")
+ evt = SpiderFootEvent(
+ "WEB_ANALYTICS_ID",
+ f"Google Tag Manager: {m}",
+ self.__name__,
+ event
+ )
+ evt.moduleDataSource = datasource
+ self.notifyListeners(evt)
+
# Google Website Verification
# https://developers.google.com/site-verification/v1/getting_started
matches = re.findall(r'<meta name="google-site-verification" content="([a-z0-9\-\+_=]{43,44})"', eventData, re.IGNORECASE)