Skip to content

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

@wesruv

Description

@wesruv

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)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions