xref: /webtrees/resources/views/modules/google-analytics/snippet.phtml (revision 728c8c2714cc197d45bad7363eb52e0bff3297bb)
17c2c99faSGreg Roach<?php
27c2c99faSGreg Roach
37c2c99faSGreg Roach/**
47c2c99faSGreg Roach * @var object $dimensions
57c2c99faSGreg Roach */
67c2c99faSGreg Roach
77c2c99faSGreg Roachassert(is_object($dimensions))
87c2c99faSGreg Roach
97c2c99faSGreg Roach?>
108e5c5efeSGreg Roach<script async src="https://www.google-analytics.com/analytics.js"></script>
118e5c5efeSGreg Roach<script>
128e5c5efeSGreg Roach    window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};
138e5c5efeSGreg Roach    ga.l=+new Date;
148e5c5efeSGreg Roach    ga("create", "<?=  e($GOOGLE_ANALYTICS_ID ?? '') ?>", "auto");
15*728c8c27SGreg Roach    ga("send", "pageview", <?= json_encode($dimensions, JSON_THROW_ON_ERROR) ?>);
168e5c5efeSGreg Roach</script>
17