@99devco/analytics - v4.0.0
    Preparing search index...

    Function getUtmParams

    • Reads UTM parameters from the current URL, preferring query-string values on window.location.search over values found in hash-fragment query strings, and caches fresh values in sessionStorage for the rest of the tab session.

      If no UTM values are present in the current URL, previously cached values are returned (if available).

      Returns UtmParams

      UTM parameters from the current URL when present, otherwise cached values.

      const utm = getUtmParams();
      // { utm_source: "google", utm_campaign: "spring-sale" }