// Get the current URL var currentUrl = window.location.href; // Define an object with mappings of variables to corresponding text fields var fieldMappings = { utm_campaign: 'mx_utm_campaign', utm_medium: 'mx_utm_medium', utm_source: 'mx_utm_source', }; // Loop through the mappings and insert the values into the corresponding text fields for (var param in fieldMappings) { var fieldName = fieldMappings[param]; var match = currentUrl.match(new RegExp('[?&]' + param + '=([^&]+)')); if (match) { var paramValue = match[1]; var textField = document.querySelector('input[name="' + fieldName + '"]'); if (textField) { textField.value = paramValue; } } }
top of page

Request Info

I'm a paragraph. Click here to add your own text and edit me. It’s easy. Just click “Edit Text” or double click me to add your own content and make changes to the font.

Thanks for submitting!

bottom of page