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

JavaScript SEO怎么做

1865
2020-08-06 18:10
2020-08-06 18:10
1865

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跨境头条,如有疑问,请联系客服。
最新热门报告作者标签
26年澳洲情人节支出将达5.5亿澳元,消费意愿下降
AMZ123获悉,近日,根据澳大利亚零售协会(ARC)和Roy Morgan的最新调查,澳大利亚情人节的消费意愿出现明显下降,越来越多消费者在成本压力下减少对非必需品的支出,但参与者的平均支出仍保持稳定。调查显示,成本上涨正在持续影响家庭的可支配支出,许多家庭对非必需开支更加谨慎。今年仅有12%的澳大利亚成年人计划庆祝情人节,约为300万人,比去年下降4个百分点。与去年相比,计划为伴侣购买礼物的人数减少约80万人,主要原因是生活成本压力持续影响可自由支配支出。尽管参与人数下降,但澳大利亚情人节支出预计达到5.5亿澳元,较去年增长2.8%,人均支出约为152澳元。
Seedance2.0刷屏全网,TikTok卖家:红利来了!
字节正式发布Seedance2.0,TikTok卖家已经用上赚钱了!
月销数十万!这10个小众产品爆单亚马逊
AMZ123获悉,近日,亚马逊各类产品搜索量增长显著,以下10款产品在亚马逊上销量表现突出,深受消费者欢迎。1.修复眼罩预计销售额:50万美元/月销量:5000+星级评分:4.3好评数量:8,505+图源:亚马逊产品介绍:该修复眼罩主要是专为眼部抗衰老与焕亮设计,通过缓释视黄醇成分有效减少细纹、改善皮肤饱满度,并针对性缓解黑眼圈与浮肿问题。产品采用融合海藻提取物、神经酰胺及脂肪酸的复合配方,能在夜间修复阶段滋养娇嫩眼周肌肤。适用于熬夜、疲劳或重要场合前的密集护理,亦可作为礼品。品牌介绍:Grace & Stella是一家成立于2016年的品牌,以“创造美好时刻”为核心理念,致力于通过日常护理提升生活品质。
Jumia 25财年营收1.9亿美元,同比增长13%
AMZ123获悉,近日,非洲电商平台Jumia发布了截至2025年12月31日的全年及第四季度财报。Jumia在2025年实现了GMV和收入增长,预计2026年有望保持强劲增长。以下为Q4财务亮点:①营收为6140万美元,同比2024年第四季度的4570万美元增长34%,按固定汇率计算增长24%。②GMV为2.795亿美元,同比2024年第四季度的2.061亿美元增长36%,按固定汇率计算增长23%。剔除南非和突尼斯市场,实物商品GMV同比增长38%。③运营亏损为1060万美元,同比2024年第四季度的1730万美元下降39%,按固定汇率计算下降22%。
血亏500万,跨境“黄金搭档”正式散伙
这两天,跨境圈又冒出一条不太体面的公告。不是封号,不是裁员,而是一场曾被寄予厚望的上市公司级合作,正式宣告失败。1月23日,浙江永强发布公告,确认与跨境大卖傲基股份中止跨境电商合作。双方通过互相转让子公司股权,彻底清空交叉持股关系。一句话概括这段合作的结局:故事很完整,结果很现实。图源网络,侵删01从制造+跨境的理想模版,到体面分手时间回到2023年11月。当时的傲基,已经完成从3C铺货向家居、家具赛道的转型;而浙江永强,作为国内户外家具龙头,正寻找新的增长出口。
暴涨94%!25年TikTok Shop全球GMV达643亿美元
AMZ123获悉,近日,据Momentum的最新报告显示,2025年,美国仍是TikTokShop最大的市场,GMV达到151亿美元,同比增长68%,高于2024年的90亿美元。尽管增速不及2024年爆发式增长,但仍显示出强劲扩张势头,反映出TikTok Shop正在从初期试验阶段向系统化运营阶段过渡。全球范围内,TikTok Shop在16个市场的总GMV达到643亿美元,同比大幅增长94%。其中,东南亚市场依然是主要增长引擎,2025年东南亚地区GMV同比增长一倍,达到456亿美元。马来西亚、印尼和泰国的增长最为突出,其中印尼市场达到131亿美元,成为TikTok Shop全球第二大市场。
新一轮物流危机来袭,大批跨境货物滞留港口!
腊月尾声,年味渐浓,状况频出的物流难题却成为了横亘在卖家面前的一头“年兽”。随着全国主要港口拥堵、陆路运费疯涨的事态持续升温,物流延误焦虑正在跨境电商行业蔓延。AMZ123了解到,春节前夕历来是跨境电商的出货高峰期——在国外不停卖、国内要放假、物流时效长、怕平台断货等多重因素的叠加影响下,大批卖家通常会抢在节前集中把货物发出。但在今年,这一出货高峰期带来的连锁效应格外汹涌。据物流人士透露,2026年2月,上海、宁波、盐田、南沙等主要港口都进入了超负荷运行状态,出现严重爆仓、收箱收紧等情况,导致大量卖家货物堆积在码头,面临甩柜率高企的风险。
巨额年终奖!跨境公司给员工发了200万
每逢年关,跨境打工人们总是格外悲喜交集。喜的是,春节假期、年终奖的发放近在咫尺,终于即将迎来“歇一口气”的休憩时间;悲的是,同样是辛勤奋战一年,有人硕果累累,喜提巨额年终奖,亦有人一无所获,铩羽而归。根据AMZ123此前发起的一项调查,今年约有68%的跨境打工人预计自己拿不到年终奖,32%能拿到年终奖的跨境打工人中,有22%的年终奖折算月薪在1至3个月区间。在一众感慨行业年终奖缩水的讨论中,深圳一家跨境企业发放巨额奖金的消息格外显眼。AMZ123获悉,这两天,#年终奖#、#原来你们真有年终奖啊# 等话题相继登上了热搜。其中,深圳3D打印公司员工最高拿到200万元年终奖的消息被多家媒体争相报道,成为了热议焦点。
亚马逊竞品分析后应该做什么?竞品分析目标确定
对于亚马逊卖家而言,竞品分析不是一次性的调研动作,而是贯穿产品运营全周期的决策依据。完成数据采集与对比后,核心问题转化为:如何基于分析结果锚定精准目标,并落地为可执行的运营动作?本文将从目标锚定与行动拆解两个维度,为卖家提供严谨的操作框架。一、锚定竞品分析的三大核心目标竞品分析的价值,在于从海量数据中提炼可落地的运营方向,需聚焦三大核心目标:量化差距,明确竞争定位通过价格、评论数量、评价等级、品类排名等基础维度,完成自身商品与竞品的量化对标,定位自身在竞争格局中的位置,识别核心优劣势,为后续流量布局与转化优化提供基础依据。
月销百万美金!亚马逊10款高复购+高评分产品推荐
AMZ123获悉,近日,亚马逊各类产品搜索量增长显著,以下10款产品在亚马逊上销量表现突出,深受消费者欢迎。1. 智能戒指预计销售额:819万美元/月销量:32,050+星级评分:4.1好评数量:8,284+图源:亚马逊产品介绍:该智能戒指通过内置传感器持续监测用户的睡眠、活动、心率、体温变化等多项健康数据,并通过手机应用进行整合分析。产品采用全钛金属结构,支持全天候佩戴,具备防水性能和较长续航时间。相比传统可穿戴设备,其无屏幕设计降低了使用干扰,更侧重长期健康数据的连续采集与趋势分析。品牌介绍:Oura 是一家成立于 2013 年的芬兰健康科技公司,以智能戒指作为核心产品,聚焦睡眠与身体恢复管理。
小众清洁神器在TikTok逆袭,20多天卖了近百万!
距离新冠疫情这一公共卫生安全危机过去已经快2年时间,属于那段经历的回忆或许正在远去,但缘起的健康卫生意识,大部分民众保留至今。后口罩时代,民众对清洁的认知不再仅仅停留于“表面功夫”,TikTok上随处可见的卫生科普,敦促着民众深入微观层面处,在狭小缝隙间寻找清洁死角,这一市场需求被不少商机敏感型卖家捕捉,并精准变现。01全美热议的清洁“主理人”近期,TT123发现,一款主打超声波清洁的新品,冲上了TikTok美区家电大类的热销榜。
花费35亿!SHEIN在广东建设物流中心
AMZ123获悉,近日,据媒体报道,SHEIN计划投资约35亿元,在广东建设一个总建筑面积达60万平方米的大型物流中心。该中心由14栋双层建筑组成,预计于2026年上半年建成并投入使用。这一举动标志着SHEIN在其供应链布局策略上的一个显著转变。过往,SHEIN在广东乃至全国的物流设施多依赖于租赁第三方专业仓库。此次SHEIN投建自营的超级物流中心,意在将其打造为一个集商品分拣、包装和出口发运于一体的核心枢纽,旨在显著提升其全球订单的履约效率和供应链控制力。此外,此次物流中心投资,是SHEIN近年来在粤港澳大湾区持续加大投入的一个缩影。
26年英国情人节市场将达21亿英镑,送礼对象发生变化
AMZ123获悉,近日,根据全球礼品电商平台Flowwow发布的数据,英国情人节消费正在发生明显变化。消费者不再只为情侣准备礼物,而是将消费扩展至朋友、自己,甚至宠物。预计今年英国情人节销售额将达21亿英镑,电商平台订单量同比增长27%,客单价上涨68%至143英镑。在商品结构方面,花束仍然占主导地位,占总订单的89%,糖果占6%,气球占2%,显示传统礼品依然是主流,但品类正在逐步多元化。自我赠礼成为增长最快的细分领域。数据显示,英国情人节自我消费同比增长120%。这一趋势与英国整体健康和身心护理市场的扩张相关,该市场预计到2026年将达到410亿英镑。
月销数十万!这10个小众产品爆单亚马逊
AMZ123获悉,近日,亚马逊各类产品搜索量增长显著,以下10款产品在亚马逊上销量表现突出,深受消费者欢迎。1.修复眼罩预计销售额:50万美元/月销量:5000+星级评分:4.3好评数量:8,505+图源:亚马逊产品介绍:该修复眼罩主要是专为眼部抗衰老与焕亮设计,通过缓释视黄醇成分有效减少细纹、改善皮肤饱满度,并针对性缓解黑眼圈与浮肿问题。产品采用融合海藻提取物、神经酰胺及脂肪酸的复合配方,能在夜间修复阶段滋养娇嫩眼周肌肤。适用于熬夜、疲劳或重要场合前的密集护理,亦可作为礼品。品牌介绍:Grace & Stella是一家成立于2016年的品牌,以“创造美好时刻”为核心理念,致力于通过日常护理提升生活品质。
波兰电商市场大变天!Temu用户数超2034万
AMZ123获悉,近日,据外媒报道,波兰电商市场的竞争格局正在经历一场深刻的转变。根据Mediapanel的数据,今年1月,Temu在波兰市场的实际用户数量已达到2034万,同比增长12.6%;而本土老牌电商Allegro用户数仅同比增长2.8%,达到1890万。除此之外,Temu凭借约68.0%的互联网用户覆盖率成为波兰触及面最广的电商平台,而Allegro的电商覆盖率为63.2%。除了Temu之外,还有两家来自中国的电商平台也位列波兰电商用户数排行榜前十。速卖通拥有1016万用户,同比上升2.7%,覆盖率达34%;Shein则拥有839万用户,覆盖率达28.1%。
《中企出海美国季度研究报告》PDF下载
近年来,随着全球化进程的深化与中国经济实力的持续提升,越来越多的中国企业将目光投向海外市场。美国作为全球最大经济体创新高地和消费市场,始终是中企出海战略中的关键目标。从制造业到科技领域,从消费品到金融服务,中国企业的国际化步伐不断加快,既彰显了“中国智造”的全球竞争力,也面临复杂的政策环境、文化差异与市场竞争等挑战。
《跨境蓝海拉美市场洞察 - 墨西哥篇》PDF下载
墨西哥位于北美大陆南部,北邻美国,政局稳定,法律健全,是拉丁美洲地区第一贸易大国和重要的外国直接投资目的地。墨西哥拥有 1.28亿人口,是仅次于巴西的拉美第二大经济体,同时也是拉美第三大线上零售市场,无论是互联网的普及率还是使用率在拉美市场都处于佼佼者。
《东南亚出海合规实操指南手册》PDF下载
近年来,东南亚电商市场以迅猛的增长态势成为全球贸易的新蓝海,印尼马来西亚、新加坡等六国凭借庞大的人口基数、持续提升的互联网渗透率吸引着无数中国卖家前来布局。
《2025中国新能源汽车产业链出海洞察报告 - 匈牙利篇》PDF下载
中国汽车市场新能源汽车渗透率已达50%,各主机厂纷纷开启价格战,让利消费者,并承担相应的利润损失,在中国新能源汽车市场逐渐成为红海的的大背景下,海逐渐成为各主机厂主动或被动的选择。
《2024哥伦比亚电商市场概览报告》PDF下载
哥伦比亚位于南美洲西北部,是拉丁美洲第三大国家,北部是加勒比海,东部与委内瑞拉接壤,东南方是巴西,南方是秘鲁和厄瓜多尔,西部是巴拿马和太平洋。

