nutritious-beach-21644
08/11/2023, 11:06 PMThe feature is disabled for the environment you are in (dev/prod)
. I see my environment turned "on" for the feature in question.
• It states that I could be missing a hashAttribute. in the feature view, I see SPLIT users by id
, and I am sending the browser-generated ID when I instantiate Growthbook:
attributes: {
id: growthbook_user_id
},
• It states that coverage could be an issue: I have my experiment coverage turned up to 100% traffic.
• It states that there is another feature rule taking precedence. I only have 1 feature and 1 experiment.
Finally, when I open the devtools, I can see my feature "lead-form-updates". When I run growthbook.evalFeature("lead-form-updates")
I see "source: unknownFeature"
{value: null, on: false, off: true, source: 'unknownFeature', ruleId: ''}
fresh-football-47124
nutritious-beach-21644
08/11/2023, 11:07 PMsource: 'unknownFeature'
message?fresh-football-47124
nutritious-beach-21644
08/11/2023, 11:09 PMif (typeof window !== 'undefined') {
// get existing growthbook user
const growthbook_user = window.sessionStorage.getItem("growthbook_user_id")
let growthbook_user_id
if (growthbook_user) {
growthbook_user_id = growthbook_user
} else {
// generate a growthbook userID and set it
growthbook_user_id = uuid()
window.sessionStorage.setItem("growthbook_user_id", JSON.stringify(growthbook_user_id))
}
growthbook = new GrowthBook({
apiHost: "<https://cdn.growthbook.io>",
clientKey: "sdk-cKFk90qAra2QhKcY",
attributes: {
id: growthbook_user_id
},
enableDevMode: true,
trackingCallback: (experiment, result) => {
console.log('wth')
// track using GA4
window.gtag("event", "experiment_viewed", {
event_category: "experiment",
experiment_id: experiment.key,
variation_id: result.variationId,
})
}
})
// Load features from the GrowthBook API
growthbook.loadFeatures()
if ("gtag" in window) {
window.dataLayer && window.dataLayer.push({
user_id: growthbook_user_id,
client_id: growthbook_user_id
})
}
}
fresh-football-47124
nutritious-beach-21644
08/11/2023, 11:10 PMfresh-football-47124
nutritious-beach-21644
08/11/2023, 11:10 PMfresh-football-47124
nutritious-beach-21644
08/11/2023, 11:12 PMfalse
.fresh-football-47124