# Hooks

Hooks allow executing custom JavaScript functions upon interacting with slides. For example, calling a third-party tracking endpoint when the next button of a form slide is clicked. Each slide-type defines different hook types that can be configured on each slide JavaScript section:

![](/files/-M5CS7Mn66h6G9owoM6x)

In order to define a hook on a slide, we need to define the hook type and a callback function. The callback function includes two parameters: a *done* function and an optional *data* parameter. The *done* function has to be called after the custom code has been executed, otherwise, the default flow will be interrupted. The *data* parameter contains contextual information related to the hook. The extension parameter is an internal parameter needed to define the hook.

### Hook types

* **Question slide**
  * **onSelect**: Executed when an option is clicked. The data parameter contains the index of the selected option.
  * **onSkip**: Executed when the Skip button is clicked.
  * **onNext**: Executed when the Next button is clicked.
* **Form slide**
  * **onSend**: Executed when the Next button is clicked.
  * **onSkip**: Execute when the Skip button is clicked.

####


---

# 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://help.pickzen.com/developers/api/hooks.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.
