Portretvideo: Karel Soeters

Back to overview < 1 minute reading time 13-01-2021

Meer informatie over Karel Soeters

Get in touch

Name(Required)
console.log("[🔥] UTM script loaded"); function getQueryParam(param) { const urlParams = new URLSearchParams(window.location.search); return urlParams.get(param) || ''; } function mapUTMToValue() { const utmSource = getQueryParam('utm_source'); const gclid = getQueryParam('gclid'); let mappedValue = 'Direct'; if (utmSource === 'linkedin') { mappedValue = 'Linkedin Ads'; } else if (utmSource === 'linkedin_organic') { mappedValue = 'Linkedin Organic'; } else if ((utmSource === 'google') && gclid) { mappedValue = 'Google Ads'; } else if (utmSource === 'google_display') { mappedValue = 'Google Display Ads'; } else if (utmSource === 'google_organic') { mappedValue = 'Website Organic'; } return mappedValue; } function trySetValue(source) { const field = document.querySelector('input[name="input_11"]'); if (field) { const value = mapUTMToValue(); field.value = value; console.log(`[✅] Field found via ${source}. Value set to:`, value); return true; } else { console.warn(`[⛔] Field not found via ${source}.`); return false; } } window.addEventListener