Mamoto Analytics theme component
This commit is contained in:
parent
19d13ecc86
commit
980416d6d7
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"name": "Matomo Analytics",
|
||||
"about_url": "https://meta.discourse.org/t/how-to-enable-matomo-analytics-on-discourse/33090",
|
||||
"license_url": "https://github.com/discourse/discourse-matomo-analytics/blob/master/LICENSE",
|
||||
"component": true
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<script type="text/discourse-plugin" version="0.8">
|
||||
window._paq = window._paq || [];
|
||||
window._paq.push(["enableLinkTracking"]);
|
||||
(function() {
|
||||
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://" + settings.host_url;
|
||||
window._paq.push(["setTrackerUrl", u+"piwik.php"]);
|
||||
window._paq.push(["setSiteId", settings.website_id]);
|
||||
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
|
||||
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,11 @@
|
|||
<script type="text/discourse-plugin" version="0.2">
|
||||
api.onPageChange((url, title) => {
|
||||
if (window._paq) {
|
||||
const currentUser = api._currentUser;
|
||||
window._paq.push(['setCustomVariable', 1, 'Anonymous', !currentUser, 'visit']);
|
||||
window._paq.push(["setCustomUrl", url]);
|
||||
window._paq.push(["setDocumentTitle", title]);
|
||||
window._paq.push(["trackPageView"]);
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,7 @@
|
|||
host_url:
|
||||
type: string
|
||||
default: ''
|
||||
description: Host URL without http:// or https://
|
||||
website_id:
|
||||
type: string
|
||||
default: ''
|
Loading…
Reference in New Issue