Merge pull request 'replace plausible with matomo' (#16) from replace-plausible-with-matomo into main
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #16
This commit is contained in:
commit
596d9f74be
|
@ -226,9 +226,6 @@ allowed_domains = [
|
||||||
custom_subset = true
|
custom_subset = true
|
||||||
|
|
||||||
[extra.analytics]
|
[extra.analytics]
|
||||||
service = "plausible"
|
|
||||||
id = "softinio.com"
|
|
||||||
self_hosted_url = "https://wisdom.softinio.com"
|
|
||||||
# Specify which analytics service you want to use.
|
# Specify which analytics service you want to use.
|
||||||
# Supported options: ["goatcounter", "umami", "plausible"]
|
# Supported options: ["goatcounter", "umami", "plausible"]
|
||||||
# service = "goatcounter"
|
# service = "goatcounter"
|
||||||
|
|
|
@ -1,24 +1,15 @@
|
||||||
{% set analytics_service = config.extra.analytics.service %}
|
<!-- Matomo -->
|
||||||
{% set analytics_id = config.extra.analytics.id | default(value="") %}
|
<script>
|
||||||
{% set self_hosted_url = config.extra.analytics.self_hosted_url | default(value="") %}
|
var _paq = window._paq = window._paq || [];
|
||||||
|
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||||
{% if analytics_service == "goatcounter" %}
|
_paq.push(['trackPageView']);
|
||||||
{# Prevent non-demo sites from using the demo analytics account #}
|
_paq.push(['enableLinkTracking']);
|
||||||
{% if self_hosted_url == "https://tabi-stats.osc.garden" and config.base_url == "https://welpo.github.io/tabi" or
|
(function () {
|
||||||
self_hosted_url != "https://tabi-stats.osc.garden" %}
|
var u = "//wisdom.softinio.com/";
|
||||||
<script async {% if self_hosted_url %} data-goatcounter="{{ self_hosted_url ~ '/count' }}"
|
_paq.push(['setTrackerUrl', u + 'matomo.php']);
|
||||||
src="{{ self_hosted_url ~ '/count.js' }}" {% else %}
|
_paq.push(['setSiteId', '1']);
|
||||||
data-goatcounter="https://{{ analytics_id }}.goatcounter.com/count" src="https://gc.zgo.at/count.js" {% endif
|
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
|
||||||
%}></script>
|
g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
|
||||||
{% endif %}
|
})();
|
||||||
|
</script>
|
||||||
{% elif analytics_service == "umami" %}
|
<!-- End Matomo Code -->
|
||||||
<script async defer {% if self_hosted_url %} data-website-id="{{ analytics_id }}"
|
|
||||||
src="{{ self_hosted_url ~ '/script.js' }}" {% else %} data-website-id="{{ analytics_id }}"
|
|
||||||
src="https://analytics.eu.umami.is/script.js" {% endif %} data-do-not-track="true">
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{% elif analytics_service == "plausible" %}
|
|
||||||
<script defer data-domain="{{ analytics_id }}" src="{{ self_hosted_url ~ '/js/script.js' }}"></script>
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
Loading…
Reference in a new issue