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