function parsePortalHash(url) {
    const hashUrl = new URL(url.href.replace('/#/portal', ''));
    const refParam = hashUrl.searchParams.get('ref');
    const sourceParam = hashUrl.searchParams.get('source');
    const utmSourceParam = hashUrl.searchParams.get('utm_source');
    const utmMediumParam = hashUrl.searchParams.get('utm_medium');
    
    return {
        source: refParam || sourceParam || utmSourceParam || null,
        medium: utmMediumParam || null,
        url: window.document.referrer || null
    };
}
Parses attribution data from portal hash URLs

@param {URL} url - URL object with a portal hash
@returns {Object} Parsed attribution data