1.1.0
This extension should have supported GA4 out of the box, since none of the syntax used by this extension differs between UA and GA4.
If you have issues with page view reporting, make sure that your web data stream has Enhanced measurement enabled, and that Page views are configured with the Page changes based on browser history events option enabled.
Changes
- Explicitly address GA4 compatibility
- Using GA4 will not manually report page views to Google Analytics, like was done for UA
- Please note, this means that instead of a
page_path
property on your page_view
events, the full URL will be contained in the page_location
property
- Pass user IDs to Google Analytics for user-based tracking between devices, sessions and accounts
Updating
composer require fof/analytics:"*"
php flarum cache:clear
Checking configuration
If you use GA4, you can check everything is running smoothly by checking the DevTools network tab. This should show pings to collect?v=2&...
. Clicking on one of these, then checking the Payload tab should show...
tid
matching your G-...
tracking ID
dl
matching the page you visited
dr
matching the page you just moved from
uid
matching your Flarum user ID
- ...and various other tracking properties