xref: /webtrees/resources/views/modules/google-analytics/snippet.phtml (revision 5183874f79e6c96ed7a5a66bc6a021feaad4d6f6)
1<?php
2
3/**
4 * @var object $dimensions
5 */
6
7assert(is_object($dimensions))
8
9?>
10<script async src="https://www.google-analytics.com/analytics.js"></script>
11<script>
12    window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};
13    ga.l=+new Date;
14    ga("create", "<?=  e($GOOGLE_ANALYTICS_ID ?? '') ?>", "auto");
15    ga("send", "pageview", <?= json_encode($dimensions, JSON_THROW_ON_ERROR) ?>);
16</script>
17