(function(){ var isBars = location.hostname.includes('morganbars'); var icon = isBars ? '/logo.svg' : '/logo-travel.svg'; document.getElementById('favicon').href = icon; document.getElementById('apple-icon').href = icon; })(); Morgan Travel Map | Morgan Travel Map (function(){ var h = location.hostname; if (h.indexOf('morganbars') >= 0) { document.title = 'Morgan Bar & Dining Map'; var d = document.querySelector('meta[name="description"]'); if (d) d.content = 'Interactive map of 700+ bars and restaurants in Taipei.'; } else if (h.indexOf('morgantrip') >= 0) { document.title = 'Morgan Travel Map'; var d = document.querySelector('meta[name="description"]'); if (d) d.content = 'Interactive map of 4000+ travel stories and photos.'; } })(); (function () { var h = location.hostname; var isBars = h.includes('morganbars'); var url = isBars ? 'https://morganbars.com' : 'https://morgantrip.com'; var ogImage = url + (isBars ? '/og-bars.png' : '/og-travel.png'); // i18n: Set SEO meta based on language var lang = (new URLSearchParams(location.search).get('lang')) || (localStorage.getItem('morgan_lang')) || (navigator.language || '').split('-')[0]; var titles = { bars: { 'zh': 'Morgan Bar & Dining Map', 'en': 'Morgan Bar & Dining Map', 'ja': 'Morgan Bar & Dining Map', 'ko': 'Morgan Bar & Dining Map' }, travel: { 'zh': 'Morgan Travel Map', 'en': 'Morgan Travel Map', 'ja': 'Morgan Travel Map', 'ko': 'Morgan Travel Map' } }; var descs = { bars: { 'zh': 'Find a suitable place for a drink. Interactive map featuring 700+ bars, bistros, and restaurants in Taipei.', 'en': 'Find your perfect spot for a drink. Interactive map of 700+ bars and restaurants in Taipei.', 'ja': 'Find your perfect spot for a drink. Interactive map of 700+ bars and restaurants in Taipei.', 'ko': 'Find your perfect spot for a drink. Interactive map of 700+ bars and restaurants in Taipei.' }, travel: { 'zh': 'Put a lifetime into a map. Interactive map featuring years of travel footprints, check-ins, and photos.', 'en': 'A lifetime of journeys, on one map. Interactive map of 4000+ travel stories and photos.', 'ja': 'A lifetime of journeys, on one map. Interactive map of 4000+ travel stories and photos.', 'ko': 'A lifetime of journeys, on one map. Interactive map of 4000+ travel stories and photos.' } }; var lk = lang === 'ja' ? 'ja' : lang === 'ko' ? 'ko' : lang === 'en' ? 'en' : 'zh'; var type = isBars ? 'bars' : 'travel'; var title = titles[type][lk] || titles[type]['zh']; var desc = descs[type][lk] || descs[type]['zh']; // OG locale mapping var ogLocales = { 'zh': 'zh_TW', 'en': 'en_US', 'ja': 'ja_JP', 'ko': 'ko_KR' }; document.title = title; document.documentElement.lang = lk === 'zh' ? 'zh-TW' : lk; var m = function(s, v) { var el = document.querySelector(s); if (el) el.setAttribute('content', v); }; m('meta[name="description"]', desc); m('meta[property="og:site_name"]', title); m('meta[property="og:title"]', title); m('meta[property="og:description"]', desc); m('meta[property="og:url"]', url); m('meta[property="og:image"]', ogImage); m('meta[property="og:image:width"]', '1200'); m('meta[property="og:image:height"]', '630'); m('meta[property="og:locale"]', ogLocales[lk] || 'zh_TW'); m('meta[name="twitter:title"]', title); m('meta[name="twitter:description"]', desc); m('meta[name="twitter:image"]', ogImage); var canon = document.querySelector('link[rel="canonical"]'); if (canon) canon.setAttribute('href', url + '/'); // hreflang: SPA language switching is a frontend behavior, all languages point to the same root URL to prevent ?lang= from being treated as an independent page by Google var head = document.head; ['zh-TW', 'en', 'ja', 'ko', 'zh-CN'].forEach(function(l) { var link = document.createElement('link'); link.rel = 'alternate'; link.hreflang = l; link.href = url + '/'; head.appendChild(link); }); var xDefault = document.createElement('link'); xDefault.rel = 'alternate'; xDefault.hreflang = 'x-default'; xDefault.href = url + '/'; head.appendChild(xDefault); })(); (function () { const host = window.location.hostname; let GA_ID = ''; if (host.includes('morganbars.com')) { // Morgan Bar & Dining Map GA_ID = 'G-X9M4EK0YZC'; } else if (host.includes('morgantrip.com')) { // Morgan Travel Map GA_ID = 'G-P0MPNPR0EL'; } if (!GA_ID) return; // Load gtag.js const s = document.createElement('script'); s.async = true; s.src = 'https://www.googletagmanager.com/gtag/js?id=' + GA_ID; document.head.appendChild(s); window.dataLayer = window.dataLayer || []; function gtag(){window.dataLayer.push(arguments)} window.gtag = gtag; gtag('js', new Date()); gtag('config', GA_ID); })(); { "@context": "https://schema.org", "@type": "WebSite", "name": "", "url": "", "description": "", "author": { "@type": "Person", "name": "Morgan", "url": "https://morgantrip.com" }, "inLanguage": "zh-TW", "potentialAction": { "@type": "SearchAction", "target": { "@type": "EntryPoint", "urlTemplate": "" }, "query-input": "required name=search_term_string" } } (function () { var h = location.hostname; var isBars = h.includes('morganbars'); var title = isBars ? 'Morgan Bar & Dining Map' : 'Morgan Travel Map'; var desc = isBars ? 'Bars visited by Morgan. Interactive map of bars and restaurants in Taipei.' : 'Places visited by Morgan. Interactive map of years of travel footprints, check-ins, and photos.'; var url = isBars ? 'https://morganbars.com' : 'https://morgantrip.com'; try { var el = document.getElementById('json-ld-website'); if (el) { var ld = JSON.parse(el.textContent); ld.name = title; ld.url = url + '/'; ld.description = desc; ld.potentialAction.target.urlTemplate = url + '/?q={search_term_string}'; el.textContent = JSON.stringify(ld); } } catch(e) {} })();

FACT BOX

  • Source: PR Times
  • Category: New Product