Redirect to another page when user is idle or inactive?

Is there a code that I can insert in my project that automatically sends an idle page (say after 2 minutes) back to the Home page? Any help appreciated.

How do you define idle?

I’m designing a website that will ultimately become a touch-screen for patrons using the kiosk/touchscreen at our business. If a patron uses it and leaves the page that they are looking at for a length of time, and not clicking on HOME, I’d like the site to revert back to the HOME page after a certain amount of time – say 2 minutes or so. Just wondering if there is any sort of code that I can place in my project to make this happen? Hope I’ve explained this correctly. Thanks, Eddie

Hey i googled this :

timed back to homepage code

I found this:

then you need to paste this in the head of your page:
<meta http-equiv="refresh" content="3;url=" />

Good luck :slight_smile:

Thank you very much!

The meta refresh tag does NOT wait for idle usage. It just redirects after the set number of seconds after page load.

This actually works for me. The whole idea was to refresh or divert the page back to HOME after an idle period. (in my case, 5 minutes) I pasted the following code on each page (except the HOME page) in the custom code section. (Before</body>tag) - 

<script type="text/javascript">
   },300000); /* 1000 = 1 second*/

The project by the way is purposely only designed for a TV touchscreen (16:9 ratio) not for responsive screens. Test site is

Thank you all for your help.
1 Like

That’s no better than a meta refresh tag. The timeout/idle period is not reset when the user interacts with the page (touches the screen or moves the mouse).

I have described a much better solution here: Redirect user after 60 seconds of idling/inactivity?

1 Like

Thanks samliew – I have taken your advice on board.

Exactly what I was looking for!

Thank you very much for your help.

ow i totaly skipped the idle part of the question sorry :slight_smile:
But im for sure gonna use your idle script when i need it Sam :slight_smile:

Hi everyone, I’m having issues here.
whenever I use the window.location.href to redirect a user to a specific page, it reloads repeatedly??