personal-website/_includes/scripts/analytics.html

19 lines
851 B
HTML

{%- if site.enable_google_analytics -%}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
</script>
{%- endif -%}
{%- if site.enable_panelbear_analytics -%}
<!-- Panelbear Analytics - We respect your privacy -->
<script async src="https://cdn.panelbear.com/analytics.js?site={{site.panelbear_analytics}}"></script>
<script>
window.panelbear = window.panelbear || function() { (window.panelbear.q = window.panelbear.q || []).push(arguments); };
panelbear('config', { site: '{{site.panelbear_analytics}}' });
</script>
{%- endif -%}