Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-23397

Ability to customize Segment analytics with async data from backend

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Unset
    • No

      In OCM, we're annotating analytics with a ocm_resource_type field, depending on page and in some cases — when viewing details of specific cluster — on the cluster type.
      The technical problem we hit in HAC-2424 is cluster type is fetched asynchronously from backend. AFAICT, the analytics gets sent right after URL change:
      https://github.com/RedHatInsights/insights-chrome/blob/b067cb24f8702092dc2cd8cc14ca2df65faa5f65/src/analytics/SegmentProvider.tsx#L72-L77
      The setTimeout() gives our app a chance to setPageMetadata() on first render but no chance to customize it when backend data arrives later.
      We do call setPageMetadata() again but it merely sets window._segment for future use, does not trigger re-sending the analytics.

      1. nice-to-have: Could we skip the initial analytics when we need more data? To not pollute it with 'unknown' values?
      2. important: Can we explicitly cause segment.page() to happen again once we get the data?

              Unassigned Unassigned
              bpaskinc@redhat.com Beni Paskin-Cherniavsky (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: