// Wait for the DOM to be fully loaded
document.addEventListener('DOMContentLoaded', function() {
// Extract the form submission data from the URL
const urlParams = new URLSearchParams(window.location.search);
// Get the form data parameters from the URL
const formFields = {
'utm_source': urlParams.get('utm_source'),
'utm_medium': urlParams.get('utm_medium'),
'utm_campaign': urlParams.get('utm_campaign'),
'lead_source': urlParams.get('lead_source'),
'email': urlParams.get('email'),
'first_name': urlParams.get('first_name'),
'last_name': urlParams.get('last_name'),
'company': urlParams.get('company'),
'phone': urlParams.get('phone'),
'country': urlParams.get('country'),
'enquiry': urlParams.get('enquiry'),
'email_opt_in': urlParams.get('email_opt_in')
};
// Create a formatted string of the data to display
let formDataDisplay = '';
for (let key in formFields) {
if (formFields[key]) {
formDataDisplay += `${key.replace(/_/g, ' ').toUpperCase()}: ${formFields[key]} `;
}
}
// Insert the data into the placeholder element
document.getElementById('form-submission-data').innerHTML = formDataDisplay;
});