AMZ123跨境卖家导航
拖动LOGO到书签栏,立即收藏AMZ123
首页跨境头条文章详情

JavaScript SEO怎么做

1958
2020-08-06 18:10
2020-08-06 18:10
1958

Hi. I’m Charles from Cross Border Digital. Are you using JavaScript to build your website? Or maybe you're thinking about using one of the modern JavaScript frameworks like Ember,or Node, or React, or Angular. Great frameworks for building very app-like interfaces on the web.

大家好,我是来自Cross Border Digital的Charles. 你是否在用JavaScript建站?或者你正在考虑用使用当前比较流行的JavaScript框架:Ember、Node、React 或者是Angular建站。这些都是非常优秀的框架,给网站访客提供类似App的操作体验。


But there are some specific challenges to using these JavaScript frameworks when it comes to SEO. Today, I want to share some insights and advice to help you use these frameworks in a way that will work with Google and ensure that you can rank your website.

但是,当涉及到SEO时,使用这些JavaScript框架存在一些特定的挑战。今天,我想分享一些见解和建议,以帮助您以与Google兼容的方式使用这些框架,确保网站在搜索引擎可以获得排名。


So when it comes to understanding the implications of using JavaScript to build your website, there's really two key things that we need to talk about.

因此,在理解使用JavaScript开发网站的意味着什么时,实际上需要讨论两个关键问题。


The first is how Google actually works, how they treat JavaScript, how they understand JavaScript.

首先是Google的实际工作方式,如何对待JavaScript,如何理解JavaScript。


And the second is understanding the difference between client-side and server-side rendering of the content and HTML on your website.

其次是了解网站上内容和HTML在客户端和服务器端渲染的区别。


These two things together if we can understand these, then we can understand how Google is going to interpret our JavaScript-powered website.

如果我们能理解这两点,那么就能了解Google如何读取JavaScript网站。


OK, so let's first talk about Google. There are in fact two parts to Google's crawling and indexing of the web.

首先来讨论一下谷歌运作方式。谷歌爬取收录网站可以分为两部分:


The first part, the crawler known as Google bot is the part of the infrastructure that follows every link it can find on the web to uncover every URL on your website and on every other website on the web. The Google bot crawler can't render JavaScript. It's simply visits a page. It will do a very quick pass of any HTML that it finds on the page to see if there are any other links it can follow, but otherwise, it simply passes the URLs that it does find back to the indexer.

第一部分,被称为Googlebot的爬虫,是搜索引擎基础结构的一部分,它通过页面上的链接,去发现更多的页面。Google bot爬虫无法渲染JavaScript。它只是访问页面。爬虫会快速查找HTML页面上的链接,继续抓取新的页面,没有新页面就会将爬取到的链接返回谷歌索引(indexer)。

 

The indexer is the part of Google's infrastructure that completely renders a page of all the content, all of the CSS, all of the layout to try in the content, to try and understand what that page is about. So that when someone does a query, it can return that page if it is relevant. Now the indexer can render JavaScript.

索引是Google搜索引擎基础结构的一部分,它负责渲染页面的所有内容,CSS,布局以了解该页面的核心信息。当用户在搜索引擎搜索时,才能返回客户搜索相关的页面。Indexer可以渲染JavaScript。


So it is true to say that Google can render JavaScript-powered web pages.

因此,谷歌支持渲染基于JavaScript开发的网页。

 

But to completely understand the implications of using JavaScript, it is also important to understand the difference between client-side and server-side rendering of JavaScript, because that makes a big difference to the way that Google will interpret your website.

但是要完全了解使用JavaScript对网站的影响,理解客户端和服务器端JavaScript渲染的区别也很重要,因为会导致Google读取网站的方式有很大的不同。


So generally speaking, these modern JavaScript frameworks like React, Node, and Ember, and Angular, they render in the client side. That means that when someone visits your web page that's built on one of these frameworks, the JavaScript application is delivered to the browser and then it renders everything in the browser. It calls the CSS, it calls the content, it calls the images, and any other resources required to lay out your web page into the browser and renders them on the client side.

因此,一般而言,这些现代JavaScript框架(例如React,Node和Ember和Angular)在客户端渲染。这意味着,当用户访问基于这些框架之一开发的网页时,JavaScript应用程序将交付给浏览器,然后在浏览器渲染所有内容。将CSS,文本,图片以及其他与页面展示有关的资源推送到浏览器,在客户端渲染。


A server side rendering is when all of that work is done on the server and the HTML of the complete page and all of the content is delivered to the browser.

服务器端渲染是指在服务器端完成所有渲染工作并将完整页面的HTML和所有内容都交付给浏览器。

 

Now this has big implications for Google because as we said, the Google bot can't render JavaScript. So that means that when Google bot visits your home page or your JavaScript-powered website, if you're rendering client side, it means that the Google bot will get that JavaScript application, but it can't render any content or any link. So it won't find any other links to crawl. It will have to send that single URL back to the indexer. The indexer will then render that page it will find any links and content on that page. It will send any links back to the crawler so that they can then continue to follow those you URLs to see if they can find any other links.

这就对Google收录网站产生了重大影响,因为前面所说,Google bot无法渲染JavaScript。因此,这意味着当Googlebot访问您的主页或基于JavaScript的网站时,如果网站是客户端渲染,则意味着Googlebot将获取该JavaScript应用程序,但无法渲染任何内容或任何链接。因此Google bot无法找到页面上的链接。只会返回一个URL给谷歌indexer。谷歌Indexer将渲染页面并发现页面上的更多链接和内容。发现新的链接则会返回给Google bot去继续抓取进一步发现更多的链接。


And in this way, it really slows down the process of crawling your website in a very big way.
And this is particularly relevant for large websites. So the other thing that I have to say about client-side rendering is that Google's indexer uses a version of Chrome for rendering JavaScript-powered websites that is about three years old.

这就极大地减慢了网站被谷歌抓取的速度,这对于大型网站影响尤为重大。另外,关于客户端渲染,Google的indexer用来来渲染JavaScript网站所使用的Chrome版本已有大约三年的历史。

 

And that means that it can't support all the latest features of these modern JavaScript frameworks. So if you're building a JavaScript-powered website that renders on the client side, it is very important that you ensure that it is set up in such a way that it degrades nicely for older versions of browsers so that Google can render your content and your HTML completely.

这意味着它不能支持那些现代JavaScript框架的所有最新功能。因此,如果您要构建一个以JavaScript为基础的网站,并在客户端进行渲染,那么确保Google可以完全渲染您的内容和HTML。


I've seen many cases where a client-side rendered JavaScript page, Google is able to crawl or index part of it but it doesn't see all of the continent because of some of the features that have been included in that page. So very important that your JavaScript-powered web page degrades nicely for all the versions of the browser.

我看过很多客户端渲染的JavaScript页面,Google能够对其进行抓取和编制索引,但是页面中包含的某些功能谷歌无法完整抓取。因此要确保你基于JavaScript开发网页对于所有版本的浏览器都可以很好地渲染。

 

So we know that Google bot can't render JavaScript. And whilst the Google indexer can render JavaScript, we also know that it is limited to older versions of Chrome. So it doesn't support all the latest features of these modern JavaScript frameworks. So if we are doing client-side rendering, it is more difficult to get all of our content indexed and it really does slow down the entire process of crawling and indexing your website, which includes any changes you make. So if you make changes to your website, particularly if you have a large website, it can take weeks or months for those changes to be reflected in the Google index.

我们知道Google bot无法渲染JavaScript。Google indexer可以呈现JavaScript,但我们也知道它仅限于旧版Chrome。因此,它不支持这些现代JavaScript框架的所有最新功能。因此,如果在进行客户端渲染,则很难对所有的内容建立索引,这确实会减慢对网站被抓取和索引的整个过程,其中包括您所做的任何更改。因此,如果您对网站进行更改,尤其大型网站,则这些更改可能需要数周或数月才能反映在Google索引中。

 

So what to do? Well, our strong recommendation is to use old-fashioned content management systems for public facing web sites, first and foremost. If you haven't yet started the build of your website, then we would strongly recommend you look at one of the content management systems like Ambraco, or Wordpress, or Drupal. Or if you're doing e-commerce, use one of the platforms like Shopify, or BigCommerce.

那么该怎么办?我们强烈建议普通网站使用老式的内容管理系统。如果您还没有开始网站的搭建,那么我们强烈建议您考虑内容管理系统,例如Ambraco,Wordpress或Drupal。如果是电商网站,可以考虑用Shopify, BigCommerce电商建站系统。

 

These content management applications render everything on the server side and deliver the complete HTML to the browser and to Google, which makes it much easier and faster for Google to completely crawl and index your website.

这些内容管理应用程序在服务器端呈现所有内容,并向浏览器和Google提供完整的HTML,这使Google能够更轻松,更快地完全抓取您的网站并为其建立索引。

 

If you have already built a JavaScript-powered website, or if you really want to for whatever reason, then our drawing recommendation is to configure that application to render everything on the server side and deliver the complete HTML and content to the browser and to Google in the same way that one of these older traditional content management systems does. If you can do that properly, then it will make it a lot easier and faster for Google to index your JavaScript-powered website.

如果您已经建立了JavaScript网站,或者出于特殊原因确实想要这样做,那么我们的建议是配置该应用程序在服务器端渲染所有内容,并将完整的HTML和内容提供给浏览器和Google 就像这些较旧的传统内容管理系统之一一样。这对于谷歌快速抓取收录你的JavaScript网站会有很大帮助。

 

Perhaps, you've already launched a JavaScript-powered website that is rendering everything on the client side. You're not sure how to configure it to do that on the server side. There are third party services like Prerender.io, which might help. They might be worth looking at as well.

又或许,您已经发布了一个在客户端渲染的基于JavaScript开发的网站,不知道如何改为在服务器端渲染。有一些第三方服务获取可以帮你解决这个问题,比如Prerender.io。可以了解一下。

 

So in a nutshell, a lot of SEO is about making it easy for Google and not putting hurdles in Google's way. And when it comes to using JavaScript on your website, there are quite a few pitfalls and traps that if you're not aware of them, it's easy to fall into.

简而言之,很多SEO都是为了帮助Google而不是阻碍Google抓取网站。在您的网站上使用JavaScript时,会有很多陷阱,稍不小心就掉入。


免责声明
本文链接:
本文经作者许可发布在AMZ123跨境头条,如有疑问,请联系客服。
最新热门报告作者标签
英国3月电商销售额同比增长10.6%,节日带动市场回暖
AMZ123获悉,近日,根据NielsenIQ发布的最新数据,截至2026年3月21日的过去四周,英国主要超市的总销售额同比增长4.3%,高于2月份的3.3%。这一增长主要受到母亲节提前两周以及消费者提前进行复活节采购的推动,带动整体消费回暖。在截至3月14日、母亲节前一周,英国迎来短暂的温暖春季天气,消费者在这一阶段集中购买礼品,促进了短期销售增长,英国主要超市销售额同比增长9.3%,额外带来1700万英镑的消费支出。从消费行为来看,到店购物频次已连续第二个月下降,同比减少1.1%。与此同时,线上渠道持续成为增长最快的板块,电商销售额同比增长10.6%,市场份额提升至13.9%。节日因素也带动多个品类销售增长。
Tokopedia与TikTok Shop印尼斋月交易量暴涨15倍
AMZ123获悉,近日,Tokopedia与TikTok Shop联合开展的“Ramadan Extra Exciting 2026”活动显示,在伊斯兰教斋月期间,每天天亮前吃sahur(封斋前用餐)的时间段里,平台交易量同比激增15倍。TikTok表示,这一增长主要受到TikTok内容生态的带动,尤其是直播带来的流量转化。在整个斋月期间,共有38亿人次观看了来自卖家及带货创作者的直播内容。从品类表现来看,穆斯林服装成为增长最快的核心品类之一。在TikTok Shop上,该品类交易量较平日增长3倍;与此同时,Tokopedia在斋月大促首日的第一个小时,整体交易量较去年同期活动同样实现3倍增长。
因产品数据质量不佳,印度电商每年损失五百亿卢比
AMZ123获悉,近日,据外媒报道,印度电商与快消行业正因产品数据质量不佳而蒙受巨额损失。据GS1印度公司的最新研究,不一致、不完整或不准确的产品信息每年导致约500亿卢比的资金流失。其中,约200亿卢比表现为毛利率下降,原因包括转化率降低、商品上架受限以及销售速度放缓;另有190亿卢比直接用于退货相关成本,涵盖逆向物流、处理与加工等环节。尤其在时尚服装领域,退货问题更为突出。因尺码不合、款式偏好或实物与描述不符,顾客主动退货率通常占总订单的20%至25%。Unicommerce指出,逆向物流会使订单价值额外增加5%至7%,而这还不含原始运费。放眼全球,时尚与鞋类退货率甚至可达30%至40%。
存火灾风险!美国CPSC紧急召回八款插头延长线
AMZ123获悉,近日,美国消费者产品安全委员会(CPSC)发布紧急召回警告,要求消费者立即停止使用“插头延长线”,并已与沃尔玛、eBay和AliExpress等电商平台达成协议,下架相关危险商品。CPSC指出,这类延长线两端均为公头插头,插入电源后裸露插脚可能带电,存在严重触电和火灾风险,因此在任何情况下都不应使用。为防止危险商品继续流入市场,CPSC已推动相关电商平台删除商品链接,同时平台方面承诺将主动识别并下架类似产品。根据CPSC的公告,多家来自中国的卖家和企业涉及销售该类产品,但大多数未回应CPSC关于召回或产品信息的要求。
韩国电商竞争转向:会员权益与AI成新焦点
AMZ123获悉,近日,据外媒报道,随着配送速度不再是唯一竞争壁垒,韩国电商平台正集体转向会员权益、免运费门槛和人工智能体验的比拼。业内人士认为,当行业整体配送能力趋于均衡,消费者能否获得实实在在的优惠和便捷的购物体验,才是决定复购的关键。近期,在会员权益方面,多家平台密集推出新举措。Gmarket将于4月23日推出名为“Kkok”的积分制会员计划,会员根据累计消费金额最高可获5%的“Smile Cash”平台积分;若当月积分低于2900韩元的月费,次月平台会自动补足差额。
万事达卡在拉美完成首批AI代理支付交易
Fin123获悉,近日,万事达卡(Mastercard)宣布,已在拉丁美洲和加勒比地区完成多笔由AI代理发起的真实支付交易,标志着“代理式支付”(agentic payments)从概念阶段进入实际应用阶段。这些交易在受控环境中通过万事达卡Agent Pay基础设施完成,全部基于现有银行卡支付网络执行,且均获得持卡人授权,覆盖从商品搜索到支付完成的全流程。
824个品牌中招?疑WOOT封号名单曝光
AMZ123在此前文章中提到,自3月初起,业内陆续有卖家反映收到亚马逊扫号邮件,而这轮扫号的矛头,大多都指向“WOOT刷单”。随后,卖家圈接连传出小号被封、主账号受牵连、资金被冻结等消息。到了4月,这场风波仍未平息,反而有越查越深的迹象。风声渐紧之下,卖家圈最关心的话题也随之变了——这次到底扫到了谁?就在这样的追问声中,AMZ123了解到,一份疑似与此次WOOT封号潮相关的品牌名单,近日开始在卖家圈流传。从目前流出的截图来看,这份名单共列出824个品牌,PUKAOCK、KUKALY、ITSNGBY、TAOOLP、MYTHSIGHT、HOOROLA、DR.FRESH、CYBERBLAZE等多个品牌名均在其中。
靠“穿搭”火遍全网,有线耳机在TikTok Shop销量暴涨
重回“顶流”,这个千禧年“赛博配饰”在TikTok爆火
百亿营收难掩利润“雪崩”,傲基怎么了
在新一轮的财报季中,这位头顶“百亿大卖”、“华南城四少之一”两大光环的跨境大卖,交出了一份“冰火两重天”的成绩单。AMZ123获悉,3月27日,傲基股份发布了2025年业绩公告。报告期内,傲基实现营业收入136.99亿元,同比增长27.9%,继2024年突破百亿营收后再度创下新高。在宏观经济承压、市场充满不确定性的背景下,这无疑是一份亮眼的营收答卷。从业务结构来看,支撑傲基维持百亿营收的,仍是来自商品销售板块的持续增长。财报显示,傲基商品销售全年实现收入95.82亿元,同比增长15.9%,占总收入的69.9%。
亚马逊告别运通,联手美国银行和万事达推出新卡
AMZ123获悉,据外媒报道,3月31日,亚马逊宣布,将终止与美国运通在小企业信用卡领域的八年合作,转而联合美国银行和万事达卡推出两款全新的商务信用卡。新产品计划于今年春季上线,8月14日正式完成过渡。此次推出的两款信用卡分别为“Prime商务卡”和“亚马逊商务卡”,均由美国银行发行,属于万事达网络体系,均不收取年费。Prime会员使用前者在亚马逊购物可获得5%返现,后者则为非Prime会员提供3%返现。两类卡片在亚马逊以外的消费场景同样可获得奖励,并配有灵活的信用条款。更多权益细节预计在未来几个月内陆续公布。亚马逊方面表示,此次调整旨在回应小企业客户对奖励获取能力和现金流管理工具的需求。
印尼Q1快消品电商销售超400万亿印尼盾,Tokopedia增长最快
AMZ123获悉,近日,根据Compas.co.id最新发布的报告,2026年第一季度印尼快速消费品(FMCG)电商销售额创下新高,总额超过400万亿印尼盾,高于2025年第四季度的396万亿印尼盾。报告显示,美妆类依然是销售主力,季度销售额达到186万亿印尼盾,同比增长33%。食品饮料(F&B)类受益于斋月与开斋节消费热潮,实现103万亿印尼盾的销售额,同比激增88%,成为增长最快的核心品类之一。家居清洁用品类表现亮眼,销售额达到20万亿印尼盾,同比大幅增长96%,其中包括纸巾、杀虫剂及家用清洁用品等深受消费者欢迎的商品。
Stripe与Meta合作,FB广告可完成一键结账
Fin123获悉,近日,Stripe宣布,为Facebook广告商推出全新结账体验,使消费者无需离开应用即可完成购买。通过这项功能,使用Stripe的卖家可以将Facebook广告与支付系统直接连接,买家点击广告中的“立即购买”按钮后,可使用Meta钱包中保存的支付凭证完成一键结账。该流程基于《智能体商务协议》,未来将扩展到包括Instagram广告在内的更多Meta平台。卖家可在Stripe管理平台中通过开关选择启用此功能,并关联其Meta广告账户。启用后,购买过程将完全嵌入广告体验,消除了用户在传统跳转浏览器或应用完成交易时的中断,从而提升购买转化率。
男装区跑出黑马!TikTok一条“万能5分裤”卖了近150万
根据fortunebusinessinsights,2026年,全球男装市场规模约为7234亿美元,预计到2034年将增至1.24万亿美元,预测期内年复合增长率为6.92%。愈发多元的男士着装需求,拉动市场规模一路狂飙,在TikTok美区一款表面看起来平平无奇的男士裤衩,7天时间销量环比暴涨了12573.85%,成为类目的绝对黑马。01TikTok男士裤衩,销量暴走TT123观察到,3.23-29期间,在TikTok美区运动与户外类目,一款男士5分裤的周销量环比跳涨了120倍,在售价相差无几的情况下,销售额已反超类目“资深”的爆款女装。
824个品牌中招?疑WOOT封号名单曝光
AMZ123在此前文章中提到,自3月初起,业内陆续有卖家反映收到亚马逊扫号邮件,而这轮扫号的矛头,大多都指向“WOOT刷单”。随后,卖家圈接连传出小号被封、主账号受牵连、资金被冻结等消息。到了4月,这场风波仍未平息,反而有越查越深的迹象。风声渐紧之下,卖家圈最关心的话题也随之变了——这次到底扫到了谁?就在这样的追问声中,AMZ123了解到,一份疑似与此次WOOT封号潮相关的品牌名单,近日开始在卖家圈流传。从目前流出的截图来看,这份名单共列出824个品牌,PUKAOCK、KUKALY、ITSNGBY、TAOOLP、MYTHSIGHT、HOOROLA、DR.FRESH、CYBERBLAZE等多个品牌名均在其中。
复活节消费成本将上涨4.42%,购物行为发生分化
AMZ123获悉,随着2026年复活节的临近,欧洲市场呈现出消费成本上升与物流需求激增并行的态势,购物行为也发生分化。根据ASM SFA发布的《2026年购物篮报告》,波兰市场复活节期间30种常用节日食材的平均价格为209.43波兰兹罗提,较上年同期上涨4.42%。尽管通胀趋于稳定,但基本商品价格仍处于高位,节日期间消费者对价格变动感受尤为明显。报告显示,不同零售渠道之间的价格差异显著。在12家接受调查的主要连锁超市中,最便宜与最贵的复活节购物篮价格相差近19%。其中,欧尚超市以184.93波兰兹罗提的均价成为价格最优选择,麦德龙现购自运和迪诺超市分别以194.51波兰兹罗提和201.84波兰兹罗提紧随其后。
《TikTok Shop 2025年度报告》PDF下载
2025年,TikTok Shop进一步加快扩张步伐,在巩固欧美成熟市场的同时,积极开拓新兴市场,先后上线德国、意大利、法国、日本等站点。此举不仅为平台带来新增量,也体现出其多元化市场战略的初步成效,以分散地缘政治风险。
《Shopee2025印尼站点X 汽车摩托品类专题》PDF下载
印尼当地汽车保有量并不高,每一千人的机动车保有量仅96人,未来可提升的空间仍大。空间参照系可以看泰国和马来,2024年泰国汽车保有量为322辆/千人,马来西亚为531辆/千人。
《2026年Shopee运动户外类目自行车爆品分享》PDF下载
巴西骑行爱好群体广泛,但平台上热销品呈现出的国际大牌极少,推测可能原因是国际品牌可能主要通过线下经销或自行渠道销售,未深度参与Shopee等本土电商。因此巴西用户在平台上几乎接触不到这些高端品牌产品。平台上巴西用户更倾向购买本土品牌的自行车,可能出于价格实惠和售后便利考虑。
《2025年TikTok生态发展白皮书》PDF下载
2025年,全球内容电商迈入深度跃迁的新周期。TikTokShop正以前所未有的速度拓展市场版图,完成从高速增长向高质量增长的跃迁。在这一进程中,生态结构重构、参与者多元化、全球政策协同等因素叠加,构成内容电商演进的核心变量。
《2026美妆健康与保健创新报告》PDF下载
每年,我们都会分析美妆与个护以及健康与家居类目的动态变化。但2026 年呈现了一个意外的新现象:这两个类目不再孤立运营。美妆和健康正与食品杂货融合,形成由配方创新、成分病毒式传播和消费者行为演变所驱动的强大三方生态系统。
《中国宠物食品行业出海国别机会洞察报告》PDF下载
本报告旨在深入分析中国宠物食品的全球出口机遇与国别差异,通过对行业发展现状、出口趋势及各国政策环境的研究,揭示中国宠物食品企业在国际市场中的竞争优势与面临的潜在挑战。
《市场洞察:2025中国汽车出海英国市场动态追踪》PDF下载
根据英国汽车制造商与贸易商协会数据显示,2025年1-9月中国汽车出海英国累计销量142,684辆,同比增长91%,远超英国整体市场4.2%增速。中国汽车出海英国市场份额从年初5%升至9月12.4%,成为英国第二大汽车来源国,仅次于德国。
《2026取暖电器行业简析报告》PDF下载
系统梳理了行业发展脉络、市场格局与未来趋势。取暖电器按能源类型与产品形态可分为电取暖、燃气取暖、辅助本报告为 2026 年中国取暖电器行业专业简析,集成类三大核心品类,行业发展历经萌芽起步、快速成长、加速升级、高质量发展四大阶段,完成了从单一功能向智能化、节能化、场景化的全面演进。
跨境电商赢商荟
跨境电商行业唯一一家一年365天不断更的媒体!
亚马逊公告
AMZ123旗下亚马逊公告发布平台,实时更新亚马逊最新公告,致力打造最及时和有态度的亚马逊公告栏目!
跨境平台资讯
AMZ123旗下跨境电商平台新闻栏目,专注全球跨境电商平台热点事件,为广大卖家提供跨境电商平台最新动态、最热新闻。
北美电商资讯
AMZ123旗下北美跨境电商新闻栏目,专注北美跨境电商热点资讯,为广大卖家提供北美跨境电商最新动态、最热新闻。
亿邦动力网
消除一切电商知识鸿沟,每日发布独家重磅新闻。
跨境科普达人
科普各种跨境小知识,科普那些你不知道的事...
AMZ123会员
「AMZ123会员」为出海者推出的一站式私享服务
AMZ123跨境电商
专注跨境行业热点事件报道,每日坚持推送原创深度热文
首页
跨境头条
文章详情
JavaScript SEO怎么做
CrossBorder
2020-08-06 18:10
1957

Hi. I’m Charles from Cross Border Digital. Are you using JavaScript to build your website? Or maybe you're thinking about using one of the modern JavaScript frameworks like Ember,or Node, or React, or Angular. Great frameworks for building very app-like interfaces on the web.

大家好,我是来自Cross Border Digital的Charles. 你是否在用JavaScript建站?或者你正在考虑用使用当前比较流行的JavaScript框架:Ember、Node、React 或者是Angular建站。这些都是非常优秀的框架,给网站访客提供类似App的操作体验。


But there are some specific challenges to using these JavaScript frameworks when it comes to SEO. Today, I want to share some insights and advice to help you use these frameworks in a way that will work with Google and ensure that you can rank your website.

但是,当涉及到SEO时,使用这些JavaScript框架存在一些特定的挑战。今天,我想分享一些见解和建议,以帮助您以与Google兼容的方式使用这些框架,确保网站在搜索引擎可以获得排名。


So when it comes to understanding the implications of using JavaScript to build your website, there's really two key things that we need to talk about.

因此,在理解使用JavaScript开发网站的意味着什么时,实际上需要讨论两个关键问题。


The first is how Google actually works, how they treat JavaScript, how they understand JavaScript.

首先是Google的实际工作方式,如何对待JavaScript,如何理解JavaScript。


And the second is understanding the difference between client-side and server-side rendering of the content and HTML on your website.

其次是了解网站上内容和HTML在客户端和服务器端渲染的区别。


These two things together if we can understand these, then we can understand how Google is going to interpret our JavaScript-powered website.

如果我们能理解这两点,那么就能了解Google如何读取JavaScript网站。


OK, so let's first talk about Google. There are in fact two parts to Google's crawling and indexing of the web.

首先来讨论一下谷歌运作方式。谷歌爬取收录网站可以分为两部分:


The first part, the crawler known as Google bot is the part of the infrastructure that follows every link it can find on the web to uncover every URL on your website and on every other website on the web. The Google bot crawler can't render JavaScript. It's simply visits a page. It will do a very quick pass of any HTML that it finds on the page to see if there are any other links it can follow, but otherwise, it simply passes the URLs that it does find back to the indexer.

第一部分,被称为Googlebot的爬虫,是搜索引擎基础结构的一部分,它通过页面上的链接,去发现更多的页面。Google bot爬虫无法渲染JavaScript。它只是访问页面。爬虫会快速查找HTML页面上的链接,继续抓取新的页面,没有新页面就会将爬取到的链接返回谷歌索引(indexer)。

 

The indexer is the part of Google's infrastructure that completely renders a page of all the content, all of the CSS, all of the layout to try in the content, to try and understand what that page is about. So that when someone does a query, it can return that page if it is relevant. Now the indexer can render JavaScript.

索引是Google搜索引擎基础结构的一部分,它负责渲染页面的所有内容,CSS,布局以了解该页面的核心信息。当用户在搜索引擎搜索时,才能返回客户搜索相关的页面。Indexer可以渲染JavaScript。


So it is true to say that Google can render JavaScript-powered web pages.

因此,谷歌支持渲染基于JavaScript开发的网页。

 

But to completely understand the implications of using JavaScript, it is also important to understand the difference between client-side and server-side rendering of JavaScript, because that makes a big difference to the way that Google will interpret your website.

但是要完全了解使用JavaScript对网站的影响,理解客户端和服务器端JavaScript渲染的区别也很重要,因为会导致Google读取网站的方式有很大的不同。


So generally speaking, these modern JavaScript frameworks like React, Node, and Ember, and Angular, they render in the client side. That means that when someone visits your web page that's built on one of these frameworks, the JavaScript application is delivered to the browser and then it renders everything in the browser. It calls the CSS, it calls the content, it calls the images, and any other resources required to lay out your web page into the browser and renders them on the client side.

因此,一般而言,这些现代JavaScript框架(例如React,Node和Ember和Angular)在客户端渲染。这意味着,当用户访问基于这些框架之一开发的网页时,JavaScript应用程序将交付给浏览器,然后在浏览器渲染所有内容。将CSS,文本,图片以及其他与页面展示有关的资源推送到浏览器,在客户端渲染。


A server side rendering is when all of that work is done on the server and the HTML of the complete page and all of the content is delivered to the browser.

服务器端渲染是指在服务器端完成所有渲染工作并将完整页面的HTML和所有内容都交付给浏览器。

 

Now this has big implications for Google because as we said, the Google bot can't render JavaScript. So that means that when Google bot visits your home page or your JavaScript-powered website, if you're rendering client side, it means that the Google bot will get that JavaScript application, but it can't render any content or any link. So it won't find any other links to crawl. It will have to send that single URL back to the indexer. The indexer will then render that page it will find any links and content on that page. It will send any links back to the crawler so that they can then continue to follow those you URLs to see if they can find any other links.

这就对Google收录网站产生了重大影响,因为前面所说,Google bot无法渲染JavaScript。因此,这意味着当Googlebot访问您的主页或基于JavaScript的网站时,如果网站是客户端渲染,则意味着Googlebot将获取该JavaScript应用程序,但无法渲染任何内容或任何链接。因此Google bot无法找到页面上的链接。只会返回一个URL给谷歌indexer。谷歌Indexer将渲染页面并发现页面上的更多链接和内容。发现新的链接则会返回给Google bot去继续抓取进一步发现更多的链接。


And in this way, it really slows down the process of crawling your website in a very big way.
And this is particularly relevant for large websites. So the other thing that I have to say about client-side rendering is that Google's indexer uses a version of Chrome for rendering JavaScript-powered websites that is about three years old.

这就极大地减慢了网站被谷歌抓取的速度,这对于大型网站影响尤为重大。另外,关于客户端渲染,Google的indexer用来来渲染JavaScript网站所使用的Chrome版本已有大约三年的历史。

 

And that means that it can't support all the latest features of these modern JavaScript frameworks. So if you're building a JavaScript-powered website that renders on the client side, it is very important that you ensure that it is set up in such a way that it degrades nicely for older versions of browsers so that Google can render your content and your HTML completely.

这意味着它不能支持那些现代JavaScript框架的所有最新功能。因此,如果您要构建一个以JavaScript为基础的网站,并在客户端进行渲染,那么确保Google可以完全渲染您的内容和HTML。


I've seen many cases where a client-side rendered JavaScript page, Google is able to crawl or index part of it but it doesn't see all of the continent because of some of the features that have been included in that page. So very important that your JavaScript-powered web page degrades nicely for all the versions of the browser.

我看过很多客户端渲染的JavaScript页面,Google能够对其进行抓取和编制索引,但是页面中包含的某些功能谷歌无法完整抓取。因此要确保你基于JavaScript开发网页对于所有版本的浏览器都可以很好地渲染。

 

So we know that Google bot can't render JavaScript. And whilst the Google indexer can render JavaScript, we also know that it is limited to older versions of Chrome. So it doesn't support all the latest features of these modern JavaScript frameworks. So if we are doing client-side rendering, it is more difficult to get all of our content indexed and it really does slow down the entire process of crawling and indexing your website, which includes any changes you make. So if you make changes to your website, particularly if you have a large website, it can take weeks or months for those changes to be reflected in the Google index.

我们知道Google bot无法渲染JavaScript。Google indexer可以呈现JavaScript,但我们也知道它仅限于旧版Chrome。因此,它不支持这些现代JavaScript框架的所有最新功能。因此,如果在进行客户端渲染,则很难对所有的内容建立索引,这确实会减慢对网站被抓取和索引的整个过程,其中包括您所做的任何更改。因此,如果您对网站进行更改,尤其大型网站,则这些更改可能需要数周或数月才能反映在Google索引中。

 

So what to do? Well, our strong recommendation is to use old-fashioned content management systems for public facing web sites, first and foremost. If you haven't yet started the build of your website, then we would strongly recommend you look at one of the content management systems like Ambraco, or Wordpress, or Drupal. Or if you're doing e-commerce, use one of the platforms like Shopify, or BigCommerce.

那么该怎么办?我们强烈建议普通网站使用老式的内容管理系统。如果您还没有开始网站的搭建,那么我们强烈建议您考虑内容管理系统,例如Ambraco,Wordpress或Drupal。如果是电商网站,可以考虑用Shopify, BigCommerce电商建站系统。

 

These content management applications render everything on the server side and deliver the complete HTML to the browser and to Google, which makes it much easier and faster for Google to completely crawl and index your website.

这些内容管理应用程序在服务器端呈现所有内容,并向浏览器和Google提供完整的HTML,这使Google能够更轻松,更快地完全抓取您的网站并为其建立索引。

 

If you have already built a JavaScript-powered website, or if you really want to for whatever reason, then our drawing recommendation is to configure that application to render everything on the server side and deliver the complete HTML and content to the browser and to Google in the same way that one of these older traditional content management systems does. If you can do that properly, then it will make it a lot easier and faster for Google to index your JavaScript-powered website.

如果您已经建立了JavaScript网站,或者出于特殊原因确实想要这样做,那么我们的建议是配置该应用程序在服务器端渲染所有内容,并将完整的HTML和内容提供给浏览器和Google 就像这些较旧的传统内容管理系统之一一样。这对于谷歌快速抓取收录你的JavaScript网站会有很大帮助。

 

Perhaps, you've already launched a JavaScript-powered website that is rendering everything on the client side. You're not sure how to configure it to do that on the server side. There are third party services like Prerender.io, which might help. They might be worth looking at as well.

又或许,您已经发布了一个在客户端渲染的基于JavaScript开发的网站,不知道如何改为在服务器端渲染。有一些第三方服务获取可以帮你解决这个问题,比如Prerender.io。可以了解一下。

 

So in a nutshell, a lot of SEO is about making it easy for Google and not putting hurdles in Google's way. And when it comes to using JavaScript on your website, there are quite a few pitfalls and traps that if you're not aware of them, it's easy to fall into.

简而言之,很多SEO都是为了帮助Google而不是阻碍Google抓取网站。在您的网站上使用JavaScript时,会有很多陷阱,稍不小心就掉入。


咨询
官方微信群
官方客服

扫码添加,立即咨询

加群
官方微信群
官方微信群

扫码添加,拉你进群

更多
订阅号服务号跨境资讯
二维码

为你推送和解读最前沿、最有料的跨境电商资讯

二维码

90% 亚马逊卖家都在关注的微信公众号

二维码

精选今日跨境电商头条资讯

回顶部