Nous sommes entrain de traiter votre demande.
async function main() {
const urlParams = new URLSearchParams(window.location.search);
const first_name = urlParams.get('first_name');
const last_name = urlParams.get('last_name');
const email = urlParams.get('email');
const phone = urlParams.get('phone');
const address = urlParams.get('address');
const listing_type = urlParams.get('listing_type');
const agency = urlParams.get('agency');
const brand ="Kazeo";
const utm_source = urlParams.get('utm_source');
const utm_campaign = urlParams.get('utm_campaign');
const utm_medium = urlParams.get('utm_medium');
// Appel à l'API Airtable mettre a jour la table
await fetch('https://api.airtable.com/v0/appNiLgAFNdbGv4RU/tblmWHy1wBMtozxFr', {
method: 'POST',
headers: {
'Authorization': 'Bearer patjyhAkGhMm6vRnT.cae422323d28505d67d78e55c82d595ca2f3807979c3698736a70a12bb16e564',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"fields": {
"Prénom": first_name,
"Nom": last_name,
"Téléphone": phone,
"Email": email,
"Adresse": address,
"Type de bien": listing_type,
"Type estimation": 'Je souhaite le vendre',
"Agence": agency,
"Marque": 'Kazeo',
"utm_source": utm_source,
"utm_campaign": utm_campaign,
"utm_medium": utm_medium
}
})
});
// Redirection
window.location.href = '/estimation-en-ligne-merci';
}
main();
To top