Optimizely will be sunsetting Full Stack Experimentation on July 29, 2024. See the recommended Feature Experimentation migration timeline and documentation.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Get Enabled Features

This topic describes the Get Enabled Features method, which retrieves a list of features that are enabled for the user.

Retrieves a list of features that are enabled for the user. Invoking this method is equivalent to running Is Feature Enabled for each feature in the datafile sequentially.

This method takes into account the user attributes passed in, to determine if the user is part of the audience that qualifies for the experiment.


SDK v1.0 and higher


This method iterates through all feature flags and for each feature flag invokes Is Feature Enabled. If a feature is enabled, this method adds the feature’s key to the return list.

entities.UserContextHolds information about the user, such as the userID and the user's attributes.


A list of keys corresponding to the features that are enabled for the user, or an empty list if no features could be found for the specified user.


This section shows a simple example of how you can use the method.

attributes := map[string]interface{}{
        "DEVICE": "iPhone",
        "hey":    2,

user := entities.UserContext{
        ID:         "userId",
        Attributes: attributes,

isEnabled, err := optlyClient.GetEnabledFeatures(user)

Side effects

The table lists other Optimizely functionality that may be triggered by using this method.

ImpressionsAccessing this method triggers an impression if the user is included in an active feature test.
NotificationsInvokes the DECISION [notification] if this notification is subscribed to.

The example code below shows how to add and remove a decision listener.

import (


// Callback for decision notification
	callback := func(notification notification.DecisionNotification) {

		// Access type on decisionObject to get type of decision
		// Access decisionInfo on decisionObject which
		// will have form as per type of decision.

	optimizelyClient, err := optimizelyFactory.Client()

	// Add callback for decision notification
	id, err := optimizelyClient.DecisionService.OnDecision(callback)

	// Remove callback for decision notification
	err = optimizelyClient.DecisionService.RemoveOnDecision(id)



Source files

The language/platform source files containing the implementation for Go is Go.