FriendsOfFlarum Analytics - tracking user visits
- Edited
Could someone guide me in configuring google ads conversion tracking
chamath mainly the Start a Discussion and Post Discussion
https://discuss.flarum.org/d/6162-event-tracking-for-google-analytics
does this flarum event tracking
extension still work? https://github.com/SurfEdge/flarum-ext-event-tracking
- Edited
matomo:
Refused to display 'https://www.*****.com:9000/' in a frame because it set 'X-Frame-Options' to 'deny'.
[General]
enable_framed_pages=1
æ— æ•ˆ
r4nchy I have not studied the changes yet. Do you know whether it requires modifications to the javascript we embed in the extension?
Hello, I would like to report a bug. I have disabled all extension and discovered that this extension is causing errors in my website:
Console:
45
sw:57 Uncaught ReferenceError: fetchEvent is not defined
at sw:57:18
6
sw:57 Uncaught ReferenceError: fetchEvent is not defined
at sw:57:18
15
sw:57 Uncaught ReferenceError: fetchEvent is not defined
at sw:57:18
7
sw:57 Uncaught ReferenceError: fetchEvent is not defined
at sw:57:18
12
sw:57 Uncaught ReferenceError: fetchEvent is not defined
at sw:57:18
7
sw:57 Uncaught ReferenceError: fetchEvent is not defined
at sw:57:18
12
sw:57 Uncaught ReferenceError: fetchEvent is not defined
at sw:57:18
32
sw:57 Uncaught ReferenceError: fetchEvent is not defined
at sw:57:18
3
sw:57 Uncaught ReferenceError: fetchEvent is not defined
at sw:57:18
girefko that code is not in this extension, nor it is in Flarum core. The sw:
reference means it comes from a service worker I believe. This extension doesn't use service workers.
Wasn't it a PWA extension issue? You might need to clear your browser cache and storage after removing that extension because a service worker won't uninstall itself automatically.
clarkwinkelmann You are right.. I was using Chrome all along and no matter what I did - the error would not go away. I then switched to Firefox and the error disappeared.
Does this work with Google Analytics 4 ?
- Edited
@luceos after some investigation it looks liek its close but not fully there. The Javascritp Google Analytics 4 gives is
<script async src="https://www.googletagmanager.com/gtag/js?id=G-personalCodeGoesHere"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-personalCodeGoesHere');
</script>
Looking at my own page source it looks like using this in the current state it is just missign this line:
gtag('config', 'G-personalCodeGoesHere');
No idea how much that one line matters... but may need to be added for this extension to work with the new Google Analytics 4.
GA4 is not tracking, needs to be updated
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 yourpage_view
events, the full URL will be contained in thepage_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 yourG-...
tracking IDdl
matching the page you visiteddr
matching the page you just moved fromuid
matching your Flarum user ID- ...and various other tracking properties
dumb question - but will this work for self hosted site with no public IP/DNS (behind NAT)?
jdoe the tracking happens entirely client-side. The way the website is hosted shouldn't matter. The current browser URL is the one that will be sent to Google Analytics or Matomo. The only IP address that matters here is the user IP which will be recorded automatically by Google or Matomo from the request it receives. Server never sends any request to Google or Matomo, and Google/Matomo never sends requests to Flarum either, so the forum hostname doesn't need to be reachable from the global internet.
If both Flarum and Matomo are used inside of a private intranet, Matomo will likely log the user IP from inside the intranet, depending on how you configured the Matomo server. If the analytics server is outside of the intranet, it will likely log the same public IP for all users inside the intranet.
Hey - recently installed this and am using a google tag manager container to track a new GA4 property.
Everything working great.
However, I want to track certain events, like new user signups.
So I created a new tag manager event that fires on the URL containing "/confirm/AKFKHWDKH3GMDG62396NG" for example.
When the user gets the email, and follows the link, they land on a page with a big CONFIRM EMAIL button on it... and the URL contains /confirm.
Trying to record this as an event (close enough), BUT the google tag manager code is not being inserted on this "special" page.
Can we get this added?
Or maybe a better solution?
Anyone know of an extension where you can have brand new users land on a custom WELCOME landing page or something after they hit the email button?