Back to Admin Dashboard
AI & Knowledge · Admin Guide
Floating Agent & Deployment
How Katie’s floating chat bubble gets onto every page of the site automatically, and how to stop it appearing on specific pages. Written for admins and analysts — no code editing required for the day-to-day task of adding or removing an exclusion.
v1.0
1

What is the Floating Agent?

The small “Chat with Katie” bubble that sits fixed in the bottom-right corner of the screen, on top of whatever page a visitor is looking at. Clicking it opens a compact chat panel — open-ended questions, answered from Katie’s real knowledge base (see the Knowledge Management Guide for how that side works).

In plain English: this guide is only about where the bubble appears and how to keep it off a page — not about what Katie knows or how she answers. For that, see the Knowledge Management Guide linked above.
2

How it gets onto every page

Nobody adds the bubble to pages one at a time. It’s injected automatically, sitewide, through a single WPCode snippet:

  1. WPCode → Snippet Manager → “Floating Agent” (snippet ID 3125) is set to run in the Site-Wide Footer location — meaning WordPress automatically echoes it at the bottom of every single page load, with no manual placement needed anywhere.
  2. That snippet’s content pulls in deploy_floating_agent.php, the file that actually builds and prints the bubble’s HTML/CSS/JS.
  3. Before it renders anything at all, the very first thing that file does is check the current page’s URL against an exclusion list. If the current page matches, the file exits immediately — nothing is drawn, nothing loads.
Why this matters for you: because deployment is sitewide by default, the exclusion list is the only control that decides where Katie’s bubble does not show up. There’s no separate on/off switch per page anywhere else.
3

Excluding a page — step by step

The exclusion list lives right at the top of deploy_floating_agent.php, as a plain array of URL fragments:

$excluded_paths = array(
    '/assessment/',               
    '/risk-analytics-biometric/', 
    '/admin-knowledge-manager/',  
);

$current_path = $_SERVER['REQUEST_URI'];
foreach ($excluded_paths as $path) {
    if (stripos($current_path, $path) !== false) {
        return; 
    }
}

To add or remove a page, via WPCode (no file editing needed):

  1. Go to WPCode → Snippet Manager in the WordPress admin sidebar.
  2. Open the snippet titled “Floating Agent” (ID 3125, location: Site-Wide Footer).
  3. Find the $excluded_paths array near the very top of the code.
  4. To exclude a new page, add a line inside the array with the page’s URL path, in quotes, ending with a comma — e.g. '/my-page/',.
  5. To stop excluding a page, delete its line from the array.
  6. Click Update to save the snippet.
⚠️ The match is a substring match, not an exact page match. stripos() checks whether the path appears anywhere in the current URL, case-insensitively — it isn’t anchored to the whole path. So '/assessment/' also excludes any URL that contains that text anywhere, such as /assessment/some-sub-page/. Keep this in mind if you ever add a short or generic-looking path — it may catch more pages than intended.
4

Pages currently excluded

Path Likely reason
/assessment/ This page already has its own dedicated “Ask Katie” interface built in — the floating bubble would be a redundant second copy of the same conversation.
/risk-analytics-biometric/ A data-heavy analytics page; the floating bubble likely isn’t wanted on top of charts/results here.
/admin-knowledge-manager/ Internal admin tool for managing Katie’s own knowledge — not a customer-facing page, so the customer-facing chat bubble has no reason to appear.

Reasons above are inferred from what each page does, not stored anywhere in code — worth confirming with whoever originally added each exclusion if you need certainty.

5

Files involved

📄
agents/floating_agent/deploy_floating_agent.php
The file loaded by the WPCode “Floating Agent” snippet. Contains the exclusion list, and builds the bubble’s HTML/CSS/JS for every page that isn’t excluded.
📄
agents/floating_agent/floating_backend.php
Server-side handler for the floating widget — saves chat logs, and answers “Ask a Question” mode via Katie’s real knowledge base (port 8420). Formerly lived at agents/triage_agent/triage_backend.php; moved here because the triage agent now has its own separate backend.
🧩
WPCode snippet: “Floating Agent” (ID 3125)
Location: Site-Wide Footer. This is what actually gets the widget onto every page — not a theme file, not a plugin, a WPCode snippet.
6

Worth verifying Unconfirmed

deploy_floating_agent.php loads its backend with:

require_once get_stylesheet_directory() . '/agents/floating_agent/backend_floating.php';

— but the backend file’s own header comment identifies itself as living at:

agents/floating_agent/floating_backend.php
⚠️ These are two different filenamesbackend_floating.php vs. floating_backend.php — not just a formatting difference. If the file on the server is genuinely only named floating_backend.php, that require_once would fail outright. Worth a quick check next time anyone is on the server (File Manager or SSH, in agents/floating_agent/) to confirm which filename actually exists, and to make sure both files aren’t quietly sitting there as accidental duplicates of each other.
💬

Katie AI

Swap Voice ↻
💡 Guided Triage mode active.