> For the complete documentation index, see [llms.txt](https://docs.cekat.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cekat.ai/en/marketing/events.md).

# Events

Events is where you create and manage custom events: events specific to your business that you send from your own server or app, such as “Trial started” or “Subscription renewed”. You can use custom events in Analytics and Segmentation, and send them to ad platforms as conversions.

Cekat offers several ready-to-use SDKs for popular programming languages, plus a plain HTTP option and a prompt for coding assistants. Your developers just pick the one that fits.

## Open a custom event

1. In the top navigation, click the Marketing tab.
2. In the left sidebar, click the Events icon (lightning icon).
3. Click the Custom tab.
4. Pick an event from the list, such as Custom Event Untuk Test.

Event details have three tabs: Overview, Set up, and Test & activity. To change the event, click Edit. To delete it, click the trash icon.

<figure><img src="https://content.gitbook.com/content/zFvvakHJ5OVubOo4WKlR/blobs/UisaSI8JFACTr2gUpipJ/Unknown%20image" alt="Figure 1. Open the Custom tab (1), pick an event (2), open a detail tab (3), or Edit/delete the event (4)."><figcaption></figcaption></figure>

## Read custom event details

The Overview tab shows the event's status, when it was last received, its source (API), and its type (Custom). Below that are two tables:

* Who it belongs to: the contact the event belongs to. Send `phone_number`, `email`, or both. At least one is required. `contact_name` is optional.
* What this event records: the event's properties with their type and key. All properties are optional.

To send this event to Meta, TikTok, or Google as a conversion, click Use it to optimise ads.

<figure><img src="https://content.gitbook.com/content/zFvvakHJ5OVubOo4WKlR/blobs/RFjzJ8yHj0k4MHk90PYs/Unknown%20image" alt="Figure 2. Required contact data (1), event properties (2), and the button to send the event as an ad conversion (3)."><figcaption></figcaption></figure>

## Create a custom event

1. Click New event.
2. In Name, type the event name, such as “Trial started”.
3. In Key, type the key your server will send, such as `trial_started`.
4. Optional: fill in Description. It also tells your coding assistant when to fire the event.
5. Optional: click Add property for anything you want to filter, chart, or send as a conversion value, such as an amount, a plan, or an order ID.
6. Click Create event.

Properties are type-checked when the event arrives, so data with the wrong type is caught.

<figure><img src="https://content.gitbook.com/content/zFvvakHJ5OVubOo4WKlR/blobs/yZ6RiMFOO1cXG2RU9ijT/Unknown%20image" alt="Figure 3. Enter the name (1), key (2), and description (3), add properties (4), then click Create event (5)."><figcaption></figcaption></figure>

## Set up a custom event

The Set up tab guides you through sending the event from your system.

1. Under Send this event from your system, pick the SDK for the language your team uses. If none fits, pick the HTTP option. To have a coding assistant write the code, pick the AI prompt option.
2. Tick Use my API key to use your API key in the code samples.
3. Follow the steps shown: install the SDK, then send the event right after the action happens.

<figure><img src="https://content.gitbook.com/content/zFvvakHJ5OVubOo4WKlR/blobs/WTnwTvMv3Gkz1NogPwdZ/Unknown%20image" alt="Figure 4. Pick an SDK or sending method (1), tick Use my API key (2), then follow the install steps (3)."><figcaption></figcaption></figure>

### Match events to campaigns

The Match events to campaigns step (recommended) lets Cekat know which ad or campaign the customer came from. Choose one way:

* Add middleware (easiest): add one line, once, and every event is matched automatically.
* Without middleware: use this if your framework isn't listed. You read and send the visitor ID yourself.

<figure><img src="https://content.gitbook.com/content/zFvvakHJ5OVubOo4WKlR/blobs/ScraYWLEFaahLpNmjV1J/Unknown%20image" alt="Figure 5. Match events to campaigns (1). Choose Add middleware or Without middleware (2)."><figcaption></figcaption></figure>

## Test a custom event

Before you set it up on your server, you can send a test event straight from Cekat.

1. Open the Test & activity tab.
2. Edit the sample JSON in Editable JSON. It's checked as you type. When it's valid, you see “Looks right. Identifiers and property types check out.”
3. Click Send test event.

A test event is recorded as a real event on the contact in the payload, just like one from your server. To restore the sample, click Reset.

<figure><img src="https://content.gitbook.com/content/zFvvakHJ5OVubOo4WKlR/blobs/HV8gbfExX5D5YcuEeIYl/Unknown%20image" alt="Figure 6. Open Test &#x26; activity (1) and edit the JSON payload (2)."><figcaption></figcaption></figure>

Recent events lists the last 10 events received. Rejected requests aren't stored. Click the refresh icon to update the list.

<figure><img src="https://content.gitbook.com/content/zFvvakHJ5OVubOo4WKlR/blobs/iAFveF3dVsGGSsBUAeVM/Unknown%20image" alt="Figure 7. Make sure the payload is valid (1), click Send test event (2), then check Recent events (3)."><figcaption></figcaption></figure>

## Built-in events

Besides custom events, Cekat records built-in events automatically, with no extra code:

* Website: such as page views, WhatsApp clicks, and form submissions. These are recorded once the snippet is installed in Website tracking.
* Call: bookings, cancellations, and no-shows from the Calendly integration.
* Order: orders created and orders paid.
