mirror of
https://github.com/welpo/tabi.git
synced 2026-02-15 23:57:19 +01:00
refactor js
This commit is contained in:
parent
786c2f0943
commit
05a628625c
3 changed files with 15 additions and 5 deletions
|
|
@ -1,2 +1,12 @@
|
|||
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
|
||||
plausible.init()
|
||||
// Initialise Plausible analytics queue for the new script format (v3.1.0+).
|
||||
// This sets up a queue system that collects tracking calls before the main
|
||||
// Plausible script loads, ensuring no events are lost.
|
||||
window.plausible = window.plausible || function () {
|
||||
(plausible.q = plausible.q || []).push(arguments);
|
||||
};
|
||||
// Initialise the Plausible configuration object.
|
||||
plausible.init = plausible.init || function (config) {
|
||||
plausible.o = config || {};
|
||||
};
|
||||
// Set up Plausible with default configuration.
|
||||
plausible.init();
|
||||
|
|
|
|||
2
static/js/initializePlausible.min.js
vendored
2
static/js/initializePlausible.min.js
vendored
|
|
@ -1 +1 @@
|
|||
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};plausible.init();
|
||||
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}},plausible.init();
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
{% elif analytics_service == "plausible" %}
|
||||
{% if analytics_id is matching("^pa-[^\.]+$") %}
|
||||
{# Use new script available in Plausible 3.1.0 or later #}
|
||||
<script async src="{% if self_hosted_url %}{{ self_hosted_url ~ '/js/' }}{% else %}https://plausible.io/js/{% endif %}{{ analytics_id }}.js"></script>
|
||||
<script src="{{ get_url(path='js/initializePlausible.min.js', trailing_slash=false) | safe }}" defer="defer"></script>
|
||||
<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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue