We are facing issues with Google analytics as it does not seem to be tracking any data on our website. Here is the breakdown of how we have attempted to set it up:
- The tracking code is added in the Drupal headless backend CMS
- A dynamic front-end retrieves the tracking code based on the type of site
- The tracking is dynamically added to the Head section using Angular, specifically in the constructor
Tag assistant indicates the following problems:
- Missing Analytics.js script - No HTTP response detected
We have tried several solutions, including adding code in the body and experimenting with different types of trackings. We have also used the following code:
<!-- Global site tag (gtag.js) - Google Ads: 991964869 -->
<script data-cfasync="false" async src="https://www.googletagmanager.com/gtag/js?id=AW-991964869-1"></script>
<!-- Cross domain checking for the ticket sale CMS-->
<script data-cfasync="false">
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-37890526-1');
</script>
<!-- Additonal scripts here ... -->
<!-- End Facebook Pixel Code -->
We are eager to resolve this issue and get the tracking to work!