Title Focus Growth Hack

Learn a trick to catch your users attention when they leave the current article or blog post.

With the growing amount of content on the web, users are becoming more and more distracted. This means they’ll have more tabs open and may open your blog posts, but never actually get around to reading them.

This is a quick and dirty growth hack to help you refocus a users attention back on your article when they aren’t viewing it.

This hack works by changing the title tag when you focus away from the tab inside your browser. You can see it in action below.

You can deliver a catchy message or make the user feel bad for not reading your content. How you use it is completely up to you.

It’s really easy to implement this little trick, simply take the code below and insert it into a Javascript file or your blog template.

<script>
  var message = "Hey, come back!";
  var original;

  $(window).focus(function() {
    if(original) {
      document.title = original;
    }
  }).blur(function() {
    var title = $('title').text();
    if(title != message) {
      original = title;
    }
    document.title = message;
  });
</script>

Feel free to customise the text or message that you show users by editing the message variable inside the script.

Enjoy!

Keep On Growing ☺

Author

Stuart McKeown

Stuart McKeown is one of the Co-founders at Gleam. Aside from writing and helping businesses grow, he also enjoys sound design and drinking tea ☕️