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

Product Analytics: Add marketing campaign tracking info to Segment Pageviews

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Critical Critical
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Unset
    • No
    • Plat-Ex Sprint 59, Plat-Ex Sprint 60

      We want to add marketing campaign tracking info to Segment pageview tracking. That basically just means: Add 3 new pieces of metadata to the pageview events. Each piece of marketing campaign info will exist either in the URL query string or in a cookie.

      For getPageEventOptions we'd want something like:

      const getPageEventOptions = () => {
        const path = window.location.pathname.replace(/^\/beta\//, '/');
        const search = new URLSearchParams(window.location.search); // new
        return [
          {
            path,
            url: `${window.location.origin}${path}${window.location.search}`,
            isBeta: isBeta(),
            module: window._segment?.activeModule,
            tactic_id_external: search.get('sc_cid') || Cookies.get('rh_omni_tc'), // new
            tactic_id_internal: search.get('intcmp') || Cookies.get('rh_omni_itc'), // new
            tactic_id_personalization: search.get('percmp') || Cookies.get('rh_omni_pc'), // new
            ...window?._segment?.pageOptions,
          },
          {
            context: {
              groupId: window._segment?.groupId,
            },
          },
        ];
      };
      

              mmarosi123 Martin Marosi
              jlucky@redhat.com Jacob Lucky
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: