Skip to content
WONGCW 網誌
  • 首頁
  • 論壇
  • 微博
  • 壁紙下載
  • 免費圖床
  • 視頻下載
  • 聊天室
  • SEO工具
  • 支援中心
  • 表格製作
  • More
    • 在線名片
    • 網頁搜索
    • 天氣預報
    • 二維碼生成器
    • WordPress 插件及主題下載
  • Search Icon

WONGCW 網誌

記錄生活經驗與點滴

How to Add Google Analytics to WordPress Without a Plugin

How to Add Google Analytics to WordPress Without a Plugin

2018-10-02 Comments 0 Comment

Looking for a way to add Google Analytics to your WordPress website without a plugin? Adding Google Analytics to your site helps you track your website traffic and gives valuable insights about your visitors. Let’s take a look at how to add Analytics tracking code to your site without a plugin.

Is It Best to Add Google Analytics With or Without a Plugin?

You might think that the fewer plugins you use on your site the better, but that’s not always necessarily true.

It’s true that badly coded plugins could add bloat and slow down your site.

But a well-made, lightweight plugin can save you a lot of time and hassle, without any ill effects.

In fact, the number of plugins on a WordPress site has actually next to no direct correlation with your site’s speed and performance. It’s all about the quality of the plugins installed. The larger plugins for WordPress, like MonsterInsights, which have millions of installs, are more tested and optimized for speed. They have no impact on site load speed whatsoever.

You can read more about how plugins affect your site’s speed here.

Before we jump in, let’s take a look at why adding Google Analytics to your site without a plugin may not be the best choice for your site.

  • Not as easy: Adding Google Analytics to your site without a plugin is not as easy as with a plugin. With MonsterInsights, the best Google Analytics plugin for WordPress, you can easily set up Analytics with just a few clicks.
  • You may lose tracking code: When you switch your themes, you may forget to add the Analytics tracking code again to your new theme. In the period of time before you add your tracking code again, your visitors won’t be tracked. With a plugin, you won’t miss out on that data.
  • You miss powerful Analytics features: You’ll miss powerful features like events tracking, custom dimensions, file download tracking, and more. Without a plugin, it’s very time consuming to set up these features on your WordPress site.

If you’re looking for an easy way to set up Google Analytics on your WordPress site, you may use MonsterInsights, instead.

With MonsterInsights, you can easily set up these advanced tracking features with just a few clicks:

  • Enhanced eCommerce tracking for your WooCommerce and Easy Digital Downloads stores
  • Google AdSense tracking so you can see who’s clicking on your ads
  • File download tracking to see how many times each file is downloaded
  • Popular post tracking so you can see which posts are most popular with your audience

…and much more – see the full list of features here.

You can read how to properly set up Google Analytics in WordPress with MonsterInsights.

If you’d rather set up Google Analytics without a plugin, follow the step-step-guide below.

Add Google Analytics in WordPress Without a Plugin

Before we get started, make sure to backup your WordPress theme, so in case something goes wrong, you can easily revert it back.

You’ll be directly editing the code that outputs your site, so a mistake as small as a misplaced comma could bring down your whole site. Be sure to make a backup just in case.

Step 1: Get Your Google Analytics Tracking Code

Log into your Google Analytics account and select the website for which you need the tracking code.

Click on Admin in the left taskbar.

click admin

In the property column, click Tracking Info, and then Tracking Code.

get google analytics tracking-code

Now you can get the tracking code under the Website tracking section. Just copy it.

copy-tracking-code

Step 2: Add the Tracking Code to the header.php file

Log in to your WordPress dashboard and navigate to Appearance » Editor. Now click the header.php file on the right-hand side below the Templates section.

add-to-header-file

Paste the tracking code you just copied from your Analytics profile after the <body> tag.

tracking code added

Then click Update File.

That’s it!

You’ve just added Google Analytics in WordPress without a plugin.

After installing Google Analytics, you might also want to stop Google Analytics from tracking logged in WordPress users. For more tutorials like this, follow us on Twitter and Facebook.

分享此文:

  • 分享到 Twitter(在新視窗中開啟)
  • 按一下以分享至 Facebook(在新視窗中開啟)
  • 分享到 WhatsApp(在新視窗中開啟)
  • 按一下以分享到 Telegram(在新視窗中開啟)
  • 分享到 Pinterest(在新視窗中開啟)
  • 分享到 Reddit(在新視窗中開啟)
  • 按一下即可分享至 Skype(在新視窗中開啟)
  • 按一下即可以電子郵件傳送連結給朋友(在新視窗中開啟)
  • 點這裡列印(在新視窗中開啟)

相關


WordPress資訊, 教學資源

Post navigation

