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!