On the Softr side, add a field called āLast Seen Timeā to your Users table.
On the Make side, create a scenario with a webhook module, a webhook response module, an Airtable āSearch Recordsā module, and an Airtable āUpdate Recordā module. Wire up the modules so that the search records module looks up a record in your Users table using the email parameter passed into the webhook, and the Airtable update record module updates the Last Seen Time
field of the record with the value formatDate(now)
. Schedule the scenario to run as data comes in.
Back on the Softr app side, add the following JavaScript to your siteās custom code in the Code inside footer section, replacing the value of the webhookUrl
variable with the webhook URL of the webhook module you created:
<script>
const webhookUrl = "your-webhook-url-here";
async function postLastSeenTime(url, data) {
const response = await fetch(url, {
method: 'POST',
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json'
},
redirect: 'follow',
referrerPolicy: 'no-referrer',
body: JSON.stringify(data)
});
return response;
}
postLastSeenTime(webhookUrl, {
email: window.logged_in_user.softr_user_email
}).then((data) => {
console.log(data);
});
</script>
This worked for me. But I didnāt spend any time on error handling. For example, as coded it assumes that all users will be logged in, but depending on your app, you may need to test to make sure the user is logged in before sending the webhook.
To answer your original question⦠this might be more than you want to take on as a no-coder. The analytics approach might be more straightforward!