WordPress教程:3种方式将Google Analytics添加到WordPress网站
· 2022-12-14

Wordress教程:3种方式将Google Analytics添加到WordPress网站


Google Analytics是Google为网站提供的数据统计服务,它可以对网站进行访问数据统计和分析,也能监测和分析网站的流量、用户行为和目标转化数据,为网站使用者提供多种参数。


但很多Wordpress用户很难将Google Analytics添加到网站中,今天将为大家介绍3种常见的方式,可让大家将GA添加到网站当中。


使用Google Analytics WordPress插件


Wordpress有众多插件可以将Google Analytics添加到网站中,这也是最为简单的一种方式,这种方式就可以避免使用编辑网站代码下面这种常见是我常用的,大家可以借鉴使用:


Google Site Kit


Google也为网站使用者提供了一个简单又强大的插件:Google Site Kit。这款插件是专为WordPress设计的官方Google插件,它汇集了一系列Google工具来管理和优化网站


除了分析之外,它还能从Google提供的其他服务中提取数据,如Google Search Console、Google Adsense和PageSpeed insights。


以下是它的安装步骤:


第一步:安装并激活Site kit by Google插件,然后点击“下一步”按钮


第二步:安装完成之后,就需要将Wordpress网站连接到Analytics账户上。


第三部:完成验证,在成功链接之前需要通过几个步骤来验证你是网站的所有者,并同意Google访问其数据的权限,并设置好你想要添加到Wordpress网站中的功能。


Google Analytic成功添加到网站后,你可以在Wordpress的数据概览中看到来自Google Analytics的数据。


利用代码手动链接Google Analytics和Wordpress


如果你不想使用WordPress插件,又懂得代码,那么你可以通过Functions.php文件将Google Analytics跟踪代码直接添加到Wordpress网站上。


但要注意,采用这样的方式是要使用子主题的,这样每次更新wordPress主题时,跟踪代码都不会被覆盖。且当你启动了子主题后,需要在header.php文件中结束标记之前粘贴当Google Analytics跟踪代码。


如果你要查到Google Analytics跟踪代码,那么就需要到你到账号中访问跟踪信息,并在Google Site Tag中复制如下代码。然后将这串代码加入到Wordpress站点中,这串代码将会跟踪信息从你到网站发送到Google Analytics上。


借助谷歌代码管理器(Google Tag Manager)


第三种方式就利用Google Tag Manager,也就是谷歌代码管理器。这种方式的适用范围最广,并不局限于分析。


谷歌代码管理器是一个标签管理系统,你通过它能快速地更新网站或移动应用程序上的标签和代码片段,如流量分析和营销优化的标签和代码片段。


安装谷歌代码管理器也可以借助Wordpress插件,你在wordpress存储库下载Google标签管理插件,或在Wordpress仪表板中的插件-添加新项中搜索,并注册使用。


完成上述步骤之后,即可在谷歌代码管理器中复制你的账号ID,并在“管理”的选项栏中找到以“GTM”开头的字符。


然后返回到Wordpress站点并将刚刚复制的Id粘贴到插件设置页面的相关字段中。


当你完成上述步骤后,即可将Google Analytics安装到你的网站中。


Google Analyitics是一个非常实用的工具,详细的数据能让深入了解网站,并在很大程度上改善网站的状态。能让你了解清楚知道你的访问者是谁,他们喜欢什么,方便你可以根据他们的喜好而制定相应的内容。


Popular articles
Gaming & Technology Expo Makes a Powerful Entrance in CDMX
Marketing
Vietnam's tightening online gaming policy creates new market opportunities
Southeast Asia
Indiana online casino bill stalls in House committee
Regulation
Full House at GAT Expo Cartagena 2026 Academic Agenda
Online Game
Institutional Academy that exceeded expectations marked the opening of GAT CDMX
Online Game
GAT CDMX 2025 Institutional Academy: Leaders and Experts Analyze the Present and Future of the Gaming Industry in Mexico and Lat
Sports Game
1spin4win grows its Latin American presence by partnering with Fortuna Juegos
Online Game
B2B Tech Infrastructure Gains Momentum in Philippine Gaming Sector
Southeast Asia
GGC Awards 2026 Shines in Colombo: Honoring Leaders and Innovators in the iGaming Industry
HUIDU Focus
UK MPs reopen 2025 gambling inquiry as reform stalls
Regulation
Kazakhstan plans to penalise online casino promotions
Regulation
Vietnam’s Controlled Gaming Shift Gains Ground, But Domestic Demand Still Lags
Southeast Asia
Online gambling, crypto pose ongoing money laundering risks in Philippines, analyst says
Southeast Asia
British gambling levy rates confirmed for each vertical
Regulation
Across 6 Cities: HUIDU Invites You to 8 World Cup Parties Redefining High-Value Social Networking
HUIDU Focus
Home
Game
Cooperation
Find
My