---
title: Activate
slug: web-experimentation/api/RPVP-activate
docTags: 
createdAt: 2026-08-05T20:56:17.000Z
---

Trigger a snippet activation. The snippet "activation" phase is where

- The visitor's IDs are read from cookies, and if updated, data for that visitor is read from storage.
- Immediately activated pages are activated.
- All other pages are queued for activation.
- Information about the environment, such as previous behavior and data from third parties, are fetched.
- A snippet activation event is tracked and a new `activationId` created to distinguish from the prior activation.

In this way, calling the `activate` API is analogous to loading Web Experimentation in a new page view but without requiring the page to be reloaded. This is especially useful in a single-page app context to enable the views of a single-page app to emulate the behavior of Web Experimentation in multi-page websites.

You can use this method to activate the snippet, if you have disabled auto-execution.

### Syntax

```javascript
window["optimizely"].push(activate);
```

### Parameters

| Parameter and Type            | Child Attribute                        | Description                                                                                           |
| ----------------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **activate** *ActivateObject* | N/A                                    | An object with the type field set to activate. The other fields are the function arguments. Required. |
| **type** *string*             | Child attribute of type ActivateObject | The argument indicating that you are using the activate function. Required.                           |

### Example call

```javascript
// ensures the optimizely object is defined globally
window['optimizely'] = window['optimizely'] || [];

// sends the activate push to the Optimizely snippet
window["optimizely"].push({
  "type": "activate"
});
```
