Email Gated Page

document.getElementById('emailForm').addEventListener('submit', function (event) { event.preventDefault(); const email = document.getElementById('email').value; checkEmailInGoogleSheet(email); }); function checkEmailInGoogleSheet(email) { const googleSheetId = 'YOUR_GOOGLE_SHEET_ID'; // Replace with your Google Sheet ID const sheetName = 'Sheet1'; // Replace with your Sheet Name if different const apiKey = 'YOUR_API_KEY'; // Replace with your API Key const url = `https://sheets.googleapis.com/v4/spreadsheets/${googleSheetId}/values/${sheetName}!A:A?key=${apiKey}`; fetch(url) .then(response => response.json()) .then(data => { const emails = data.values.flat(); if (emails.includes(email)) { window.location.href = 'nextpage.html'; // Replace with the URL of your next page } else { document.getElementById('message').innerText = 'Email not found. Please try again.'; } }) .catch(error => { console.error('Error:', error); document.getElementById('message').innerText = 'There was an error processing your request.'; }); }

© 2024 Skin Science Solutions, Inc.

All rights reserved.

*Claims shown by several scientific studies, available upon request.