Customize HTML in the Niantic Studio?

Hi everyone!
Is it possible to customize by importing libraries and editing HTML in the Niantic Studio like Cloud Editor in A-Frame?
Because I want to create tags and configure Google Analytics on the 8thWall Studio

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(arguments);
      }
      gtag('js', new Date());

      gtag('config', 'TAG_ID');
  })
  })
  document.head.appendChild(analytics)
  }
2 Likes

Thanks for your support!