Thomas
Forum Replies Created
-
@locke85 I’m not fully sure how WP-Matomo connects to Matomo and what might be the problem there but indeed Connect Matomo is not intended to be used with the full Matomo Analytics plugin. I have a feeling that Matomo is basically loaded twice and it could cause issues. It’s also possible the way it’s loaded that it does not load the correct config file as specified by the Matomo Analytics plugin itself.
By the way the Matomo Analytics plugin also lets you add some reports to the dashboard by clicking on “Matomo -> Summary” and then clicking on the Pin icon.
> may be using namespaces to avoid conflicts with other plugins
Hi @fidoboy thanks for the comment and ideas. We’re currently exploring exactly this in https://github.com/matomo-org/matomo/pull/19712. There’s lots of work happening around this right now. It’s unclear though if we can actually make this work reliably without creating bigger issues.
If this didn’t work, then we could try and upgrade the version of Monolog but this may cause incompatibilities with other plugins. We’re working on the namespace fix though and trying to solve this issue. We hope this will work but we cannot guarantee it right now.
Hi @michaelxxx
you are seeing some internal links as an outlink as it looks like all or most of your links have the matomo_link CSS class set when it should be only some specific ones. For example only the ones that have the “…/go/…” in the URL.
Regarding the other question: I’m not sure what you mean by “Targets”?
@digitalchild any chance you are familiar with patching files in your WordPress installation? We have a patch that may fix this issue but would need to get this confirmed.
In case you are familiar with patching files or PHP, could you try to apply this same change from https://github.com/matomo-org/matomo-for-wordpress/pull/588/files the file
wp-content/plugins/matomo/classes/WpMatomo/User/Sync.php?Or you could replace the entire content of that file with this content: https://raw.githubusercontent.com/matomo-org/matomo-for-wordpress/acb360040cc57298f8e8d8ef334f3bd09e40fa70/classes/WpMatomo/User/Sync.php
@michaelxxx I have tested this locally in my WordPress as well and on some other site and it worked nicely here even though the domain is the same as the site itself. Eg when I have below HTML
<a href="https://mysite.com/go/booking" target="_blank" class="matomo_link">link</a>And then click on the link, then I can see the outlink being tracked (I can also see that on your site that this works) and I can afterwards see the URL “mysite.com/go/booking” in the “Matomo Analytics -> Reporting -> Behaviour -> Outlinks” reporting.
In case you are looking at the “Matomo Analytics -> Summary” page at the “Outlinks” report then there I currently only see “mysite.com”. We could think about changing it to show the full URL there.
Is there any chance you could temporarily create a user with “Matomo Super User” role on your WordPress? We would only be able to see the Matomo section in your WordPress and nothing else. After we investigated the issue, the user could be removed again. If that’s an option, be great to create a user for wordpress@matomo.org and then let us know. We would then do a password reset meaning you wouldn’t need to send us the password. Would that work?
Hi @michaelxxx
Awesome on adding the CSS classes. This looks good. I clicked on a link where it has the “…/go/booking” URL structure.
I can see that it did track an outlink to “https://mysite.com/go/billiger…”
This URL should show up in your “Behaviour -> Outlinks” report as the above URL which includes the “…/go/…”. Does it?
Or maybe I misunderstand something?
You can then use this URL in the goal configuration to trigger the goal when the outlink URL contains a specific URL or if it equals a specific URL for example.
@frogerme I’ve had another look and when you select “Tag Manager” in the “Add tracking code” section in “WP Admin Dashboard -> Matomo Analytics -> Settings”, then it does let you select a User ID in the settings further below. Does this work maybe? You wouldn’t need to do anything in the Tag Manager for the user ID when selecting the setting.
I fully agree this should be possible easily to track a user ID. If this doesn’t work for you, we can investigate and also think about pushing the UserID to the data layer automatically.
Hi @meir321
Just this week we had a session with someone and could finally identify the problem and we’re working on a fix in https://github.com/matomo-org/matomo/pull/18453/files
The next release won’t have a fix yet but the release afterwards.
The problem happens when you are logged into your browser, and you have saved the password to confirm the change in the browser. So Matomo doesn’t ask you again for password and it causes a bug in the code. We’re working on a fix for this. Thanks very much for your patience.
A workaround could be for example to use a different browser. Maybe logging out of your browser might work too.
Hi @frogerme
pushing the userId to the data layer, and configuring a userId variable for this and using this userId variable in the Matomo Configuration for the user ID would be definitely the best/right way to do this.
Something like below should work:
add_action('wp_head',function () { echo "<script>var _mtm = _mtm || [];_mtm.push({'uid':'". esc_js($userId) . "' });</script>"; }, 9)I haven’t tested this but would assume this should work. I think you were already on the right track. It’s just that you don’t have to listen to a Matomo event to add the user ID. You could also listen to the wp_head event and then it should work too. Could you give this maybe a try?
@oli89 I’ve replied in our email discussion. Problem was the assigned trigger condition which needs to be changed.
Hi @meir321 I’ve prepared another fix for this: https://github.com/Thomas–F/BotTracker/pull/84/files
I’ve tested it and it worked with this fix. You could manually maybe make a similar change in case you are familiar with this until the developer of that plugin accepts this change and releases a new version. If it goes as quick as last time, it might not be long though before a new update.
Sorry about that.
Hi @meir321 our fix has been accepted and there was a new release for this plugin. It be great to try and update that plugin and then give it another try. It might work this time.
Hi @doolyo
just FYI the Queued Tracking plugin also has an option to use the existing MySQL database instead of redis and there is an option to not needing a cronjob. The option is called “Process during tracking request”.
And FYI to hide the Matomo URL we also have a dedicated feature that can be used see https://github.com/matomo-org/tracker-proxy . As you already have a workaround for it this might not be needed. But wanted to mention it anyway in case it’s useful 🙂
Have a great day @doolyo
Hi @doolyo ,
thanks for the tips for performance improvements. It works that way since Matomo for WordPress is mostly intended for small websites with less traffic and performance is usually not super critical. Since there is an alternative with Matomo On-Premise already there we don’t go through the effort to also optimise Matomo for WordPress for ultimate performance. This of course can change in the future. Generally, by not optimising it helps us having it work on all WordPress installations out of the box without any issues. As you know WordPress powers most website and runs on millions of differently configured servers and installations and by bootstrapping WordPress every time we can ensure that things work without issues.
If you already have a running WordPress, Matomo On-Premise should be fairly easy to install and is quick to maintain (update). If you want even faster performance for On-Premise, there is our Queued Tracking feature which effectively does what you are after to make things blazing fast (4-5ms for us per request). This however wouldn’t be as effective in Matomo for WordPress since we’d still bootstrap WordPress every time which is the slow part.
Hope this helps @doolyo
fyi @wpformation the requested feature will be available in the next release.