For jobseekers
For employers
About
Blog
FastGig Rewards
Contact us
Talk to our team
First name
Last name
Email address
Phone number
Leave us message
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
/** * FastGig UTM handler (Webflow) * - Saves only utm_* params from the landing URL * - Keeps them for a limited time (first-party localStorage) * - Appends them ONLY to signup links (employer.fastgig.sg), never to internal/# links */ (function () { var CONFIG = { storageKey: 'fg_utm', maxDays: 7, targetHosts: ['employer.fastgig.sg'], // only these links get UTMs debug: false }; function log(msg) { if (CONFIG.debug) console.info('[UTM]', msg); } // Clean up the old BRIX keys so returning visitors stop getting stale UTMs try { localStorage.removeItem('brix_utm_params'); localStorage.removeItem('brix_utm_params_timestamp'); } catch (e) {} // 1. Read utm_* from the current URL function getUrlUtms() { var utms = {}; new URLSearchParams(window.location.search).forEach(function (value, key) { if (key.indexOf('utm_') === 0 && value) utms[key] = value; }); return utms; } // 2. Save new UTMs, or load stored ones if still valid function resolveUtms() { var fromUrl = getUrlUtms(); if (Object.keys(fromUrl).length) { try { localStorage.setItem(CONFIG.storageKey, JSON.stringify({ utms: fromUrl, ts: Date.now() })); log('Saved UTMs from URL'); } catch (e) {} return fromUrl; } try { var stored = JSON.parse(localStorage.getItem(CONFIG.storageKey) || 'null'); if (!stored) return {}; var ageDays = (Date.now() - stored.ts) / 86400000; if (ageDays < CONFIG.maxDays) { log('Using stored UTMs'); return stored.utms; } localStorage.removeItem(CONFIG.storageKey); log('Stored UTMs expired'); } catch (e) {} return {}; } // 3. Append UTMs to signup links only function decorateLinks(utms) { if (!Object.keys(utms).length) return; document.querySelectorAll('a[href]').forEach(function (link) { var url; try { url = new URL(link.href); } catch (e) { return; } if (CONFIG.targetHosts.indexOf(url.hostname) === -1) return; // skip internal, #, mailto, external if (url.searchParams.has('utm_source')) return; // keep hard-coded UTMs Object.keys(utms).forEach(function (key) { url.searchParams.set(key, utms[key]); }); link.href = url.toString(); }); log('Decorated signup links'); } function init() { decorateLinks(resolveUtms()); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } })();