---
title: Activate widgets
slug: commerce-connect-14/docs/activating-widgets
docTags: 
createdAt: 2026-07-23T10:25:33.361Z
---

The following are key concepts within Optimizely Recommendations:

- *Tracking types*, define visitor actions that can be tracked, see [Tracking and recommendations](docId\:mZ8qu7OM0lX1uUk-Uc5hb).
- *Widgets*, displays recommendations based on tracking type calculations, see [Recommendations](docId\:P0rOMcgO6DeEMy0-FiMkP).

When a new environment is set up, it has the following Customized Commerce-specific widgets. Note that widgets are only configured for five of the eleven tracking types. See `TrackingTypes`in the [Customized Commerce class library](https://world.optimizely.com/documentation/class-libraries/commerce/) for the full list.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/efdNQcwh7nbv_cVzwALL0-20260723-094604.png)

In a new environment, all widgets are inactive. Before you can track and receive recommendations, you must activate them by using the `WidgetService` within `EPiServer.Personalization.Commerce`.

Sample code is provided in the `SiteInitialization.cs` file in the Optimizely Commerce Connect sample site source code. See [Quicksilver on GitHub](https://github.com/episerver/Quicksilver).

```csharp
var widgetService = context.Locate.Advanced.GetInstance < WidgetService > ();
var response = widgetService.GetWidgets();

foreach(var widget in response.EpiPerPage.Pages.SelectMany(x => x.Widgets)) {
  widget.Active = true;
  widgetService.UpdateWidget(widget);
}
```
