Hi, we have been successfully running experiments ...
# ask-questions
p
Hi, we have been successfully running experiments using the Visual Editor (on Shopify, using Javascript). Now we want to run some more sophisticated experiments using feature flags. This is the code we are using as feature flag:
Copy code
const quizId = window.gb && window.gb.isOn('quiz_subcategories') ? 'id_one' : 'id_two';
The experiment itself seems to be working fine, i.e. the IDs are switched. (tested by previewing the experiment variations) However, the trackingCallback is not triggered. It has been (and is in other experiments) working fine for the Visual Editor though. It seems the SDK is not picking up on the this feature flag. Do we need to add some kind of targeting or activation code? The feature flag was setup in GB and liked to the experiment
This is the payload load via the SDK
A screenshot of the code snippet for more context
w
Hi Sascha, are you setting the deviceId attribute of the growthbook object?
p
Hi James. Yes,
deviceId
is set in the SDK attributes. Have been using it in other experiments without issues.
w
Do you have a debug environment set up where you can use the Growthbook Dev Extension? https://chrome.google.com/webstore/detail/growthbook-devtools/opemhndcehfgipokneipaafbglcecjia
p
Not a dev environment, but I have the Chrome extension installed and checked it there (we use an
internal_user
flag to not actually send the data to GA4, but dataLayer push should still happen - and does for other experiments). So we can test without polluting the data. dac23-065 experiment corresponds to the "quiz_subcategories" feature flag
Nevermind, I had a logic error in the dataLayer push logic since the feature flag doesn't happen during page load. Sorry for wasting your time
w
No worries. Glad you found it.