Ajouter

Lorem ipsum

Lorem ipsum

CRO / Conversion

4 min

How to Show a Message to Returning Visitors in Webflow

Learn how to show a custom message to returning visitors in Webflow with localStorage.

In this tutorial, Sandro, cofounder of Gemeos Webflow agency, shows you how to display a personalized welcome message for returning visitors on your Webflow site with localStorage.

Example

👋 You're back! Visit #?
First visit

Welcome to Gemeos 👋

See how we help startups and scale-ups convert more.

Returning visitor

You're back! This is your visit #? 🎉

Ready for the next step? Let's talk.

Loading...

localStorage variableValueUse
visit-countNumber of visitsDifferentiate first visit / returning visitor
last-visitISO dateCalculate time since last visit
BannerID returning-bannerReturning welcome notification

1. Create the elements in Webflow

Create a Div with the ID returning-banner in Fixed position, at the bottom or top of the page, with display: none by default. Add first-visit-msg and returning-msg Divs for the conditional messages. Add a Text Block visit-count-display to show the number of visits.

2. Add the script in Footer code

(function() {
var visits = parseInt(localStorage.getItem('visit-count') || '0') + 1;
localStorage.setItem('visit-count', visits);
localStorage.setItem('last-visit', new Date().toISOString());

var banner = document.getElementById('returning-banner');
var firstMsg = document.getElementById('first-visit-msg');
var returningMsg = document.getElementById('returning-msg');
var visitCountEl = document.getElementById('visit-count-display');

if (visitCountEl) visitCountEl.textContent = visits;

if (visits === 1) {
// First visit
if (firstMsg) firstMsg.style.display = 'block';
if (returningMsg) returningMsg.style.display = 'none';
} else {
// Returning visitor
if (returningMsg) returningMsg.style.display = 'block';
if (firstMsg) firstMsg.style.display = 'none';
if (banner) {
banner.style.display = 'flex';
// Hide after 5 seconds
setTimeout(function() {
banner.style.opacity = '0';
banner.style.transition = 'opacity 0.5s';
setTimeout(function() { banner.style.display = 'none'; }, 500);
}, 5000);
}
}
})();

3. Advanced customization based on the number of visits

var visits = parseInt(localStorage.getItem('visit-count') || '0');
if (visits >= 3) {
// Very engaged visitor: show an offer
document.getElementById('engaged-offer')?.style.display = 'block';
} else if (visits === 2) {
// Second visit: show a testimonial
document.getElementById('social-proof')?.style.display = 'block';
}

good to know

localStorage is persistent across sessions, but it's tied to the browser and device. A visitor who comes back on mobile after visiting on desktop will count as a first visit. For reliable cross-device tracking, you need an authentication system or a server-side cookie. For most UX use cases, localStorage is enough.

Conclusion

Recognizing returning visitors creates a sense of connection and improves conversion. Use cases:

  • Personalized welcome-back message
  • Special offer unlocked on the 3rd visit
  • Different CTA for hot leads (2+ visits)

👋 You're back! Visit #?×

First visit 👋

Welcome! See how Gemeos can help you.

You're back! 🎉

This is your visit #?. Ready for the next step?

Loading...

Published on

You might be interested in these tutorials

Similar tutorials

SEO / GEO

5 min read

5 views

How to Set Up a Redirect in Webflow? (2026)

Updated on 19.12.2025 by Sandro DA SILVA

SEO / GEO

5 min read

5 views

Add structured data to your Webflow site?

Updated on 21.08.2025 by Sandro DA SILVA

No-code

5 min read

5 views

How to Obfuscate a Link in Webflow

Updated on 23.04.2025 by Sandro DA SILVA

Let’s f*****G GO !!

Ready to launch
Your business?

Alexandre

Max

Enora

Bryan

Cannelle

Tiphaine

You'll :heart: our collaboration...