."; the click id is
// everything after the second dot.
function clickCookieValue(raw) {
if (!raw) return '';
var parts = raw.split('.');
return parts.length >= 3 ? parts.slice(2).join('.') : '';
}
// The first-party cookies Google's and Microsoft's own tags persist on ad
// landings: _gcl_aw (gclid, 90 days), _gcl_gb (gbraid), _uetmsclkid
// ("_uet" + msclkid). These survive even when our localStorage record was
// written earlier by an organic visit.
function readClickCookies() {
var out = {};
try {
var gclid = clickCookieValue(readCookie('_gcl_aw'));
if (gclid) out.gclid = gclid;
var gbraid = clickCookieValue(readCookie('_gcl_gb'));
if (gbraid) out.gbraid = gbraid;
var msclkid = readCookie('_uetmsclkid');
if (msclkid) out.msclkid = msclkid.indexOf('_uet') === 0 ? msclkid.slice(4) : msclkid;
} catch (e) {}
return out;
}
function readGaCookies() {
var out = {};
try {
var clientMatch = document.cookie.match(/(?:^|;\s*)_ga=([^;]+)/);
if (clientMatch) {
var clientParts = decodeURIComponent(clientMatch[1]).split('.');
if (clientParts.length >= 2) out.ga_client_id = clientParts.slice(-2).join('.');
}
} catch (e) {}
try {
// This cookie suffix is the GA4 stream ID; the automation coverage alert
// is the backstop if a future stream replacement changes it.
var sessionMatch = document.cookie.match(/(?:^|;\s*)_ga_23T968XY2Y=([^;]+)/);
if (sessionMatch) {
var sessionCookie = decodeURIComponent(sessionMatch[1]);
var gs2Match = sessionCookie.match(/(?:^|[.$])s(\d+)(?:\$|$)/);
var sessionParts = sessionCookie.split('.');
var sessionId = gs2Match
? gs2Match[1]
: sessionParts[0] === 'GS1' && /^\d+$/.test(sessionParts[2] || '')
? sessionParts[2]
: '';
if (sessionId) out.ga_session_id = sessionId;
}
} catch (e) {}
return out;
}
// Stored (URL-captured) values win; cookie-derived values only fill gaps, so
// a referrer-only stored record can never mask a click ID the ad platforms'
// own cookies still carry.
function mergeAttribution(stored, cookies) {
var out = {};
var key;
for (key in cookies) {
if (cookies[key]) out[key] = cookies[key];
}
for (key in stored) {
if (stored[key]) out[key] = stored[key];
}
return out;
}
window.__mhAttribution = {
URL_PARAMS: URL_PARAMS,
readStored: readStored,
writeStored: writeStored,
hasClickId: hasClickId,
readClickCookies: readClickCookies,
readGaCookies: readGaCookies,
mergeAttribution: mergeAttribution
};
})();
BOOK YOUR RENTAL
Choose your dates, pick your ride, and explore the Big Island in style.
Loading booking system…
Mauka Hualalai RentalsDEV
We usually reply within a few minutes
Aloha! 🤙 Before we chat, please share your name and email so we can follow up if needed.
How can we help you today? Ask us anything about our vehicles or rentals! 🌺