Support video media analytic

This commit is contained in:
Chocobozzz 2022-03-15 14:09:07 +01:00
parent e7aa6925e5
commit 840d539a47
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 11 additions and 2 deletions

View File

@ -41,6 +41,13 @@ function initMatomo (registerHook, peertubeHelpers) {
window._paq.push(['trackPageView']); window._paq.push(['trackPageView']);
} }
}) })
registerHook({
target: 'action:video-watch.player.loaded',
handler: function () {
window._paq.push(['MediaAnalytics::scanForMedia', window.document]);
}
})
}) })
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "peertube-plugin-matomo", "name": "peertube-plugin-matomo",
"version": "0.0.3", "version": "0.0.4",
"description": "Matomo plugin that tracks page views on a PeerTube instance.", "description": "Matomo plugin that tracks page views on a PeerTube instance.",
"engine": { "engine": {
"peertube": ">=1.3.0" "peertube": ">=1.3.0"
@ -18,7 +18,9 @@
"clientScripts": [ "clientScripts": [
{ {
"script": "client/common-client-plugin.js", "script": "client/common-client-plugin.js",
"scopes": [ "common" ] "scopes": [
"common"
]
} }
], ],
"translations": {} "translations": {}