# Site Hooks

**Site Hooks** let you insert custom code or content at specific locations on your website without modifying theme files. The **Top Hook** places content at the very top of your site, above all elements.

{% hint style="success" %}
**Steps to Configure Site Hooks:**

1. **Login** to your WordPress admin dashboard.
2. Navigate to **Appearance > Customize**.
3. Select **Site Hooks** from the Customizer panel.
4. Choose the desired hook (e.g., *Top Hook*) and add your custom content or code.
5. Click **Publish** to apply your changes.
   {% endhint %}

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

#### **Site Hooks Settings Overview**

**Site Hooks** allow you to insert custom code or content at key structural points of your website without editing theme files. Below are the available hook options and their functions:

***

**Top Hook**

* **Enable Top Hook**: Toggle to show or hide this hook.
* **Top Hook**: Add custom code that runs **immediately after the opening `<body>` tag**.

***

**Content Before Hook**

* **Enable Content Before Hook**: Toggle to enable or disable this hook.
* **Content Before Hook**: Insert code that executes **before the opening `<#primary>` tag** (typically the main content wrapper).

***

**Content After Hook**

* **Enable Content After Hook**: Toggle to show or hide this hook.
* **Content After Hook**: Add code that executes **right after the closing `</#main>` tag** (end of the main content area).

***

**Bottom Hook**

* **Enable Bottom Hook**: Toggle to enable or disable the bottom hook.
* **Bottom Hook**: Insert custom code that executes **just before the closing `</body>` tag**.

***

**Tracking Code**

* **Enable Tracking Code**: Turn on or off the inclusion of tracking scripts.
* **Google Analytics Tracking Code**: Paste your **Google Analytics Tracking ID** (e.g., `UA-XXXXX-X`).\
  You may also allow users to **opt out of tracking** by using the shortcode:\
  `dt_sc_privacy_google_tracking` anywhere on your site.


---

# 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://buddhathemes-test.gitbook.io/ogie/theme-customizer/site-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.
