-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Hook into Hit-Tracking #1099
Comments
Hi @djstini, there's currently no WordPress specific hook, though it shouldn't be too hard to add. Can you explain your intended use case? What would you use such a hook for? |
Hi @diosmosis my Use-Case is the following: We are using Matomo for the general tracking of the site. As Matomo includes mechanisms to filter out bots etc. i would like to leverage this filtering in order to create, for example, custom metrics. Let's say for example whenever a "real" visitor visits a page I want to update a post-meta. |
@djstini for something that generic, it sounds like you might be better served by creating a custom Matomo plugin, and having that installed in WordPress. Is that a solution that might work for you? (Note: you would want to look at the RequestProcessor API, https://developer.matomo.org/guides/tracking-requests. You'd create a new one in a new Matomo plugin, and add your WordPress specific logic to one of the hooks in that class.) |
Ahh okay, so i'd just extend on the Matomo-RequestProcessor and add my stuff that way. That sounds doable. Thanks :3 |
Glad this approach might work for you! One thing to note: for Matomo plugins to be installed as WordPress plugins, the main plugin file needs to have this bit of code at the top:
This isn't documented anywhere as far as I know, since it's automatically added by Matomo marketplace. You'll have to add it yourself. I'll keep this issue open as I imagine WordPress hooks would be more convenient for some use cases. |
Hi,
is there a way to trigger a custom action on every visit that is filtered/tracked by Matomo?
Couldn't find anything on that in the Documentation https://developer.matomo.org/api-reference/wordpress/hooks-reference#filters
The text was updated successfully, but these errors were encountered: