New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable tracking performance and browser plugins without pageview (offer ability to force a specific page view ID in JS tracker) #16942
Comments
Hi @JE4GLE for page performance metrics this might be already the case if you track for example an event on the page. Then Matomo would currently attribute this to the page view. However, this can only work if you track a page view ID server side. The problem is that you can't really know what page view ID to send because it's randomised in JavaScript tracker. So a method to force a specific page view ID to be used should be all that's needed here. Then any event or content tracking request would set the correct page performance metrics on the page view. |
Thank you @tsteur So I would call this method |
Exactly.
I'm not 100% sure but I would very much expect in this case it would record two page views then. In this case you could also simply only track page views through JS? But that wouldn't help I guess when some requests are blocked. It be something to think about though 👍 The problem is it would need a new A very simple solution be to have an option to force a specific pageViewId when calling |
Hey I got the same problem here (I think). If I understand well, a simpler solution would be to be able to access the page view ID from javascript code ( However it seems to me that I can't access this property on the global Would that be a solution ? |
I don't think, this would be an advantage, because you would have to trigger the pageview request with PHP after the page has loaded using an async call. Orherwise you can't send the pageview ID from JavaScript to PHP. |
Any update here? :) |
@JE4GLE the feature is not on our roadmap currently. If you're familiar with PHP/JS feel free to create a pull request and we'll be happy to review. We have various docs on https://developer.matomo.org/ , for the tracker we have for example https://developer.matomo.org/guides/jstracker-core |
I've made the following change in a forked version: https://github.com/Promatur/matomo/commit/a40b6a3e771220d62efd9e1526ed6b272ab36353 I'm not really experienced with Matomo, could you have a quick look please? |
I haven't tested but it looks like this could work @JE4GLE 👍 |
@tsteur Thanks! Do I have to do anything else or do I just submit a Pull Request? |
I think there's a semicolon missing after the setPageViewId function but someone would be reviewing it anyway. So creating a PR should be it 👍 |
This seems to have been released in v4.4.0. |
👍 |
Hello,
I use a combination of the HTTP Tracking API with PHP and the JavaScript Tracker. The PHP side tracks page views, ECommerce and other events, so that every page view and transaction is reported and not lost by users blocking the JavaScript tracker. In addition to the PHP side, the JavaScript tracker tracks the rest, like content tracking. This has the disadvantage that page views are not tracked using the JavaScript tracker and I lose important data like Performance tracking (Plugins are not so important, but share the principle).
My suggestion would be to allow sending performance and browser plugins without a page view. Maybe using an event or a separate method like
trackPerformance()
, which should not be used in combination withtrackPageView([customTitle])
.Thank you!
The text was updated successfully, but these errors were encountered: