The EP API sometimes returns event types as short codes (REFERRAL,
COM_VOTE) and sometimes as URI strings (def/ep-activities/REFERRAL).
This helper strips any URI prefix and uppercases the result so both forms
map to the same stage in the dwell distribution.
Parameters
type: string
Raw event type from the EP API
Returns string
Normalized stage key, or empty string when unavailable
Normalize an EP event type to a stable stage key.
The EP API sometimes returns event types as short codes (
REFERRAL,COM_VOTE) and sometimes as URI strings (def/ep-activities/REFERRAL). This helper strips any URI prefix and uppercases the result so both forms map to the same stage in the dwell distribution.