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