Skip to content

Commit

Permalink
sfp_webanalytics: Add match for Google Tag Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoles committed Oct 29, 2023
1 parent f37b98e commit c782013
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions modules/sfp_webanalytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,22 @@ def handleEvent(self, event):
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)
Expand Down

0 comments on commit c782013

Please sign in to comment.