• Extracts UTM (Urchin Tracking Module) parameters from the current page URL and stores them in sessionStorage for later use.

    This function parses the URL query parameters and collects standard UTM fields: utm_source, utm_medium, utm_campaign, utm_term, utm_content, and utm_ma.

    If at least one UTM parameter exists, it constructs a UTM object that includes:

    • The extracted UTM parameters.
    • The current page’s pathname (landingPage).
    • The device type (from getDeviceType).
    • An expiration timestamp based on UTM_EXPIRY_HOURS.

    The resulting object is serialized and saved in sessionStorage under the key defined by UTM_STORAGE_KEY. This allows subsequent calls (e.g. via getUTMParams) to retrieve and validate UTM data associated with the user’s session.

    Returns void

    Nothing is returned; the function has a side effect of writing to sessionStorage.

    This function performs no action if no UTM parameters are present in the current URL.

    import storeUTMParams from '@/utils/storeUTMParams';

    // Example: URL = https://example.com/?utm_source=google&utm_campaign=winter_sale
    storeUTMParams();
    // Stores something like:
    // {
    // utm_source: 'google',
    // utm_campaign: 'winter_sale',
    // landingPage: '/home',
    // deviceType: 'desktop',
    // expiry: 1730564030000
    // }