---
title: CampaignEvents
slug: data-platform/connect-platform/app-sdk-api-reference-classes-campaignevents
docTags: 
createdAt: 2026-08-05T20:06:38.318Z
---

[OCP App SDK](docId\:gxEU_0AA37IEZJK-uoVcT)

***

[OCP App SDK](docId\:gxEU_0AA37IEZJK-uoVcT) / CampaignEvents

# Class: CampaignEvents

Defined in: [src/app/lib/CampaignEvents.ts:12](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L12)

A class to help batch and send campaign related events

## Constructors

### Constructor

:::BlockQuote
**new CampaignEvents**(`identifierField`, `tracking`, `type?`): `CampaignEvents`
:::

Defined in: [src/app/lib/CampaignEvents.ts:28](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L28)

### Parameters

### identifierField

`string`

the name of the identifier field used to target the user.
The identifier value provided to a campaign event must be for this identifier field name.

### tracking

`Partial`\<[`` `CampaignTracking` ``](docId:_Y51z0sBXv8LgvUff8RUc)>

Campaign tracking information to be included on every event.
Use an empty \{} if you plan to provide different tracking info for each event,
otherwise a complete CampaignTracking object.

### type?

`string`

### Returns

`CampaignEvents`

## Properties

### tracking

:::BlockQuote
**tracking**: `Partial`\<[`` `CampaignTracking` ``](docId:_Y51z0sBXv8LgvUff8RUc)>
:::

Defined in: [src/app/lib/CampaignEvents.ts:30](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L30)

Campaign tracking information to be included on every event.
Use an empty \{} if you plan to provide different tracking info for each event,
otherwise a complete CampaignTracking object.

## Methods

### click()

:::BlockQuote
**click**(`identifier`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:100](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L100)

Send a campaign click event

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>

***

### delivery()

:::BlockQuote
**delivery**(`identifier`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:80](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L80)

Send a campaign delivery event

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>

***

### disengage()

:::BlockQuote
**disengage**(`identifier`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:120](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L120)

Send a campaign disengage event

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>

***

### engage()

:::BlockQuote
**engage**(`identifier`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:110](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L110)

Send a campaign engage event

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>

***

### event()

:::BlockQuote
**event**(`identifier`, `action`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:58](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L58)

Send a campaign related event

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### action

[`` `CampaignAction` ``](docId\:Ch-WAvhqPVFKOslxyco4C)

the campaign action

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>

***

### flush()

:::BlockQuote
**flush**(): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:45](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L45)

Flush all API batches. You MUST flush before your task exists if you generated any events.

### Returns

`Promise`\<`void`>

***

### hardBounce()

:::BlockQuote
**hardBounce**(`identifier`, `reason`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:132](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L132)

Send a campaign hard bounce event, which means you were unable to deliver AND
the identifier is definitely no longer reachable. E.g., an invalid address.

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### reason

`string`

a human readable reason for the hard bounce

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>

***

### open()

:::BlockQuote
**open**(`identifier`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:90](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L90)

Send a campaign open event

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>

***

### optIn()

:::BlockQuote
**optIn**(`identifier`, `reason`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:201](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L201)

Send a campaign related opt-in event, such as, when a customer re-subscribes or replies UNSTOP to an SMS.
This is considered a consent opt-in for the identifier.

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### reason

`string`

a human readable reason for the opt-in

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>

***

### optOut()

:::BlockQuote
**optOut**(`identifier`, `reason`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:179](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L179)

Send a campaign related opt-out event, such as, when a customer unsubscribes or replies STOP to an SMS.
Consent will be revoked on the identifier.

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### reason

`string`

a human readable reason for the opt-out

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>

***

### softBounce()

:::BlockQuote
**softBounce**(`identifier`, `reason`, `ts?`, `data?`): `Promise`\<`void`>
:::

Defined in: [src/app/lib/CampaignEvents.ts:155](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/app/lib/CampaignEvents.ts#L155)

Send a campaign soft bounce event, which means you were unable to deliver,
but the identifier may still be reachable. E.g., the provider is temporarily unavailable.

### Parameters

### identifier

`string`

the identifier value / target identifier value related to this event

### reason

`string`

a human readable reason for the soft bounce

### ts?

the time of the event. If left blank, the recevied time will be used.

`string` | `number` | `Date`

### data?

`EventData`

additional event data to add to the event

### Returns

`Promise`\<`void`>
