This message was deleted.
# ask-questions
w
This message was deleted.
s
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
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
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
Thank you for your message. So you say that this could be the reason why the experiments don't work?
s
Yes. Very simply, experiments are not being loaded yet
n
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
Great - happy to help!
136 Views