Hi :wave: I have created a really simple A/B test ...
# ask-questions
g
Hi 👋 I have created a really simple A/B test (a text change) that has a split of 50/50. But I’m struggling to see the variation of my change on the website. Here is where I’m at: SDK is installed and connected (GTM) and data source is connected (GA4), DevTools is installed and debug mode is set to true, and I see the ID in devtools. But devtools says no experiment. The experiment is done by the Visual editor. Probably I’m missing something. Any idea?
1
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 🙏