Skip to content

feat(rum-core): enhance user transaction name obtaining#1390

Merged
devcorpio merged 7 commits intomainfrom
user-interaction-improvement
Jul 12, 2023
Merged

feat(rum-core): enhance user transaction name obtaining#1390
devcorpio merged 7 commits intomainfrom
user-interaction-improvement

Conversation

@devcorpio
Copy link
Copy Markdown
Contributor

@devcorpio devcorpio commented Jul 10, 2023

Related to #1286

Summary

We have improved the user-interaction transaction name obtaining. From now on, if a user performs click on an element from a nested HTML structure like this:

<button data-transaction-name="my transaction name">
  <span>Some text</span>
  <svg>button icon...</svg>
</button>

The users will always get Click - my transaction name rather than Click - span or Click - svg

For more details see the issue

Important:

The agent will keep applying the older "algorithm" in browsers not supporting the closest method. E.g. IE11

In addition, this will work if the target is inside a button or link - the ones we define as interactive selectors. See the associated tests in case you need more context

@devcorpio devcorpio linked an issue Jul 10, 2023 that may be closed by this pull request
Comment thread .github/workflows/ci-saucelabs.yml
Comment thread packages/rum/src/index.d.ts
@devcorpio devcorpio marked this pull request as ready for review July 10, 2023 16:18
Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>
Comment thread .github/workflows/ci-saucelabs.yml
Comment thread packages/rum-core/src/common/observers/page-clicks.js Outdated
Comment thread packages/rum-core/src/common/observers/page-clicks.js Outdated
@devcorpio devcorpio force-pushed the user-interaction-improvement branch from 933ffa6 to 6fc8f0c Compare July 11, 2023 11:00
Comment thread dev-utils/test-config.js Outdated
@devcorpio devcorpio force-pushed the user-interaction-improvement branch from d45cd7b to 20127f2 Compare July 11, 2023 16:53
Copy link
Copy Markdown
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

Comment thread packages/rum-core/test/common/observers/page-clicks.spec.js
@devcorpio devcorpio force-pushed the user-interaction-improvement branch from 42c4c63 to 3b0dc7b Compare July 11, 2023 17:38
@devcorpio devcorpio merged commit 1144b9f into main Jul 12, 2023
@devcorpio devcorpio deleted the user-interaction-improvement branch July 12, 2023 14:51
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.

improve naming strategy for user-interaction transactions

3 participants