Skip to content

Commit

Permalink
Track mailto links in link click tracking (close #1270)
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein authored and greg-el committed Dec 4, 2023
1 parent c9e7f24 commit abb8554
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@snowplow/browser-plugin-link-click-tracking",
"comment": "Track mailto links in link click tracking (#1270)",
"type": "none"
}
],
"packageName": "@snowplow/browser-plugin-link-click-tracking"
}
2 changes: 1 addition & 1 deletion plugins/browser-plugin-link-click-tracking/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function processClick(tracker: BrowserTracker, sourceElement: Element, context?:
var originalSourceHostName = anchorElement.hostname || getHostName(anchorElement.href),
sourceHostName = originalSourceHostName.toLowerCase(),
sourceHref = anchorElement.href.replace(originalSourceHostName, sourceHostName),
scriptProtocol = new RegExp('^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):', 'i');
scriptProtocol = new RegExp('^(javascript|vbscript|jscript|mocha|livescript|ecmascript):', 'i');

// Ignore script pseudo-protocol links
if (!scriptProtocol.test(sourceHref)) {
Expand Down

0 comments on commit abb8554

Please sign in to comment.