# Hooks

### Hooks Settings

<figure><img src="/files/sH8NKBPo4Tqd0LAj7ssk" alt=""><figcaption></figcaption></figure>

<table data-header-hidden><thead><tr><th width="196.22216796875"></th><th></th></tr></thead><tbody><tr><td><strong>Option</strong></td><td><strong>Description</strong></td></tr><tr><td><strong>Top Hook</strong></td><td>Enable and paste your custom code. Executes <strong>after the opening <code>&#x3C;body></code> tag</strong>.</td></tr><tr><td><strong>Content Before Hook</strong></td><td>Enable and paste your code. Executes <strong>before the opening <code>&#x3C;#primary></code> tag</strong>.</td></tr><tr><td><strong>Content After Hook</strong></td><td>Enable and paste your code. Executes <strong>after the closing <code>&#x3C;/#main></code> tag</strong>.</td></tr><tr><td><strong>Bottom Hook</strong></td><td>Enable and paste your custom code. Executes <strong>after the closing <code>&#x3C;/body></code> tag</strong>.</td></tr><tr><td><strong>Enable Tracking Code</strong></td><td>YES! to enable Google Analytics or any other tracking scripts.</td></tr><tr><td><strong>Google Analytics Code</strong></td><td>Enter your tracking ID (<code>UA-XXXXX-X</code>) or paste the full script. Optionally, use <code>[dt_sc_privacy_google_tracking]</code> shortcode to allow users to opt-out.</td></tr></tbody></table>

#### Example Usage

* **Top Hook** → Insert site-wide popup script.
* **Content Before Hook** → Add an advertisement banner before content.
* **Content After Hook** → Insert newsletter signup box after content.
* **Bottom Hook** → Add chat widget script (e.g., Tawk.to, LiveChat).
* **Google Analytics Code** → Enter `UA-123456-7` to enable tracking.


---

# 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://wdt-kirki.gitbook.io/wdt-kirki/designthemes-theme-options/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.
