Skip to content

Conversation

@apata
Copy link
Contributor

@apata apata commented Sep 1, 2025

Changes

There's a problem tracking tagged a elements if they're within svg tags. url property isn't added automatically. It's hard to fix using ES5-only logic without increasing script size or script complexity (if polyfilling only for .compat variants)

Including the URL automatically with tagged links is convenience functionality that I propose we document with this edge case like this: plausible/docs#635.

This PR

  1. updates the test case about this
  2. adds tests for transformRequest examples from docs

Tests

  • Automated tests have been added

Changelog

  • This PR does not make a user-facing change

Documentation

Dark mode

  • This PR does not change the UI

@apata apata force-pushed the script-v2/track-custom-event-svg branch from f93ade6 to 27fe3ae Compare September 1, 2025 09:37
@apata apata requested a review from macobo September 1, 2025 09:43
@apata apata unassigned macobo Sep 1, 2025
Copy link
Contributor

@macobo macobo left a comment

Choose a reason for hiding this comment

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

The syntax is kind of hacky but works. Thanks!

@apata apata changed the title Update test about tagged a elements within svg tags Script v2: Update tests relating to tagged a elements as well as examples from docs Sep 1, 2025
@apata apata requested a review from macobo September 2, 2025 05:48
})
}

test.describe(`transformRequest examples from /docs work`, () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These should help verify that what we recommend to users actually works as intended

@apata apata force-pushed the script-v2/track-custom-event-svg branch from 4c8448c to 6874605 Compare September 15, 2025 15:37
@apata apata added this pull request to the merge queue Sep 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 16, 2025
@apata apata added this pull request to the merge queue Sep 16, 2025
Merged via the queue into master with commit b03569d Sep 16, 2025
21 checks passed
@RobertJoonas RobertJoonas deleted the script-v2/track-custom-event-svg branch September 16, 2025 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants