Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfp_webanalytics: Add match for Google Tag Manager #1816

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading