The service identifier to validate the stored UTM data against.
The parsed UTM parameters object if valid, or null if expired, mismatched, or invalid.
import getUTMParams from '@/utils/getUTMParams';
import { UTM_SERVICES_ENUM } from '@/constants/utm';
const utm = getUTMParams(UTM_SERVICES_ENUM.INSURANCE_BODY);
if (utm) {
console.log('Valid UTM parameters related to insurance body service:', utm);
} else {
console.log('No valid UTM data found.');
}
Retrieves and validates stored UTM parameters for a specific service.
This function reads a serialized UTM object from
sessionStorageunder the key defined byUTM_STORAGE_KEY. It ensures that:expirytimestamp).serviceIf any of these checks fail, the function clears the stored data and returns
null.