This message was deleted.
# ask-questions
w
This message was deleted.
1
g
Here are some screens:
Copy code
<script id="growthbook-sdk" src="<https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/index.min.js>" defer></script>

<script>
  (function() {
    // Wait for the SDK to load before starting GrowthBook
    if (window.growthbook) {
      startGrowthbook();
    } else {
      document.querySelector("#growthbook-sdk").addEventListener("load", startGrowthbook);
    }

    function startGrowthbook() {
      
      if (!window.growthbook) return;
      
      var id = document.cookie.match(/_ga=(.+?);/)[1].split('.').slice(-2).join('.');
                console.log("ID:", id);
      
      var gb = new growthbook.GrowthBook({
        apiHost: "<https://cdn.growthbook.io>",
        clientKey: "{{GrowthBook - Client Key}}",

        enableDevMode: true,
        
        attributes: {
          id: id
        },

        trackingCallback: function(experiment, result) {
          console.log("Experiment Viewed", {
            experimentId: experiment.key,
            variationId: result.key,
          });
        },
      });
    }
  })();
</script>
f
You should call loadFeatures()
somewhere there
at the end
g
Thanks 🙏
134 Views