Fixed Google Analytics not tracking URLs with instant loading

This commit is contained in:
squidfunk 2020-07-24 10:54:48 +02:00
parent 6d6811451b
commit b0bb26ec99
6 changed files with 5 additions and 8 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"assets/javascripts/bundle.js": "assets/javascripts/bundle.882d8593.min.js", "assets/javascripts/bundle.js": "assets/javascripts/bundle.1688372e.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.882d8593.min.js.map", "assets/javascripts/bundle.js.map": "assets/javascripts/bundle.1688372e.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.877163d5.min.js", "assets/javascripts/vendor.js": "assets/javascripts/vendor.877163d5.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.877163d5.min.js.map", "assets/javascripts/vendor.js.map": "assets/javascripts/vendor.877163d5.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.a68abb33.min.js", "assets/javascripts/worker/search.js": "assets/javascripts/worker/search.a68abb33.min.js",

View File

@ -183,7 +183,7 @@
</div> </div>
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/vendor.877163d5.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/vendor.877163d5.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.882d8593.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.1688372e.min.js' | url }}"></script>
{%- set translations = {} -%} {%- set translations = {} -%}
{%- for key in [ {%- for key in [
"clipboard.copy", "clipboard.copy",

View File

@ -2,5 +2,5 @@
This file was automatically generated - do not edit This file was automatically generated - do not edit
-#} -#}
{% set analytics = config.google_analytics %} {% set analytics = config.google_analytics %}
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","{{ analytics[0] }}","{{ analytics[1] }}"),ga("set","anonymizeIp",!0),ga("send","pageview"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})}),document.addEventListener("DOMContentSwitch",function(){ga("send","pageview")})</script> <script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","{{ analytics[0] }}","{{ analytics[1] }}"),ga("set","anonymizeIp",!0),ga("send","pageview"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})}),document.addEventListener("DOMContentSwitch",function(){ga("send","pageview",document.location.pathname)})</script>
<script async src="https://www.google-analytics.com/analytics.js"></script> <script async src="https://www.google-analytics.com/analytics.js"></script>

View File

@ -48,7 +48,7 @@
/* Send page view on document switch (instant loading, custom event) */ /* Send page view on document switch (instant loading, custom event) */
document.addEventListener("DOMContentSwitch", function() { document.addEventListener("DOMContentSwitch", function() {
ga("send", "pageview") ga("send", "pageview", document.location.pathname)
}) })
</script> </script>
<script async src="https://www.google-analytics.com/analytics.js"></script> <script async src="https://www.google-analytics.com/analytics.js"></script>