# Send custom events

> Send events with JavaScript or HTML attributes, and correct their names.

> **Caution**
> Do not put names, email addresses or other personal data in an event name or a property.

There are no goals to set up. An event shows with its properties when it arrives.

## With JavaScript

```js
window.checkend('Signup', { props: { plan: 'pro' } });
```

To send events before the script loads, add this before the first call:

```html
<script>
  window.checkend = window.checkend || function () { (window.checkend.q = window.checkend.q || []).push(arguments) };
</script>
```

## With HTML

```html
<button data-ck="Signup" data-ck-plan="pro">Sign up</button>
```

A click sends the event `Signup` with the property `plan`.

## Limits

| Item | Limit |
| --- | --- |
| Event name | 120 bytes |
| Properties in one event | 30 |
| Property name | 300 bytes |
| Property value | 2,000 bytes |

Checkend stores each value as text.

## Correct the names

Checkend finds three types of name problem:

- **Duplicate:** two names for the same event.
- **Wrong site:** the name starts with the name of one of your other sites.
- **Style:** the names do not use one style.

You can merge, rename or hide a name on the Events page. Checkend does not change the raw events.

## Prompt for a coding agent

```text
Add a Checkend custom event to this project.
1. Ask me for the name of the event and the action that sends it. Use Title Case for the name.
2. Send it with window.checkend('Event Name', { props: { key: 'value' } }) or with data-ck attributes.
3. Do not put names, email addresses or other personal data in the name or the properties.
4. Show me the change. Stop before you deploy and wait for my approval.
```
