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

[WNMGDS-2725] Add optional analytics tracking to ThirdPartyExternalLink #3059

Merged
merged 8 commits into from
Apr 29, 2024

Conversation

pwolfert
Copy link
Contributor

@pwolfert pwolfert commented Apr 25, 2024

Summary

  • Adds a new thirdPartyExternalLinkSendsAnalytics config property that controls whether the ThirdPartyExternalLink sends analytics events by default
  • Adds full analytics tracking capabilities to ThirdPartyExternalLink

How to test

  1. Check out FOR TESTING IN STORYBOOK (adb711)
  2. Turn on analytics in Storybook and try it out
  3. Take a look at the new unit tests

Checklist

  • Prefixed the PR title with the Jira ticket number as [WNMGDS-####] Title or [NO-TICKET] if this is unticketed work.
  • Selected appropriate Type (only one) label for this PR, if it is a breaking change, label should only be Type: Breaking
  • Selected appropriate Impacts, multiple can be selected.
  • Selected appropriate release milestone

@pwolfert pwolfert added Impacts: Core Impacts the core DS primarily, changes may occur in other themes as well. Type: Added Indicates a new feature. labels Apr 25, 2024
@pwolfert pwolfert added this to the 11.0.0-beta.1 milestone Apr 25, 2024
@pwolfert pwolfert requested a review from zarahzachz April 25, 2024 22:51
"link_url": "foo",
"parent_component_heading": " ",
"parent_component_type": " ",
"text": "External site linkThis link goes to an external site",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed the text gets smooshed together here. Is there a chance this data would have an issue?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, so it's reading the SVG title + whatever the link label is. Instead of textContent, would innerText be a better option? It excludes the info from the SVG, but maybe that's OK?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I'll play around with some of those values

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I forgot that this is part of the getAnalyticsContentFromRefs function, which is used in a lot of other places. innerText appears to be undefined in a lot of these unit tests too. I think it's actually fine to just leave it.

@pwolfert pwolfert merged commit abaa803 into main Apr 29, 2024
1 check passed
@pwolfert pwolfert deleted the pwolfert/external-link-analytics branch April 29, 2024 21:05
@pwolfert pwolfert modified the milestones: 11.0.0-beta.1, 10.1.0 May 3, 2024
pwolfert added a commit that referenced this pull request May 10, 2024
…ink` (#3059)

* Implement analytics for third party external links

(as far as I understand the spec)

* Add remaining event properties

* Add this analytics config to storybook and prevent extra button engagement event

* FOR TESTING IN STORYBOOK

* Revert "FOR TESTING IN STORYBOOK"

This reverts commit adb7113.

* Update doc snapshots

* Don't start out with a deprecated prop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impacts: Core Impacts the core DS primarily, changes may occur in other themes as well. Type: Added Indicates a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants