# Web Injectors

## Overview

A unique feature that allows buttons (or any web CTAs) on the website to inject questions directly into the chat, guiding users back into the conversation and creating a cohesive user journey.

## Key Capabilities

* Universal integration with any website element (buttons, menus, CTAs, images)
* Instant prompt injection that maintains conversation context
* Customizable triggers that align with your business objectives
* Cross-page functionality that works throughout your entire website

{% embed url="<https://drive.google.com/file/d/1CRnhnGIgIrHkUkBAH4yE0pmG9wWUxNPJ/view?usp=sharing>" %}

## Implementation Guide

#### Prerequisites

* Your **Popup ID** (provided by your Satisfi Account Manager)
* Ability to add a script to your site (in `<head>` or before `</body>`)

### 1) Install the Embed Script

Place this on every page where you want Injectors to work:

{% code overflow="wrap" %}

```html
<script id="satisfiScript" src="https://chat.satis.fi/popup/embedder?popupId=YOUR_POPUP_ID"></script>
```

{% endcode %}

Replace `YOUR_POPUP_ID` with your actual ID.

### 2) Popup Control API

All controls live on `window.SatisfiApp.Global` once the embed loads. Call these from inline handlers or your JS.

[**Here’s a link to the popup injector controls demo**](https://d2.satisfi6.com/html/popup_injection_demo.html)

* **Open chat popup with a seeded message**

{% code overflow="wrap" %}

```html
SatisfiApp.Global.chatPopupOpen("Where should I park?");
```

{% endcode %}

* **Open and hide the input**

{% code overflow="wrap" %}

```html
SatisfiApp.Global.chatPopupOpen("Show me kid-friendly dining near downtown", "1");
```

{% endcode %}

Pass second argument “1” to hide the user input box.

* **Open / Close the popup**

{% code overflow="wrap" %}

```html
SatisfiApp.Global.chatPopupOpen();
SatisfiApp.Global.chatPopupClose();
```

{% endcode %}

* **Show / Hide the launcher button**

{% code overflow="wrap" %}

```html
SatisfiApp.Global.chatButtonShow();
SatisfiApp.Global.chatButtonHide();
```

{% endcode %}

### 3) Add Injectors to Your UI

* **Simple Buttons**

Drop this markup anywhere on your page.

{% code overflow="wrap" %}

```html
<button onclick="SatisfiApp.Global.chatPopupOpen('What’s the best route to Gate D95?')">
  Find my gate route
</button>

<button onclick="SatisfiApp.Global.chatPopupOpen('Show me premium ticket options', '1')">
  Premium tickets
</button>

<button onclick="SatisfiApp.Global.chatPopupClose()">
  Close assistant
</button>
```

{% endcode %}

* **B. Editable Prompt (Vanilla JS)**

Put the default text in the input `value`. Read it on click. jQuery is optional.

{% code overflow="wrap" %}

```html
<input id="ask" type="text" value="Family restaurants near Main Street?" />
<button onclick="SatisfiApp.Global.chatPopupOpen(document.getElementById('ask').value)">
  Ask
</button>
```

{% endcode %}

* **C. Link or Image Injector**

{% code overflow="wrap" %}

```html
<a href="#" onclick="SatisfiApp.Global.chatPopupOpen('Buy season tickets'); return false;">
  Buy Season Tickets
</a>

<img src="/img/seasontix.png" alt="SeasonTix"
     style="cursor:pointer"
     onclick="SatisfiApp.Global.chatPopupOpen('Buy season tickets')" />
```

{% endcode %}

### Recommended Injector Library (Examples)

{% tabs %}
{% tab title="Hero CTA Discovery" %}
{% code overflow="wrap" %}

```html
<button onclick="SatisfiApp.Global.chatPopupOpen('What can I ask about?')">
  What can I ask about?
</button>
```

{% endcode %}

<figure><img src="/files/GVCvLqC78oVAorVZrnZM" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Tickets Commerce" %}
{% code overflow="wrap" %}

```html
<button onclick="SatisfiApp.Global.chatPopupOpen('Show me Friday tickets')">
  Friday Tickets
</button>
```

{% endcode %}
{% endtab %}

{% tab title="Venue Support" %}
{% code overflow="wrap" %}

```html
<button onclick="SatisfiApp.Global.chatPopupOpen('Bag policy and entry times')">
  Entry policies
</button>
```

{% endcode %}
{% endtab %}

{% tab title="F\&B Upsell" %}
{% code overflow="wrap" %}

```html
<button onclick="SatisfiApp.Global.chatPopupOpen('Best vegetarian options')">
  Best vegetarian options available
</button>
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Questions?

Reach out to your Account Manager for more details. They will connect you with our Conversational Agency Services team.


---

# 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.satisfilabs.com/resource-center/ai-agent-engine/features-and-integrations/features/web-injectors.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.