《2026独立站卖家日历》PDF下载
2026 独立站卖家日历 2026 全年营销节奏
《2025中东北非消费者数字经济报告》PDF下载
2025年的报告不仅持续跟踪数字经济的同比增长,也更深入:我们探讨了新兴技术对下一波数字化转型的影响力,还首次将中东北非国家及地区的消费者行为偏好与全球其他市场进行对比。
《2025年终大促旺季AI消费趋势报告》PDF下载
随着人工智能 AI的爆发式增长,如 ChatGPT、Perplexity 和Llama等交互式聊天机器人正在渐渐成为大众研究和推荐的首选工具。根据 AI智能体功能的更新迭代,目前已经可以完成网购下单、预订服务、及交易支付,现已被统称为 AI智能体电商Agentic Commerce,且其采用率正呈现出滚雪球式的增长。
跨境科普达人
科普各种跨境小知识,科普那些你不知道的事...
跨境平台资讯
AMZ123旗下跨境电商平台新闻栏目,专注全球跨境电商平台热点事件,为广大卖家提供跨境电商平台最新动态、最热新闻。
亚马逊公告
AMZ123旗下亚马逊公告发布平台,实时更新亚马逊最新公告,致力打造最及时和有态度的亚马逊公告栏目!
侃侃跨境那些事儿
不侃废话,挣钱要紧!
北美电商资讯
AMZ123旗下北美跨境电商新闻栏目,专注北美跨境电商热点资讯,为广大卖家提供北美跨境电商最新动态、最热新闻。
跨境学院
跨境电商大小事,尽在跨境学院。
跨境电商赢商荟
跨境电商行业唯一一家一年365天不断更的媒体!
亿邦动力网
消除一切电商知识鸿沟,每日发布独家重磅新闻。
首页
跨境头条
文章详情
JavaScript SEO怎么做
CrossBorder
2020-08-06 18:10
1865

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% 亚马逊卖家都在关注的微信公众号

二维码

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

回顶部