Ensure a 3rd party <Script /> in root layout only loads after a 3rd party <Script /> in pages.tsx
Unanswered
West Highland White Terrier posted this in #help-forum
West Highland White TerrierOP
I'm working on an app of one of the clients of the company I work for and I have 2 third party scripts. One of them is placed inside the root layout since we need to load that script in all of the pages (optimizely script). Besides that I also have another script (heap script) that is loaded in some of the pages. I need to make sure the heap script one will only load AFTER the optimizely script has finished loading. At first I thought that setting beforeInteractive would prevent that. However, looking at the docs again, I realized it would just ensure the script is loaded before the users are able to interact with the page. Also, if that's helpful, I can check if it's possible to move the heap script to the root layout too. Any thoughts?