> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# subscribe Event

> Track when a visitor opts in to email or SMS marketing

Fires when a visitor opts in to email or SMS marketing.

## Example

```javascript theme={null}
window._upstack('track', 'subscribe', {
  // Standard parameters
  value: 5.00,
  currency: 'USD',
  formId: 'newsletter_popup',

  // User data
  email: 'jane@example.com',
  phone: '+15551234567',
  firstName: 'Jane',
  lastName: 'Smith',

  // Custom data
  channel: 'email',
  source: 'newsletter_popup'
});
```

## Standard parameters

| Name | Type | Required | Example value | Description |
| - | - | - | - | - |
| [`value`](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/value) | `number` | No | `5.00` | What this conversion is worth to you. |
| [`currency`](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/currency) | `string` | Yes\* | `USD` | ISO 4217 currency code. |
| [`formId`](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/form-id) | `string` | No | `newsletter_popup` | Your form ID. |

\* Required if you send `value`.

## User data

| Name | Type | Required | Example value | Description |
| - | - | - | - | - |
| [`email`](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/email) | `string` | Yes | `jane@example.com` | Email address. |
| [`phone`](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/phone) | `string` | Yes\* | `+15551234567` | Phone number in E.164 format. |
| [`firstName`](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/name) | `string` | Yes\* | `Jane` | First name. |
| [`lastName`](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/name) | `string` | Yes\* | `Smith` | Last name. |
| [`addresses`](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/address) | `Array<Address>` | No | [See address parameters](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/address.md) | Shipping and billing addresses. |

\* Required if you have it.

On an SMS sign-up, send `phone` instead of `email`.

## Custom data

Examples for this event. See [how custom data works](https://docs.upstackdata.com/event-tracking/event-taxonomy/properties/custom-data.md).

| Name | Type | Example value | Description |
| - | - | - | - |
| `channel` | `string` | `email` | The opt-in channel: `email` or `sms`. |
| `source` | `string` | `newsletter_popup` | Where the person came from on your site. |

## Related events

* [`lead`](https://docs.upstackdata.com/event-tracking/event-taxonomy/standard-events/lead) — A visitor submits a lead form.
* [`complete_registration`](https://docs.upstackdata.com/event-tracking/event-taxonomy/standard-events/complete-registration) — A visitor finishes creating an account.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.