
內容簡介
總結:WordPress 的 Google Analytics 替代方案,提供乾淨統計數據、互動、驗證機器人、UTM、GeoIP、CSV匯出。強調保護隱私。
問題與答案:
1. 這個 WordPress 插件提供了哪些主要功能?
- 答:提供一覽表的KPIs、互動(session)功能、內容洞察、獲客資訊、受眾分析、技術資訊、機器人驗證、網路資訊、CSV匯出等功能。
2. 人們為什麼選擇這個插件?
- 答:因為它提供清晰專注的報告,沒有繁瑣的選單,並且具有可操作的篩選功能,可以自由啟用更多詳細的資訊。
3. 如何設定此插件的額外功能?
- 答:您可以在https://yeb.to註冊並創建API金鑰,然後在WordPress中開啟Analytics(YEB),粘貼您的金鑰,切換您想要的額外功能。直到您添加金鑰並打開功能為止,不會向YEB發送任何資料。
4. 如何使用此插件?
- 答:進入Analytics(YEB)→儀表板查看報告,使用標籤深入研究概況、互動、內容、獲客、受眾、技術、機器人和網路等項目。點擊“匯出CSV”以下載當前查看的資料。
5. 這個插件還提供了什麼快捷方式?如何使用它?
- 答:這個插件提供了短代碼(public mini-stats),您可以在任何地方(頁面、文章、小工具、網站編輯器)顯示小型的、公開的計數器。舉例來說,使用[waby_visits_stats]可顯示整個網站過去7天的訪問數。
外掛標籤
開發者團隊
原文外掛簡介
Google Analytics alternative for WordPress: clean stats, interactions, verified bots, UTM, GeoIP, CSV export. Privacy-first.
What you get
At-a-glance KPIs: pageviews, sessions, unique visitors, pages per session.
Interactions (sessions): session explorer with landing, referrer, per-session timeline (page history), avg. load, distinct pages, pageviews, expand/collapse.
Content insights: top URLs, titles, post IDs.
Acquisition: referrers (root domains) and UTM (source/medium/campaign).
Audience: countries, regions, cities, languages, common screen sizes.
Tech: device type, OS, browser.
Bots (with verification): separate verified search engine hits (Google, Bing, etc.).
Networks: major networks/ISPs and their CIDR ranges.
CSV export: exports exactly what your current filters show.
SPA-friendly & IPv6-ready.
Why people choose it
Clear and calm: focused reports, no maze of menus.
Actionable filters: time window, path, title, country/city, referrer, device, OS, browser, language, UTM, bot type.
You stay in control: richer info (city, device brand/model, verified bot checks) is optional — enable only what you want.
Setup (optional extras)
Want richer details like city/region, device brand/model, or verified bot checks?
Sign in at https://yeb.to and create an API key (free test credits).
In WordPress, open Analytics (YEB) → Settings, paste your key.
Toggle the extras you want (Geo, Network/ASN, Device details, Bot verification).
Nothing is sent to YEB until you add a key and turn on a feature — you choose.
Usage
Go to Analytics (YEB) → Dashboard for your reports.
Use the tabs to dive into Overview, Interactions, Content, Acquisition, Audience, Tech, Bots, Networks.
Click Export CSV to download exactly what you’re viewing.
Shortcode (public mini-stats)
Show small, public counters anywhere (pages, posts, widgets, site editor).
Basic:
`
[waby_visits_stats] ; whole site, last 7 days
[waby_visits_stats period=”30d”] ; whole site, last 30 days
[waby_visits_stats period=”1d” bots=”only”] ; bots only, yesterday
[waby_visits_stats page=”/pricing”] ; just /pricing page, last 7 days
`
Auto-detect current page:
`
[waby_visits_stats current_page]
`
If page="" isn’t provided, current_page uses the current request path.
Show exactly what you want:
`
[waby_visits_stats show=”visits”] ; only total visits (pageviews)
[waby_visits_stats show=”uniques”] ; only unique visitors
[waby_visits_stats show=”both”] ; both (default)
`
Bot filter:
– bots="exclude" (default) — show human traffic and unverified bot-like traffic treated as human
– bots="only" — bot traffic only
– bots="include" — include everything
Labels, layout & CSS hooks (for custom styling):
`
[waby_visits_stats
current_page
show=”both”
label_visits=”Views”
label_uniques=”Visitors”
layout=”inline” ; inline | stack
sep=” • ”
wrap_tag=”div” ; div | span | p
item_tag=”span” ; span | div
wrapper_class=”stats stats–mini”
item_class=”stats__item”
label_class=”stats__label”
value_class=”stats__value”
]
``
All attributes:
– period: 1d, 7d (default), 30d
– page: limit to a path (e.g. /pricing)
– current_page: presence-only flag to use the current URL path
– bots: exclude (default), only, include
– show: visits, uniques, both (default)
– label_visits (default Visits), label_uniques (default Unique)
– layout: inline (default) or stack
– sep: separator when layout="inline" (default |)
– wrap_tag: div (default), span, p
– item_tag: span (default), div
– wrapper_class, item_class, label_class, value_class: extra CSS classes
Styling the shortcode
Paste this CSS into Appearance → Customize → Additional CSS (or your theme stylesheet):
`css
/* YEB Visits – public stats */
.yeb-visits-stats {
display: inline-flex;
gap: .75rem;
align-items: baseline;
font: 500 14px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
.yeb-visits-stats.yeb–layout-stack {
display: inline-grid;
gap: .35rem;
}
.yeb-visits-stats .yeb-metric {
display: inline-flex;
gap: .35rem;
align-items: baseline;
white-space: nowrap;
}
.yeb-visits-stats .yeb-metric__label { opacity: .7; }
.yeb-visits-stats .yeb-metric__value { font-weight: 700; }
.yeb-visits-stats .yeb-sep { opacity: .35; }
“
Privacy, Cookies & Data Flow
You choose which extras to enable (location, device details, bot verification). IPs are stored in a way that groups them by network (not exact address). You can limit how often extras are called and how much data is kept.
External Service & Data Flow (Guideline 6)
This plugin can optionally call the YEB API to enrich your local analytics. Nothing is sent to YEB until you add an API key in Analytics (YEB) → Settings and enable the related toggle.
Endpoints (HTTPS):
GeoIP: {base}/country, {base}/city, {base}/asn (default base: https://api.yeb.to/v1/geoip)
Device analyze: {endpoint} (default: https://api.yeb.to/v1/device-analyze)
Bot verification: {base} or {base}/{vendor} (default base: https://api.yeb.to/v1/bot/detect/detect)
What is sent and when:
GeoIP Country — IP address; only if API key set and “Country” enabled (purpose: country lookup)
GeoIP City/Region — IP address; only if API key set and “Region & City” enabled (purpose: city/region)
ASN/Network — IP address; only if API key set and “ASN & Network” enabled (purpose: ASN/CIDR)
Device analyze — User-Agent; only if API key set and “Parse user-agent strings” enabled (purpose: browser/OS/device parsing, bot type)
Bot verification — IP + User-Agent; only if API key set and “Bot-Detect” enabled and UA looks like a bot (purpose: verify known crawlers)
All requests use HTTPS. The plugin stores analytics locally; enrichment results are cached locally.
YEB policies:
Privacy Policy: https://yeb.to/privacy
Terms of Service: https://yeb.to/terms
Cookies
Two first-party cookies (pseudonymous GUIDs):
yeb_sid — session id, 30 minutes; groups pageviews into sessions.
yeb_vid — visitor id, 1 year; counts returning unique visitors.
Consent & Opt-Out (Guidelines 7 & 9)
By default, the beacon loads for visitors (logged-in admins excluded unless you enable Track logged-in admins). If your jurisdiction or policy requires consent before placing analytics cookies, gate the beacon with your consent tool.
Example (dequeue until consent):
`php
/**
* Stop the YEB beacon until a custom consent flag is set.
* Replace the condition with your CMP’s check.
*/
add_action(‘wp_enqueue_scripts’, function () {
$consent_given = isset($_COOKIE[‘my_consent_flag’]) && $_COOKIE[‘my_consent_flag’] === ‘yes’;
if ( ! $consent_given ) {
wp_dequeue_script(‘waby-visits-beacon’);
wp_deregister_script(‘waby-visits-beacon’);
}
}, 100);
`
Public REST Endpoint
The plugin exposes an intentionally public ingest endpoint used by the front-end beacon:
`
POST /wp-json/waby/v1/visit
Alias: POST /wp-json/yeb/v1/visit
`
It accepts sanitized visit metadata (URL, path, referrer, UTM, screen, language, etc.) and stores it in your site’s database. It does not expose private data or modify content.
Data Retention & IP Handling
A salted hash of the visitor IP is stored to group traffic by network.
The raw IP is not stored by default. If you enable Store raw IP (packed), it is retained only for the number of days you set (default 7 days) and is visible to admins only.
During enrichment, the raw IP may be encrypted temporarily and then cleared automatically once enrichment is done or after a short fallback window.
You can limit daily external calls and sampling in Analytics (YEB) → Settings.
Uninstall
If you enable Delete all data on uninstall in settings, uninstalling the plugin will remove its custom tables and options.
Leave it off if you want to keep your analytics data.
Filters & Extensibility
waby_visits_stats_output — filter the final HTML of the public stats shortcode.
waby_visits_cache_ttl — filter select-query cache TTL (seconds) used by the dashboard and shortcode.
