EMIANO Analytics Ranking shows your most viewed posts, using the page view data that Google Analytics 4 (GA4) has already collected for your site. It does not count views on your server, so it adds no tracking code and no database writes on page views.
The plugin connects to GA4 with a Google Cloud service account. It retrieves page views in the background on a schedule, matches each page path to a post on your site, and stores the ranking. Visitors only see the stored ranking, so displaying it does not call Google.
[emiano_ranking] shortcode. Each one shows up to ten posts for one period and one post type./?p=123).[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.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.
GA4 usually needs 2 to 6 hours before recent page views are available through its API, and the numbers can change for 24 to 48 hours after that. The most recent views therefore appear in the ranking after a delay.
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.
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.
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).
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