patternfly-elements icon indicating copy to clipboard operation
patternfly-elements copied to clipboard

Bug: PFE-Navigation (the newer version) is missing analytics functionality

Open wesruv opened this issue 4 years ago • 0 comments

The new nav is sending an event for Adobe Analytics to pick up when a top level item that's an <a> tag has been clicked.

This is an issue on developers.redhat.com which I think is the first site with analytics and links on the top level.

I gave this temporary workaround to the analytics team, which should be removed when we add a fix in this component: https://gist.github.com/wesruv/ccaf91e1157f2a9e400ffa9d7069c2bb

The current pfe-shadow-dom-event listener only covers things in a dropdown, it could be added to a.pfe-navigation__menu-link on click as well, and I think that would fix the issue. See: https://github.com/patternfly/patternfly-elements/blob/CPFED-3689-new-navigation-epic/elements/pfe-navigation/src/pfe-navigation.js#L1356

Impacted component(s)

  • pfe-navigation from https://github.com/patternfly/patternfly-elements/tree/CPFED-3689-new-navigation-epic

Steps to reproduce

  1. Go to developers.redhat.com
  2. Open dev tools and in Console, check "preserve log"
  3. Add the following code via console:
document.addEventListener('pfe-shadow-dom-event', function(event) {
console.log(event);
debugger;
});
  1. Click on a top level link, not dropdown, e.g. "Build"
  2. Add the code from my gist, try the same thing, and see the result

Related issues

wesruv avatar Dec 07 '21 20:12 wesruv