Nothing is returned; the function has a side effect of writing to sessionStorage.
import storeGADParams from '@/utils/storeGADParams';
// Example: URL = https://example.com/?utm_source=google&utm_campaign=winter_sale
storeGADParams();
// Stores something like:
// {
// utm_source: 'google',
// utm_campaign: 'winter_sale',
// landingPage: '/home',
// deviceType: 'desktop',
// expiry: 1730564030000
// }
Extracts UTM (Urchin Tracking Module) parameters from the current page URL and stores them in
sessionStoragefor later use.This function parses the URL query parameters and collects standard UTM fields:
gad_source,gad_campaignid,gbraid, andgclid.If at least one UTM parameter exists, it constructs a UTM object that includes:
landingPage).GAD_EXPIRY_HOURS.The resulting object is serialized and saved in
sessionStorageunder the key defined byGAD_STORAGE_KEY. This allows subsequent calls (e.g. viagetGADParams) to retrieve and validate UTM data associated with the user’s session.