Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/spcktr/cme-ga4html5vid/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
A WordPress Plugin for HTML5 Video Tracking using Google Analytics
Supports logged-in user ID tracking.
Play around with the live demo.
Install
- Download the latest release (zip file) from GitHub.
- Log in to your WordPress site as an admin.
- Navigate to Plugins > Add New.
- Click Upload Plugin.
- Select the zip file downloaded in step 1.
- Click Install Now.
- Click Activate.
Next: Write your filter hook for your user ID custom dimension index.
PHP Filter Hook
Add a call to the cme_user_id_custom_dimension_index filter hook to your child theme’s functions.php file. Change the custom dimension index to match the user ID custom dimension index in your Google Analytics property.
add_filter( 'cme_user_id_custom_dimension_index', function($custom_dimension_index) {
return '5'; // Change this to match your CD index number that's set in GA.
} );
Screen Captures
Google Analytics Realtime HTML5 Video Events Report

Google Analytics Custom Report Showing HTML5 Video Events by User ID

Credits
This solution is based on Julius Fedorovicius’ article, HTML5 Video Tracking Recipe for Google Tag Manager posted on Analytics Mania.