---
title: Activate widgets
slug: commerce-connect-15/docs/activate-widgets
docTags: 
createdAt: 2026-07-30T20:34:43.000Z
---

Optimizely Product Recommendations defines two key concepts:

- **Tracking types** – Visitor actions that can be tracked. See [Track and recommend](docId\:JCAke4mTwtBmKhFvuutqX).
- **Widgets** – Display recommendations based on tracking-type calculations. See [Product Recommendations](docId\:P0rOMcgO6DeEMy0-FiMkP).

When an environment is set up, it has the following Commerce Connect-specific widgets. Widgets are configured for only a subset of the available tracking types — see `TrackingTypes` in the [Commerce Connect APIs and libraries](https://world.optimizely.com/documentation/class-libraries/commerce/) for the full list.

![Default Commerce Connect widget configuration in the Recommendations portal, showing widgets configured for five tracking types](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/XVn35Z-oKUNV__0buXZAA-20260723-164625.png)

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

See `SiteInitialization.cs` in the [Quicksilver sample site](https://github.com/episerver/Quicksilver) for a working example. The following snippet shows how to enumerate the widgets returned by `WidgetService` and activate each one:

```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);
}
```
