1. Add custom code to retrieve the UTM parameter and store it in the session
Add this custom code in the head of each of your landing pages
<script>
// Récupération de la valeur des paramètres "utm_source" dans l'URL et la stock dans la session
var utmSource;
if (!sessionStorage.getItem("utmSource")) {
utmSource = new URL(window.location.href).searchParams.get("utm_source") || "google";
sessionStorage.setItem("utmSource", utmSource);
} else {
utmSource = sessionStorage.getItem("utmSource");
}
</script>
2. Add fields to your form to raise UTM parameters
Remember to put these fields on display: none, your prospects do not need to see them and this may degrade your conversion rate.
3. Add an ID to each of the fields you use to retrieve values
4. Add custom code to show the UTM parameter in your form fields
< script>
// Récupérer l'élément HTML correspondant au champ de formulaire
var leadSource = document.getElementById("leadSource");
// Modifier la valeur de l'élément HTML pour afficher firstPage
leadSource.value = utmSource;
</script>
Remember to put the value of the ID you entered earlier in place of “LeadSource”
Growth Marketer, Webflow expert and a jack of all trades. I take care of commercial operations, ensure the smooth running of projects and take care of issues related to marketing (SEO, Tracking, Copywriting, etc.)