---
title: Custom events
slug: data-platform/docs/websdk-custom-events
docTags: 
createdAt: 2026-08-10T12:05:14.000Z
---

## Format

The format for sending [custom events](docId\:w0DeSMy7YSyAm7PnwzGqq) in the ODP Web SDK is as follows:

```javascript
zaius.event("your_event_type_here", { 
    action: "your_event_action_here",
    example_custom_field: "example_value"
});
```

## Custom event examples

The following examples show Web SDK custom events and how those custom events display on the customer profile in ODP.

The value in the `campaign` event type displays on the customer profile. For example, if `campaign` is set to `Opticon Newsletter`, then Opticon Newsletter displays on the customer profile in ODP.

### Forms

```javascript
zaius.event('web_form', {
  action: 'impression', 
  form_name: 'Opticon Newsletter', 
  campaign: 'Opticon Newsletter' 
});  
```

```javascript
zaius.event('web_form', {
  action: 'submission', 
  form_name: 'Opticon Newsletter', 
  campaign: 'Opticon Newsletter' 
});
```

The custom event in the code sample above displays on the customer profile as shown below:

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/sDgLVRh8O9UUjdlypjIjF_e2b6532-form.png)

### Search

```javascript
zaius.event('navigation', {
  action: 'search', 
  search_term: 'opticon', 
  campaign: 'Search Term: opticon' });  

zaius.event('search', { 
  action: 'no_results' , 
  search_term: 'optcon', 
  campaign: 'Search Term: optcon' });  

zaius.event('search', { 
  action: 'click' , 
  search_term: 'opticon', 
  campaign: 'Content Result Click -- Search Term: opticon', 
  value: '<https://www.optimizely.com/opticon/>' 
});
```

The custom event in the code sample above displays on the customer profile as shown below:

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/XhRvkx5IZDi61uPDLhcOw_54a25b5-search.png)

## Other

```javascript
zaius.event('venue', { 
  action: 'visited', 
  enue_name: 'Stamford Stadium', 
  campaign: 'Stamford Stadium' 
});
```

The custom event in the code sample above displays on the customer profile as shown below:

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/vB1oBO3LgjVXv9PgaQaFH_c399472-other.png)
