https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
n

nice-arm-56590

10/17/2023, 8:52 AM
Hey team! Is there a chance you can help us check the installation of the SDK? It was implemented according to your documentation and everything seems to be installed correctly, but the Visual Editor does not work. Even in the draft stage, once the changes are made and the Visual Editor is closed, when opening the preview I see no changes. Needless to say that when the test is started - there is no trace of it on the page or in DevTools.
s

swift-helmet-3648

10/17/2023, 3:55 PM
Hi Victoria, sure. Can you supply a snippet of the code that is responsible for loading the SDK? Off the bat, I would ask if you are setting user attributes and calling
loadFeatures
on initialization?
n

nice-arm-56590

10/18/2023, 9:28 AM
Hey @swift-helmet-3648 ! Thank you for your prompt reply. Here’s the code snippet:
Copy code
<script id="growthbook-sdk" src="https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/index.min.js" defer></script>
<script>
!function(){function o(){if(window.growthbook){var o=function o(){var t=document.cookie.split("; ").find(o=>o.startsWith("session_id="));if(t)return t.split("=")[1];var e="sess_"+new Date().getTime()+"_"+Math.random().toString(36).substr(2,9);return document.cookie="session_id="+e+"; path=/",e}();new growthbook.GrowthBook({apiHost:"<https://cdn.growthbook.io>",clientKey:"sdk-P3nTi9YufPFzCxgX",attributes:{id:o},enableDevMode:!0,subscribeToChanges:!0})}}window.growthbook?o():document.querySelector("#growthbook-sdk").addEventListener("load",o)}();
</script>
Regarding the loadFeatures - we are not using it, as we don’t use feature flags
We need just the visual front-end changes made in the Visual editor
s

swift-helmet-3648

10/18/2023, 4:25 PM
Ah, I see.
loadFeatures
is responsible for both loading features and experiments. It's necessary even if you only want to use the visual editor. Apologize for the slight misnomer, it's something we need to update eventually
n

nice-arm-56590

10/18/2023, 4:26 PM
Thank you for your message. So you say that this could be the reason why the experiments don't work?
s

swift-helmet-3648

10/18/2023, 4:26 PM
Yes. Very simply, experiments are not being loaded yet
n

nice-arm-56590

10/18/2023, 4:28 PM
Thanks a lot! We'll try and I get back with the update.
Thank you @swift-helmet-3648! It worked, we now see the experiments!
s

swift-helmet-3648

10/19/2023, 4:36 PM
Great - happy to help!
14 Views