EMIANO Analytics Ranking
v1.1.0littycojp · 2026年11月6日 上架
Show popular posts ranked by page views from your Google Analytics 4 property, with a block or a shortcode.
- 正在使用
- 10 以下
- 评分
- 暂无
- 累计下载
- 462
- 最近更新
- 2026年11月13日
贡献者
截图
Display popular posts using the page views your site already collects with Google Analytics 4 (GA4).
EMIANO Analytics Ranking is a free WordPress plugin that uses existing GA4 data. You can build your first ranking from historical data after the first successful retrieval, without waiting for new page views to accumulate.
The plugin adds no tracking script and makes no per-view database writes for ranking. It retrieves aggregated page views in the background and saves the latest ranking results for each period in WordPress, including post IDs, view totals, and the retrieval time. Individual visit histories are not stored, and displaying a ranking uses the saved results without calling Google.
Features
- Choose up to five periods from seven options: 12 hours, 1 day, 3 days, 1 week, 1 month, 3 months, and 6 months. The start of each period is calculated in the GA4 property’s time zone and rounded down to the hour.
- The scheduled retrieval intervals are 1 hour for the 12-hour and 1-day rankings, 6 hours for the 3-day and 1-week rankings, and 1 day for longer rankings. Actual timing depends on WP-Cron.
- Use the Analytics Ranking block or the
[emiano_ranking]shortcode to display up to ten published posts for a selected period and public post type. You can filter by one category and its child categories. WordPress pages are excluded. - Set site-wide options for featured images, rank numbers, publication dates, and the ranking’s last update time. Posts without a featured image show an empty frame of the same size.
- Customize the optional heading text, HTML tag (H1 to H6, p, or div), CSS classes, and message shown when there is no ranking data. The plugin adds a CSS class to the heading for the selected period. Rankings inherit your theme’s fonts and colors.
- Views from different URLs that resolve to the same post are combined, including old slugs recorded by WordPress. Both pretty and Plain permalinks (
/?p=123) are supported. - Check the last successful retrieval, result, error type, and next scheduled retrieval for each period in the settings. When you change the property ID or key, you can choose to retrieve the data again right away.
Requirements
Set up GA4 on your WordPress site and have your numeric property ID and Google Cloud service account JSON key ready. Enable the Google Analytics Data API and Google Analytics Admin API, and grant the service account the Viewer role on the GA4 property for read-only access.
Shortcode
[emiano_ranking period="1w" post_type="post"]
period: one of the periods selected on the settings screen (12h,1d,3d,1w,1m,3m,6m). If omitted, the shortest selected period is used.post_type: one public post type. Default:post.category: one category slug, including posts in child categories. If omitted, all categories are included.
Category rankings are selected from the overall ranking, so categories with few posts may show fewer than ten posts.
If a period that is not selected on the settings screen is specified, the shortcode shows the same output as when there is no data.
If a category slug does not exist, the shortcode shows the same output as when there is no data.
For developers
emiano_ar_get_ranking( $args ): accepts the same arguments as the shortcode (period,post_type,category) and returns an array of post IDs in ranking order, up to ten posts.emiano_ar_ranking_post_ids: filter receiving the array of candidate post IDs and the arguments. Applied before filtering by post type and category. Use it to exclude or reorder posts.emiano_ar_ranking_html: filter receiving the HTML, the array of displayed post IDs, and the arguments. Applied to shortcode and block output, but not to the text shown when there is no data.
About GA4 data
Google lists a typical processing time of 2 to 6 hours for intraday data in standard GA4 properties. Processing can take 24 to 48 hours, and reported totals can change during that time. Rankings reflect the data available at the last successful scheduled or manual retrieval.
External services
This plugin connects to the following Google services to retrieve your GA4 data. Requests are made only after you save a property ID and a service account key. They are sent from your server, not from your visitors’ browsers. No information about your visitors is sent.
Google OAuth 2.0 token service
Used to obtain a short-lived access token for the service account.
Endpoint: https://oauth2.googleapis.com/token
Data sent: a JSON Web Token signed on your server with the service account private key. It contains the service account email address, the read-only Analytics scope, the token endpoint as the audience, and the time it was issued and expires. The private key itself is never sent.
When: when an access token is needed for the requests below. The token is cached until shortly before it expires.
Google Analytics Admin API
Used to read the time zone of your GA4 property, so that periods are counted in the property’s time zone.
Endpoint: https://analyticsadmin.googleapis.com/
Data sent: the property ID and the access token.
When: before retrieving page views, at most once a day per property (the time zone is cached).
Google Analytics Data API
Used to retrieve page views per page path for the selected periods.
Endpoint: https://analyticsdata.googleapis.com/
Data sent: the property ID, the access token, and the report request (date range, page path dimension, page view metric, sort order, and row limit).
When: on the automatic schedule described above, when you choose to retrieve data again after changing the settings, and when you use “Test connection”.
Google APIs Terms of Service: https://developers.google.com/terms
Google Privacy Policy: https://policies.google.com/privacy



