ga-popular GitLab
Google Analytics popular posts. A WordPress plugin to fetch a set of URL (and corresponding WP posts) from Google Analytics (possibly filtered) metrics enriched by Python / Symfony console command-line tools.
★ 0stars
150composer installs
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://gitlab.com/drzraf/ga-popular/-/archive/master/ga-popular-master.zipAlso on Packagist as drzraf/ga-popular:
composer require drzraf/ga-popularFrom the readme
Google Analytics popular posts.
Collect statistics from a given Google Analytics view.
This plugin wraps a WordPress wp-cli command and is intended to be run from the command-line or from a regularly called cron script.
It uses the Google Analytics API (and relies upon a credential file) to collect the statistics from a specific Google Analytics view.
Viewing, filtering, sorting, ordering and limits, ... can be provided from command-line or from a JSON configuration file.
Output can be customized from a plain list of URL or a more extended JSON format containing desired metrics (pageViews, users, ...)
The command optionally allow to:
- determinate post ID corresponding to URL (In some WordPress usages)
- store the results as a WordPress option.
Benefits
- A self-contained and simple plugin providing other themes/plugins Google Analytics data they can directly consume using getoption().
- Protected Google Analytics credentials (Could be owned by root and piped to command's stdin. WordPress bootstrap is optional)
- A flexible way to customize statistics: A theme could write a valid JSON configuration file to be used.
Examples
- $ symfony-cli.php -c my-project-abcd.json -m ga: