---
title: Update from older versions of the Go SDK
slug: feature-experimentation/docs/migrate-from-older-versions-go
docTags: 
createdAt: 2026-08-05T20:40:01.000Z
---

This section provides code examples for how You should leveraging the new [Decision](docId\:BlCsg45md_3l5fQuAUQwO) and [Event Tracking](docId\:LcdvFIfZ7GfSxd1M1qb_N) APIs. All existing [Full Stack (Legacy)](docId:6_ik6SSz-WyJLWuCQw7BT) methods and implementation are still supported. See [Optimizely Feature Experimentation - application & migration](docId\:bykQnE4aGRkC5WXhU6Yi5) documentation for the latest updates.

You should adopting the new `Decide`, `Decide All`, and `Track Event` methods as a more flexible and easier-to-use replacement where you currently use `isFeatureEnabled`, `getFeatureVariable`, `getAllFeatures`, or `Track` calls within your implementation.

The following are examples of how to migrate the Full Stack (Legacy) methods to Feature Experimentation methods:

```go
// -------------------------------
// Prereq for new methods: create a user
// ------------------------------
user := optlyClient.CreateUserContext("user_123", map[string]interface{}{"is_logged_in": true})

// -------------------------------
// Is Feature Enabled
// ------------------------------
// old method
enabled, _ := optlyClient.IsFeatureEnabled("flag_1", entities.UserContext{ID: "user_123", Attributes: map[string]interface{}{"is_logged_in": true}})

// new method

decision := user.Decide("flag_1", []decide.OptimizelyDecideOptions{})
enabled = decision.Enabled

// -------------------------------
// Activate & Get Variation
// ------------------------------
// old method
variationKey, _ := optlyClient.Activate("experiment_1", entities.UserContext{ID: "user_123"})
// new method
variationKey = decision.VariationKey



// -------------------------------
// Get All Feature Variables
// ------------------------------
// old method
allVarValues, _ := optlyClient.GetAllFeatureVariables("flag_1", entities.UserContext{ID: "user_123"}) 
// new method
allVarValues = decision.Variables


// -------------------------------
// Get Enabled Features
// ------------------------------
// old method
enabledFlags, _ := optlyClient.GetEnabledFeatures(entities.UserContext{ID: "user_123"})

// new method
decisions := user.DecideAll([]decide.OptimizelyDecideOptions{decide.EnabledFlagsOnly})
enabledFlags = []string{}
for k := range decisions {
  enabledFlags = append(enabledFlags, k)
}


// -------------------------------
// Track
// ------------------------------
// old method
optlyClient.Track("my_purchase_event_key", entities.UserContext{ID: "user_123", Attributes: attributes}, map[string]interface{}{"purchase_count": 2})

// new method
user.TrackEvent("my_purchase_event_key", map[string]interface{}{"purchase_count": 2})
```