PREVIOUS
Google Maps开始提供更详细的通勤服务 并支持音乐播放
NEXT
SSH暴力破解的解读与防御

發表迴響 取消回覆

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料。

More results...

Generic filters
Exact matches only
Search in title
Search in content
Search in excerpt
Filter by 分類
網站公告
Featured
限時免費
ESET NOD32
WINDOWS 10 &11 INSIDER PREVIEW
Windows 軟件下載
系統軟件
辦公軟件
圖像處理
影音媒體
網絡軟件
應用軟件
Mac 軟件下載
安卓軟件下載
網絡資訊
Mac資訊
Linux資訊
VPS資訊
NASA資訊
金融資訊
WhatsApp Stickers教學
WordPress資訊
WeChat資訊
PHP資訊
Plesk資訊
TensorFlow
教學資源
開源程序
網頁工具
SEO工具
醫療健康
旅遊及消閒
其他資訊
Content from
Content to
2018 年 10 月
一 二 三 四 五 六 日
1234567
891011121314
15161718192021
22232425262728
293031  
« 9 月   11 月 »

分類

  • 網站公告
  • 限時免費
  • ESET NOD32
  • WINDOWS 10 &11 INSIDER PREVIEW
  • Windows 軟件下載
  • 系統軟件
  • 辦公軟件
  • 圖像處理
  • 影音媒體
  • 網絡軟件
  • 應用軟件
  • Mac 軟件下載
  • 安卓軟件下載
  • 網絡資訊
  • Mac資訊
  • Linux資訊
  • VPS資訊
  • NASA資訊
  • WhatsApp Stickers教學
  • WordPress資訊
  • WeChat資訊
  • PHP資訊
  • Plesk資訊
  • TensorFlow
  • 教學資源
  • 開源程序
  • 網頁工具
  • SEO工具
  • 醫療健康
  • 旅遊及消閒
  • 其他資訊

彙整

近期文章

  • 《Apex英雄》手游和《戰地》手游都被EA取消 2023-02-01
  • 吉利旗下車企官宣借殼上市推動全球前兩大富豪“會師”電動車賽道 2023-02-01
  • 兩名SpaceX宇航員將獲得美國國會太空榮譽勳章 2023-02-01
  • NASA正為阿特米斯2號人類登月任務建造140萬加侖的巨大燃料箱 2023-02-01
  • 新發明的壓力感應手套可能有助於減少發展中國家民眾分娩失敗的悲劇 2023-02-01
  • 研究人員利用量子力學不看物體也能“看到”物體 2023-02-01
  • Gmail的創建者稱人工智能可能在兩年內顛覆谷歌的業務 2023-02-01
  • PayPal將在未來幾週內裁減2000名員工約佔總數的7% 2023-02-01
  • 美國冬季風暴捲土重來:4千萬人受影響近千航班被取消 2023-02-01
  • 消息稱蘋果正在研發20.5英寸全屏可折疊筆記本將於2025年上市 2023-02-01

熱門文章與頁面︰

  • ESET NOD32 LICENSE KEY (UPDATED 2023-01-17)
  • DP vs HDMI 誰才是遊戲玩家最佳選擇?
  • ESET NOD32 LICENSE KEY (UPDATED 2022-01-01)
  • Explorer Patcher:讓Windows 11恢復Windows 10的行為特徵
  • 打車叫到特斯拉不會開門很尷尬?官方介紹開關門方法
  • 盜版Windows 7還能免費升級Windows 10嗎?
  • 揭密蘋果製造工廠:每年的支出可以造兩艘航母
  • 小米MIUI12(安卓11)安裝谷歌套件(GMS/Google Play)
  • Google Chrome瀏覽器意外出現Status_Access_Violation錯誤而崩潰
  • 世界上有多少個國家

投遞稿件

歡迎各界人士投遞稿件到admin@wongcw.com

請提供以下資料:

1.你的名字

2.你的電郵

3.分類目錄

4.文章標題

5.文章摘要

6.文章內容

7.文章來源

 

聯繫我們

查詢,投稿,商務合作:
​admin@wongcw.com
​技術支援:
​support@wongcw.com
​客户服務:
​cs@wongcw.com

QQ群:833641851

快帆

MALUS

極度掃描

DMCA.com Protection Status

WONGCW 網誌

  • 免責聲明
  • 捐助我們
  • ThemeNcode PDF Viewer
  • ThemeNcode PDF Viewer SC
  • Events

服務器提供

本站使用之服務器由ikoula提供。

聯繫我們

查詢,投稿,商務合作:
​admin@wongcw.com
​技術支援:
​support@wongcw.com
​客户服務:
​cs@wongcw.com

QQ群:833641851

© 2023   All Rights Reserved.
 

載入迴響中...
 

    X