mirror of
https://github.com/welpo/tabi.git
synced 2026-02-15 23:57:19 +01:00
✨ feat(analytics): support new plausible script (#587)
Co-authored-by: welpo <welpo@users.noreply.github.com>
This commit is contained in:
parent
d73e64032b
commit
e04ed249d6
8 changed files with 34 additions and 9 deletions
|
|
@ -28,11 +28,17 @@
|
|||
{% if config.extra.analytics.do_not_track %}data-do-not-track="true"{% endif %}>
|
||||
</script>
|
||||
|
||||
{% elif analytics_service == "plausible" %}
|
||||
{% elif analytics_service == "plausible" %}
|
||||
{% if analytics_id is matching("^pa-[^\.]+$") %}
|
||||
{# Use new script available in Plausible 3.1.0 or later #}
|
||||
<script defer src="{{ get_url(path='js/initializePlausible.min.js', trailing_slash=false) | safe }}"></script>
|
||||
<script defer src="{% if self_hosted_url %}{{ self_hosted_url ~ '/js/' }}{% else %}https://plausible.io/js/{% endif %}{{ analytics_id }}.js"></script>
|
||||
{% else %}
|
||||
<script
|
||||
defer
|
||||
data-domain="{{ analytics_id }}"
|
||||
src="{% if self_hosted_url %}{{ self_hosted_url ~ '/js/plausible.js' }}{% else %}https://plausible.io/js/script.js{% endif %}"
|
||||
></script>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue