# Custom Events

Zipy provides a way for customers to attach custom events and properties to their session replays via the logEvent function. These custom events help with enhancing insights on user journeys, highlighting important business events, and building custom analytics. The session data can also be filtered based on the custom events for focused analysis.

To log custom events based on any business logic, clicks or page visits, use the following method after initializing Zipy

```
window.zipy.logEvent('<custom event name>', {
    '<property_name>': '<property_value>',
    '<property_name>': '<property_value>',
    '<property_name>': '<property_value>'
});
```

Here is an example:&#x20;

```javascript
window.zipy.logEvent('Payment_successful', {
       plan: "enterprise",
       payment_mode: "card"
});
```

* Custom events allow you to track specific user actions or behaviors that are unique to your application and business logic.
* You can instrument events for actions such as button clicks, form submissions, page navigation, errors, or any other user interactions that are important for your analysis.
* This enables you to visualize and analyze the entire user experience from start to finish and get to important segments in user journeys faster.

There are a few limitations to consider when specifying properties for Custom Events:

* Event names and Property names are strings that should be under 250 characters
* Maximum of 5 properties can be set per event.&#x20;

Please reach out to support for any further questions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zipy.ai/product-features/custom-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
