📈 chore(stats): prevent non-demo sites from using demo GoatCounter

main
welpo 1 year ago
parent 5d6cd7a7cf
commit ad03bd274c
No known key found for this signature in database
GPG Key ID: A2F978CF4EC1F5A6

@ -3,6 +3,8 @@
{% set self_hosted_url = config.extra.analytics.self_hosted_url | default(value="") %} {% set self_hosted_url = config.extra.analytics.self_hosted_url | default(value="") %}
{% if analytics_service == "goatcounter" %} {% if analytics_service == "goatcounter" %}
{# Prevent non-demo sites from using the demo analytics account #}
{% if self_hosted_url == "https://tabi-stats.osc.garden" and config.base_url == "https://welpo.github.io/tabi" or self_hosted_url != "https://tabi-stats.osc.garden" %}
<script async <script async
{% if self_hosted_url %} {% if self_hosted_url %}
data-goatcounter="{{ self_hosted_url ~ '/count' }}" data-goatcounter="{{ self_hosted_url ~ '/count' }}"
@ -12,6 +14,7 @@
src="https://gc.zgo.at/count.js" src="https://gc.zgo.at/count.js"
{% endif %} {% endif %}
></script> ></script>
{% endif %}
{% elif analytics_service == "umami" %} {% elif analytics_service == "umami" %}
<script async defer <script async defer

Loading…
Cancel
Save