{"id":33953,"date":"2017-07-05T21:01:46","date_gmt":"2017-07-05T13:01:46","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=33953"},"modified":"2017-12-08T22:03:38","modified_gmt":"2017-12-08T14:03:38","slug":"dont-go-favicon-title","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/","title":{"rendered":"This Clever Trick Brings Visitors Back When They Tab Away"},"content":{"rendered":"<p>How many times do you open an article, skim a few sentences, then click away to browse another tab? I\u2019m guilty of this on a daily basis. It\u2019s not so easy to <strong>keep a visitor\u2019s attention<\/strong> and that\u2019s why the <strong><a href=\"https:\/\/github.com\/tiaanduplessis\/dont-go\" target=\"_blank\">Don\u2019t Go script<\/a><\/strong> can be so valuable.<\/p>\n<p>By adding this script to your page, you can <strong>automatically update<\/strong> your site\u2019s favicon and page title whenever the page isn\u2019t currently being viewed.<\/p>\n<p>You can see a <strong>live demo<\/strong> <a href=\"https:\/\/tiaanduplessis.github.io\/dont-go\/\" target=\"_blank\">here<\/a> and it\u2019s a pretty simple one. Just open the page in your browser then move to another tab. Within a few seconds the <strong>page favicon changes, along with the title<\/strong>.<\/p>\n<p class=\"note\"><strong>Read Also:<\/strong> <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/favicons-importance\/\">Let\u2019s Talk About the Importance of Favicons<\/a><\/p>\n<p>This all happens <strong>dynamically<\/strong>, using JavaScript, so everything changes back once the page is active again. As you can imagine this script is <strong>very simple to set up<\/strong>.<\/p>\n<p>It requires <strong>three settings<\/strong>:<\/p>\n<ol>\n<li><strong>Title<\/strong> \u2013 the new page title<\/li>\n<li><strong>Favicon<\/strong> \u2013 the new favicon URL<\/li>\n<li><strong>Timeout<\/strong> \u2013 total delay (in seconds) after the user leaves before making the switch<\/li>\n<\/ol>\n<p>Note the <strong>only required value<\/strong> is the title. You can leave the favicon the same and you can choose to skip the timeout altogether, so the title bar changes immediately.<\/p>\n<p>Here\u2019s a <strong>code sample<\/strong> of what the setup looks like.<\/p>\n<pre>\r\ndontGo({\r\n\ttitle: 'Alternative title text right here!',\r\n\tfaviconSrc: 'path\/to\/Alternative\/favicon.ico',\r\n\ttimeout: 5000 \/\/5 seconds\r\n});\r\n<\/pre>\n<p>Setting up the Don\u2019t Go script could not be easier. It\u2019s available through <strong>npm, Bower, and Yarn<\/strong>, and it\u2019s also hosted on the <strong><a href=\"https:\/\/cdn.rawgit.com\/tiaanduplessis\/dont-go\/master\/lib\/dont-go.js\" target=\"_blank\">GitHub CDN<\/a><\/strong>, pulled straight from the main repo.<\/p>\n<p>This fun script can be a great way to coax readers back onto your site and ultimately, <strong>decrease bounce rates<\/strong>. To learn more, just visit the main <a href=\"https:\/\/github.com\/tiaanduplessis\/dont-go\" target=\"_blank\">GitHub repo<\/a> and skim through the documentation.<\/p>\n<p class=\"note\"><strong>Read Also:<\/strong> <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/animated-favicon-loader-javascript\/\">Create an Animated Favicon Loader with JavaScript<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>How many times do you open an article, skim a few sentences, then click away to browse another tab? I\u2019m guilty of this on a daily basis. It\u2019s not so easy to keep a visitor\u2019s attention and that\u2019s why the Don\u2019t Go script can be so valuable. By adding this script to your page, you&hellip;<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3393],"tags":[826],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Change Favicon &amp; Title When Users Tab Away from Your Site<\/title>\n<meta name=\"description\" content=\"How many times do you open an article, skim a few sentences, then click away to browse another tab? I&#039;m guilty of this on a daily basis. It&#039;s not so easy\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"This Clever Trick Brings Visitors Back When They Tab Away\" \/>\n<meta property=\"og:description\" content=\"How many times do you open an article, skim a few sentences, then click away to browse another tab? I&#039;m guilty of this on a daily basis. It&#039;s not so easy\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-05T13:01:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-08T14:03:38+00:00\" \/>\n<meta name=\"author\" content=\"Jake Rocheleau\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jake Rocheleau\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/dont-go-favicon-title\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/dont-go-favicon-title\\\/\"},\"author\":{\"name\":\"Jake Rocheleau\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\"},\"headline\":\"This Clever Trick Brings Visitors Back When They Tab Away\",\"datePublished\":\"2017-07-05T13:01:46+00:00\",\"dateModified\":\"2017-12-08T14:03:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/dont-go-favicon-title\\\/\"},\"wordCount\":299,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"keywords\":[\"Favicons\"],\"articleSection\":[\"Toolkit\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/dont-go-favicon-title\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/dont-go-favicon-title\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/dont-go-favicon-title\\\/\",\"name\":\"Change Favicon &amp; Title When Users Tab Away from Your Site\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"datePublished\":\"2017-07-05T13:01:46+00:00\",\"dateModified\":\"2017-12-08T14:03:38+00:00\",\"description\":\"How many times do you open an article, skim a few sentences, then click away to browse another tab? I'm guilty of this on a daily basis. It's not so easy\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/dont-go-favicon-title\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/dont-go-favicon-title\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/dont-go-favicon-title\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"This Clever Trick Brings Visitors Back When They Tab Away\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\",\"name\":\"Jake Rocheleau\",\"description\":\"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers\",\"sameAs\":[\"https:\\\/\\\/www.hongkiat.com\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/jake\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Change Favicon &amp; Title When Users Tab Away from Your Site","description":"How many times do you open an article, skim a few sentences, then click away to browse another tab? I'm guilty of this on a daily basis. It's not so easy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/","og_locale":"en_US","og_type":"article","og_title":"This Clever Trick Brings Visitors Back When They Tab Away","og_description":"How many times do you open an article, skim a few sentences, then click away to browse another tab? I'm guilty of this on a daily basis. It's not so easy","og_url":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2017-07-05T13:01:46+00:00","article_modified_time":"2017-12-08T14:03:38+00:00","author":"Jake Rocheleau","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Jake Rocheleau","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/"},"author":{"name":"Jake Rocheleau","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a"},"headline":"This Clever Trick Brings Visitors Back When They Tab Away","datePublished":"2017-07-05T13:01:46+00:00","dateModified":"2017-12-08T14:03:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/"},"wordCount":299,"commentCount":0,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"keywords":["Favicons"],"articleSection":["Toolkit"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/","url":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/","name":"Change Favicon &amp; Title When Users Tab Away from Your Site","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"datePublished":"2017-07-05T13:01:46+00:00","dateModified":"2017-12-08T14:03:38+00:00","description":"How many times do you open an article, skim a few sentences, then click away to browse another tab? I'm guilty of this on a daily basis. It's not so easy","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/dont-go-favicon-title\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"This Clever Trick Brings Visitors Back When They Tab Away"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a","name":"Jake Rocheleau","description":"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers","sameAs":["https:\/\/www.hongkiat.com"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/jake\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-8PD","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/33953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=33953"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/33953\/revisions"}],"predecessor-version":[{"id":42161,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/33953\/revisions\/42161"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=33953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=33953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=33953"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=33953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}