# Implementing Google Analytics

**URL:** <https://forum.8thwall.com/t/implementing-google-analytics/7393>\
**Category:** Technical Support\
**Tags:** studio\
**Created:** [July 3, 2025, 7:20pm UTC](https://forum.8thwall.com/t/implementing-google-analytics/7393 "2025-07-03T19:20:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arukemi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/arukemi/32/2500_2.png) [@Arukemi](https://forum.8thwall.com/u/Arukemi)\
**Post date:** [July 3, 2025, 7:20pm UTC](https://forum.8thwall.com/t/implementing-google-analytics/7393/1 "2025-07-03T19:20:23Z")

</div>

Could anybody give me a real example on how to implement google analytics on my studio projects? I used to add the code on the header without problem before, but now it seems I have to add it through code, as a document.head.insertAdjacentHTML or the like, but this is not working, I have tried a lot of ways and it just doesn’t connect to my google analytics. I also tried tag manager and nothing.

Would be really helpful if this was addressed on the new docs just like legacy web editor

---

<div class="post-metadata">

**Author:** ![GeorgeButler](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/georgebutler/32/1903_2.png) [@GeorgeButler](https://forum.8thwall.com/u/GeorgeButler)\
**Post date:** [July 8, 2025, 4:15pm UTC](https://forum.8thwall.com/t/implementing-google-analytics/7393/2 "2025-07-08T16:15:14Z")

</div>

Hi, welcome to the forum! I’ll look into getting this added to our docs.

Take a look here:

> [@Customize HTML in the Niantic Studio?](https://forum.8thwall.com/t/customize-html-in-the-niantic-studio/4533/2):
>
> Hi Amitri! Yes, it’s possible! Here’s an example of what you’d put in your custom component. Make sure to put the custom component on an entity in your scene. add: (world, component) =\> { const analytics = document.createElement('script') analytics.setAttribute('async') analytics.src = 'https://www.googletagmanager.com/gtag/js?id=TAG\_ID' analytics.addEventListener('load', () =\> { window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(argume…
