{"id":9549,"date":"2018-06-07T06:10:40","date_gmt":"2018-06-06T21:10:40","guid":{"rendered":"https:\/\/www.suzukikenichi.com\/blog\/?p=9549"},"modified":"2018-06-07T18:26:04","modified_gmt":"2018-06-07T09:26:04","slug":"google-seems-to-follow-js-injected-rel-canonical-at-least-in-some-cases","status":"publish","type":"post","link":"https:\/\/www.suzukikenichi.com\/blog\/google-seems-to-follow-js-injected-rel-canonical-at-least-in-some-cases\/","title":{"rendered":"JS\u633f\u5165\u3057\u3066\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3057\u305fcanonical\u30bf\u30b0\u3092Google\u306f\u5b9f\u969b\u306b\u306f\u304d\u3061\u3093\u3068\u51e6\u7406\u3059\u308b\u3053\u3068\u304c\u5224\u660e"},"content":{"rendered":"<p class=\"p20-b al-r small\">[\u30ec\u30d9\u30eb: \u4e0a\u7d1a]<\/p>\n<p><a href=\"https:\/\/www.suzukikenichi.com\/blog\/google-only-checks-canonicals-on-the-raw-html-not-the-rendered-one\/\">JavaScript \u306b\u3088\u3063\u3066\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3057\u305f <code>rel=\"canonical\"<\/code> \u30bf\u30b0\u3092 Googlebot \u306f\u7121\u8996\u3059\u308b<\/a>\u3053\u3068\u304c Google I\/O 2018 \u3067\u660e\u3089\u304b\u306b\u306a\u308a\u307e\u3057\u305f\uff08<a href=\"https:\/\/www.suzukikenichi.com\/blog\/only-rel-canonical-and-rel-amphtml-are-taken-from-raw-html\/\"><code>rel=\"amphtml\"<\/code> \u3082\u540c\u69d8\u306b\u7121\u8996<\/a>\u3055\u308c\u308b\uff09\u3002<\/p>\n<p class=\"p60-b\">\u3057\u304b\u3057\u306a\u304c\u3089\u3001JavaScript \u306b\u3088\u3063\u3066\u633f\u5165\u3055\u308c\u305f <code>rel=\"canonical\"<\/code> \u3092\u304d\u3061\u3093\u3068\u51e6\u7406\u3059\u308b\u30b1\u30fc\u30b9\u304c\u5b9f\u969b\u306b\u306f\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<h2>JS \u633f\u5165\u3057\u305f canonical \u3092 Googlebot \u304c\u8a8d\u8b58\u3059\u308b\u3053\u3068\u3092\u5b9f\u9a13\u3067\u691c\u8a3c<\/h2>\n<p>JavaScript \u306b\u3088\u3063\u3066\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3067\u633f\u5165\u3057\u305f <code>rel=\"canonical\"<\/code> \u3092 Google \u306f\u672c\u5f53\u306b\u7121\u8996\u3059\u308b\u306e\u304b\u3069\u3046\u304b\u3092 <a href=\"https:\/\/twitter.com\/rebelytics\">Eoghan Henn<\/a>\uff08\u30aa\u30fc\u30f3\u30fb\u30d8\u30f3\uff09\u6c0f\u304c\u30c6\u30b9\u30c8\u306b\u3088\u3063\u3066\u691c\u8a3c\u3057\u307e\u3057\u305f\u3002<br \/>\u30c6\u30b9\u30c8\u306e\u624b\u9806\u3068\u7d4c\u904e\u3001\u7d50\u679c\u306e\u8a73\u7d30\u306f<a href=\"https:\/\/www.searchviu.com\/en\/javascript-canonical-tags\/\">\u30ec\u30dd\u30fc\u30c8\u8a18\u4e8b<\/a>\u3067\u78ba\u8a8d\u3057\u3066\u3044\u305f\u3060\u304f\u3068\u3057\u3066\u3001\u7c21\u5358\u306b\u307e\u3068\u3081\u308b\u3068\u6b21\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u5224\u660e\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u304a <code>rel=\"canonical\"<\/code> \u306e\u633f\u5165\u306b\u306f\u3001Google \u30bf\u30b0\u30de\u30cd\u30fc\u30b8\u30e3 (GTM) \u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>GTM \u3067\u633f\u5165\u3057\u305f rel=&#8221;canonical&#8221; \u306f\u691c\u7d22\u7d50\u679c\u306b\u304a\u3044\u3066\u306f\u60f3\u5b9a\u3069\u304a\u308a\u306b\u51e6\u7406\u3055\u308c\u305f\u3001\u3064\u307e\u308a\u304d\u3061\u3093\u3068\u6b63\u898f\u5316\u3055\u308c\u305f<\/li>\n<li>\uff08\u30d9\u30fc\u30bf\u7248\uff09Search Console \u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30ab\u30d0\u30ec\u30c3\u30b8\u3067\u306f\u3001\u300c\u9001\u4fe1\u3055\u308c\u305f URL \u304c canonical \u3068\u3057\u3066\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u300d\u306e\u8b66\u544a\u304c\u30ec\u30dd\u30fc\u30c8\u3055\u308c\u305f\u3002<\/li>\n<\/ul>\n<p class=\"p40-b\">\u6700\u7d42\u7684\u306a\u691c\u7d22\u7d50\u679c\u306e\u72b6\u6cc1\u306f I\/O \u3067\u306e\u767a\u8868\u3068\u4e00\u81f4\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\u3057\u304b\u3057\u3001Search Console \u3067\u306f I\/O \u3067\u8a00\u308f\u308c\u305f\u52d5\u304d\u3068\u4e00\u81f4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>JS \u633f\u5165\u306e canonical \u304c\u6a5f\u80fd\u3059\u308b\u30b1\u30fc\u30b9\u3082\u3042\u308b\u3089\u3057\u3044\u304c\u983c\u308b\u3079\u304d\u3067\u306f\u306a\u3044<\/h2>\n<p>\u3053\u306e\u5b9f\u9a13\u7d50\u679c\u306b\u3064\u3044\u3066\u3001Google \u306e John Mueller\uff08\u30b8\u30e7\u30f3\u30fb\u30df\u30e5\u30fc\u30e9\u30fc\uff09\u6c0f\u306f\u6b21\u306e\u3088\u3046\u306b\u30b3\u30e1\u30f3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>I\/O \u3067\u306e\u8a00\u53ca\u306f\u3069\u3061\u3089\u304b\u3068\u3044\u3046\u3068\u6ce8\u610f\u559a\u8d77\u306b\u8fd1\u3044\u3002\u81ea\u5206\uff08\u30b8\u30e7\u30f3\uff09\u306b\u3068\u3063\u3066\u3082\u4e88\u60f3\u5916\u306e\u3053\u3068\u3060\u3063\u305f\u306e\u3067\u77e5\u3089\u305b\u305f\u307b\u3046\u304c\u3044\u3044\u3068\u8003\u3048\u305f<\/li>\n<li>JS \u3067\u633f\u5165\u3057\u305f <code>rel=\"canonical\"<\/code> \u304c\u5e38\u306b\u3067\u306f\u306a\u3044\u304c\u3046\u307e\u304f\u6a5f\u80fd\u3059\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308b\u3088\u3046\u3060<\/li>\n<li>\u305f\u3060\u3057\u305d\u308c\u306b\u983c\u308b\u3079\u304d\u3067\u306f\u306a\u3044\u3002\u78ba\u5b9f\u306b\u51e6\u7406\u3055\u305b\u305f\u3044\u306a\u3089\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u6700\u521d\u304b\u3089 <code>rel=\"canonical\"<\/code> \u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u305b\u3066\u304a\u304f\u3079\u304d<\/li>\n<li>JS \u306b\u3088\u3063\u3066\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3067\u4e0a\u66f8\u304d\u3057\u305f <code>rel=\"canonical\"<\/code> \u304c\u304d\u3061\u3093\u3068\u51e6\u7406\u3055\u308c\u308b\u304b\u3069\u3046\u304b\u306f\u4e0d\u78ba\u304b<\/li>\n<\/ul>\n<div class=\"p40-b\">\n<blockquote class=\"twitter-tweet\" data-conversation=\"none\" data-lang=\"ja\">\n<p lang=\"en\" dir=\"ltr\">This was a cool test setup, thanks for running it! A few things: what we said at I\/O (re: rel-canonical via JS) was more of a warning. When I saw that internally, I wanted to let folks know, because it was unexpected to me (&amp; imo it would be good to support it).<\/p>\n<p>&mdash; John \u2606.o(\u2267\u25bd\u2266)o.\u2606 (@JohnMu) <a href=\"https:\/\/twitter.com\/JohnMu\/status\/1004266274556399616?ref_src=twsrc%5Etfw\">2018\u5e746\u67086\u65e5<\/a><\/p><\/blockquote>\n<blockquote class=\"twitter-tweet\" data-conversation=\"none\" data-lang=\"ja\">\n<p lang=\"en\" dir=\"ltr\">Going through your example, it looks like it does work, at least sometimes (see? great test!). IMO I would not rely on this though, if you really want a URL as a canonical, do the work to get the signal in right from the start.<\/p>\n<p>&mdash; John \u2606.o(\u2267\u25bd\u2266)o.\u2606 (@JohnMu) <a href=\"https:\/\/twitter.com\/JohnMu\/status\/1004267152101314560?ref_src=twsrc%5Etfw\">2018\u5e746\u67086\u65e5<\/a><\/p><\/blockquote>\n<blockquote class=\"twitter-tweet\" data-conversation=\"none\" data-lang=\"ja\">\n<p lang=\"en\" dir=\"ltr\">If you&#39;re providing conflicting directives (overwriting an existing rel=canonical), that&#39;s always a bit iffy. It does look like we pick up rel-canonicals added via JS in many cases now though. Woot! Makes life a bit easier (and also more ways to self-foot-shoot \u00af\\_(\u30c4)_\/\u00af )<\/p>\n<p>&mdash; John \u2606.o(\u2267\u25bd\u2266)o.\u2606 (@JohnMu) <a href=\"https:\/\/twitter.com\/JohnMu\/status\/1004354979669389312?ref_src=twsrc%5Etfw\">2018\u5e746\u67086\u65e5<\/a><\/p><\/blockquote>\n<\/div>\n<h2>\u539f\u5247\u3068\u3057\u3066 canonical \u306f\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u914d\u4fe1\u3059\u3079\u3057<\/h2>\n<p>1\u3064\u306e\u5b9f\u9a13\u3001\u3057\u304b\u3082\u691c\u8a3c\u306e\u305f\u3081\u306b\u6e96\u5099\u3057\u305f\u74b0\u5883\u306a\u306e\u3067\u65ad\u5b9a\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001JavaScript \u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u305b\u305f <code>rel=\"canonical\"<\/code> \u3092 Google \u304c\u51e6\u7406\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u306f\u9593\u9055\u3044\u306a\u3044\u3088\u3046\u3067\u3059\u3002<br \/>\u3057\u304b\u3057\u305d\u3046\u306f\u8a00\u3063\u3066\u3082\u3001100%\u78ba\u5b9f\u306b\u3068\u3044\u3046\u4fdd\u8a3c\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u307e\u305f JS \u633f\u5165\u306b\u3088\u308b rel=&#8221;canonical&#8221; \u304c\u691c\u7d22\u7d50\u679c\u306b\u53cd\u6620\u3055\u308c\u308b\u307e\u3067\u306b\u306f3\u9031\u9593\u307b\u3069\u304b\u304b\u3063\u305f\u3068\u306e\u3053\u3068\u3067\u3059\u3002<br \/>JS \u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3057\u3066\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3059\u308b\u306e\u306f<a href=\"https:\/\/www.suzukikenichi.com\/blog\/executing-javascript-needs-another-cycle-and-takes-longer-time\/\"> HTML \u306e\u30af\u30ed\u30fc\u30eb\u3068\u306f\u5225\u30d7\u30ed\u30bb\u30b9<\/a>\u3067\u3059\u3002<br \/>\u691c\u7d22\u7d50\u679c\u306b\u51fa\u308b\u307e\u3067\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u306f\u3088\u304f\u77e5\u3089\u308c\u308b\u3068\u3053\u308d\u3060\u3057\u3001Google I\/O \u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u306a\u304b\u3067\u3082\u89e6\u308c\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u3082 rel=&#8221;canonical&#8221; \u3092\u914d\u4fe1\u3057\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3067\u3082 rel=&#8221;canonical&#8221;\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u305b\u3001\u4e21\u8005\u304c\u4e00\u81f4\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u304a\u305d\u3089\u304f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3067\u306e\u6700\u7d42\u578b\u304c\u51e6\u7406\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002<br \/>\u3057\u304b\u3057\u3001\u3053\u308c\u3082\u4fdd\u8a3c\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>JavaScript \u306b\u3088\u3063\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u305b\u305f rel=&#8221;canonical&#8221; \u3092 Google \u306f\u5b9f\u969b\u306b\u306f\u8a8d\u8b58\u3059\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\u3067\u3059\u304c\u3001\u305d\u3046\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3068\u3044\u3046\u7279\u5225\u306a\u72b6\u6cc1\u306b\u306a\u3044\u9650\u308a\u306f\u3001<code>rel=\"canonical\"<\/code> \u306f\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u914d\u4fe1\u3059\u308b\u306e\u304c\u5b89\u5168\u78ba\u5b9f\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript \u306b\u3088\u3063\u3066\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3057\u305f rel=canonical \u30bf\u30b0\u3092 Googlebot \u306f\u7121\u8996\u3059\u308b\u3053\u3068\u304c Google I\/O 2018 \u3067\u660e\u3089\u304b\u306b\u306a\u3063\u305f\u3002\u3057\u304b\u3057\u306a\u304c\u3089\u3001JavaScript \u306b\u3088\u3063\u3066\u633f\u5165\u3055\u308c\u305f rel=canonical \u3092\u304d\u3061\u3093\u3068\u51e6\u7406\u3059\u308b\u30b1\u30fc\u30b9\u304c\u5b9f\u969b\u306b\u306f\u3042\u308b\u3088\u3046\u3060\u3002\u691c\u8a3c\u306e\u7d50\u679c\u3001\u5224\u660e\u3057\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[578,614,1212],"class_list":["post-9549","post","type-post","status-publish","format-standard","category-google-seo","tag-javascript","tag-rel-canonical","tag-rendering"],"_links":{"self":[{"href":"https:\/\/www.suzukikenichi.com\/blog\/wp-json\/wp\/v2\/posts\/9549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suzukikenichi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suzukikenichi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suzukikenichi.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suzukikenichi.com\/blog\/wp-json\/wp\/v2\/comments?post=9549"}],"version-history":[{"count":0,"href":"https:\/\/www.suzukikenichi.com\/blog\/wp-json\/wp\/v2\/posts\/9549\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.suzukikenichi.com\/blog\/wp-json\/wp\/v2\/media?parent=9549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suzukikenichi.com\/blog\/wp-json\/wp\/v2\/categories?post=9549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suzukikenichi.com\/blog\/wp-json\/wp\/v2\/tags?post=9549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}