Skip to content

Fill empty targetUrl for link clicks with "about:invalid" to avoid failed events and output a warning - #1360

Merged
Matus Tomlein (matus-tomlein) merged 2 commits into
release/4.0.0from
issue/link_click_tracking_empty_href
Oct 25, 2024
Merged

Fill empty targetUrl for link clicks with "about:invalid" to avoid failed events and output a warning#1360
Matus Tomlein (matus-tomlein) merged 2 commits into
release/4.0.0from
issue/link_click_tracking_empty_href

Conversation

@matus-tomlein

Copy link
Copy Markdown
Contributor

In case a click on a link with empty href is tracked, set about:nothing as the targetUrl in the event to avoid the event failing validation.

Also logs a console.warn to help users identify and fix these issues.

@bundlemon

bundlemon Bot commented Oct 24, 2024

Copy link
Copy Markdown

BundleMon

Files added (6)
Status Path Size Limits
trackers/javascript-tracker/dist/sp.js
+24.33KB 30KB / +10%
libraries/browser-tracker-core/dist/index.mod
ule.js
+23.45KB 25KB / +10%
libraries/tracker-core/dist/index.module.js
+19.21KB 20KB / +10%
trackers/browser-tracker/dist/index.umd.min.j
s
+17.22KB 20KB / +10%
trackers/javascript-tracker/dist/sp.lite.js
+17.15KB 20KB / +10%
trackers/browser-tracker/dist/index.module.js
+3.49KB 5KB / +10%

Total files change +104.84KB 0%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

@jethron Jethro Nederhof (jethron) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM!

Comment thread plugins/browser-plugin-link-click-tracking/src/index.ts Outdated
@jethron

Copy link
Copy Markdown
Contributor

Maybe also retitle the PR to about:invalid rather than about:nothing so it shows up in search results properly.

@matus-tomlein
Matus Tomlein (matus-tomlein) merged commit 795d8e6 into release/4.0.0 Oct 25, 2024
@matus-tomlein Matus Tomlein (matus-tomlein) changed the title Fill empty targetUrl for link clicks with "about:nothing" to avoid failed events and output a warning Fill empty targetUrl for link clicks with "about: invalid" to avoid failed events and output a warning Oct 25, 2024
@matus-tomlein Matus Tomlein (matus-tomlein) changed the title Fill empty targetUrl for link clicks with "about: invalid" to avoid failed events and output a warning Fill empty targetUrl for link clicks with "about:invalid" to avoid failed events and output a warning Oct 25, 2024
@matus-tomlein
Matus Tomlein (matus-tomlein) deleted the issue/link_click_tracking_empty_href branch October 25, 2024 11:41
Matus Tomlein (matus-tomlein) added a commit that referenced this pull request Oct 25, 2024
Matus Tomlein (matus-tomlein) added a commit that referenced this pull request Oct 28, 2024
Matus Tomlein (matus-tomlein) added a commit that referenced this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants