# Ghost CMS

## Add Humblytics Analytics to Ghost CMS

### 1 · Sign up (or log in)

Visit humblytics.com → Start Free Trial. Finish signup—or log in to your existing workspace.

### 2 · Add your website in Humblytics

In the sidebar, click **Add Website**.

* **Domain** – enter `your-domain.com` (omit `https://` and `www`)
* **Site Name** – internal label (e.g. `Blog-Prod`)

Copy the snippet from **Install Tracking Code**:

html

```html
<!-- Start Humblytics Tracking Code -->
<script async src="https://app.humblytics.com/hmbl.min.js?id=YOUR_ID_HERE"></script>
<!-- End Humblytics Tracking Code -->
```

Keep this tab open—we'll return and click **Verify Website** once the tag is live.

### 3 · Add the script to your Ghost site

#### Option 1: Code Injection (recommended)

**Best for:** Managed Ghost(Pro) or self-hosted Ghost without custom theme development

1. Go to your **Ghost Admin Dashboard**
2. In the sidebar, click **Settings → Code Injection**
3. Under **Site Header**, paste your Humblytics snippet:

html

```html
<script async src="https://app.humblytics.com/hmbl.min.js?id=YOUR_ID_HERE"></script>
```

4. Click **Save**

Ghost will automatically inject this into the `<head>` of every page.

#### Option 2: Theme Files

**Best for:** Custom themes or multiple environments (staging/production with different tracking IDs)

1. Download your active theme:
   * Go to **Settings → Design**
   * Click the **⋮** menu next to your active theme
   * Select **Download**
2. Extract the theme and open `default.hbs` (or your theme's main layout file)
3. Locate the closing `</head>` tag and paste your script just above it:

html

```html
  <script async src="https://app.humblytics.com/hmbl.min.js?id=YOUR_ID_HERE"></script>
</head>
```

4. Zip the modified theme and re-upload:
   * Go to **Settings → Design**
   * Click **Upload theme**
   * Select your modified theme zip file

**Note**: Replace `YOUR_ID_HERE` with your actual project ID from Humblytics.

### 4 · Verify installation

1. Return to Humblytics and click **Verify Website**
2. Open your live Ghost site in a private/incognito window and refresh once
3. Within \~30 seconds you should see a green **Verified** badge and live visitor count

**If verification fails, check:**

* Script ID matches your project in Humblytics
* You clicked **Save** in Code Injection (or uploaded the modified theme)
* You're testing on the correct domain (not localhost)
* No browser extensions or ad-blockers are interfering

### 5 · Explore & optimize

* **Dashboard** – view traffic, top posts, and referrers
* **Heatmaps** – auto-generated from real user interactions
* **Experiments** – run A/B tests on your Ghost pages (Experiments → New Test)


---

# 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.humblytics.com/how-to-get-started/ghost-cms.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.
