Skip to content
 

Content Assistant

Content Assistant is a Developer Portal placement type that puts an AON-hosted assistant directly on your pages or app screens, instead of a wall or slot your own product renders. Create a Content Assistant placement in your application's Placements page in the Developer Portal, pick which styles it should use, and add the snippet below to the pages that should carry it. Offers come from the whole AON network, matched to the page and to what your users ask — there is nothing to curate.

What works today

Only the web script is live. Everything on this page about iOS / Android describes a planned package that is not published yet.

Web (aon.js, live)iOS / Android (planned)
Floating buttonDrawnNot available yet
End of contentDrawn, into your end-of-content spotNot available yet
Inline mentionSwitch exists in the portal, nothing drawn yetNot available yet
Inline cardSwitch exists in the portal, nothing drawn yetNot available yet

For the web script's exact behaviour — tag attributes, what it draws, network requests, Content-Security-Policy and the window.AON JavaScript API — use the aon.js Web Plugin reference. This guide only shows the snippet to paste.

Styles

A Content Assistant combines one or more of four styles. They are independent switches — a page can carry more than one at once — and all of them open the same assistant.

Style idShown asWhat it does
floatingFloating buttonA button in the corner that waits to be tapped. Sits over your page, not in its flow. Optional "Show a prompt message" sub-setting.
mentionInline mentionProduct mentions in your existing copy become quiet entry points — two or three per page at most.
endEnd of contentSuggested questions at the end of the content, where the reader is deciding what to do next. Optional "Include a question box" sub-setting. Needs a spot (see below).
cardInline cardA compact card placed right after the content it relates to, inviting readers to find out more. Needs a spot (see below).

end and card sit in the flow of the page, so you mark where each should show with a spot in your code. On web, only the end-of-content spot exists today; add it once even if the style is currently off, so switching it on later in the portal never needs another code change. An empty spot simply shows nothing.

Add the assistant to your page

Choose the platform your placement's pages run on. Styles are switched on and off from the placement in Developer Portal — the snippet below never changes when you toggle a style.

Web

Add this once, before </body>, on every page that should carry the assistant. Replace plc_YOUR_PLACEMENT_ID with your placement's id (the plc_… value shown on the placement in Developer Portal):

<!-- Before </body> on every page that should carry the assistant -->
<script
  src="https://plugin.aon.pro/aon.js"
  data-placement-id="plc_YOUR_PLACEMENT_ID"
  data-lang="en"
  data-prewarm="idle"
  referrerpolicy="origin"
  async
></script>
<!-- On every page, right after its main content (once in the shared layout, before the footer) — aon.js decides what, if anything, shows here -->
<div data-aon-slot="end-of-content"></div>

The web script draws floating from the tag alone. The End of content style draws into the data-aon-slot="end-of-content" marker. Put that marker on every page the script runs on (home, listing and detail pages alike), right after the page's main content. The easiest way is once in the layout all your pages share, between the page content and the footer; pages outside that layout (a second root layout, a standalone HTML file) get their own. Each page must end up with exactly one marker. Whether anything shows in it on a given page is the script's decision, not yours. An empty marker shows nothing. Inline mention and Inline card are not drawn by the web script yet, so switching them on has no visible effect on web pages and needs no code. Everything else the script does is in the aon.js Web Plugin reference.

Three things the script needs from your pages:

  • Static marker. The script looks for the end-of-content spot once, when the document has parsed; put it in server-rendered or static HTML, not inserted later by a client script.
  • Public HTTPS. AON reads a page by fetching its public URL. On http:// pages, behind a login, or on shared preview domains the floating button still works but the spot stays empty.
  • Single-page apps. AON reads a page on a full load. After a client-side route change the spot is cleared and not refilled until the next full load (or until AON.init({ lang }) changes the locale, which re-reads the current URL).

iOS / Android (planned)

Nothing below runs today: the package is not published. The API is shown so you can see what the integration will look like.

When published, the package will be installed with:

npm install @agentoffernetwork/assistant

The @agentoffernetwork/assistant npm package hasn't been published yet, so this integration won't run until it's released.

Call it once per screen, with what the screen is showing:

import { AonAssistant } from "@agentoffernetwork/assistant";
 
// Once per screen, with what the screen is showing
AonAssistant.attach(screenView, {
  placementId: "plc_YOUR_PLACEMENT_ID",
  context: { title: product.title, body: product.description },
});

Register both spots on the same screen, even for a style that is currently off, so switching it on later in the portal needs no code change:

// End of content: on every page, right after its main content (once in the shared layout, before the footer)
AonAssistant.registerSlot(screenView, "end-of-content");
 
// Inline card: after the paragraph the card should follow
AonAssistant.registerSlot(screenView, "inline-card");

AonAssistant.registerSlot(screenView, slot) takes the same screenView you passed to attach and one of the two spot values above. floating and mention need no registerSlot call.

Call registerSlot, spelled out in full: AonAssistant.registerSlot(...). The package has no shorter method of the same purpose — a call that leaves off the register prefix will not mark a spot.

Preview before you publish

The placement's detail page in Developer Portal has its own Preview button, separate from Integration & test: it renders your currently saved styles against sample content so you can see how the assistant sits on a page before wiring up the snippet. The Preview page shows fixed sample content, not a live call against your real pages.

Checklist

  • Content Assistant placement created, with at least one style switched on (a placement with no style switched on is a valid but inactive state — visitors would not see the assistant).
  • Web script tag added once per page, before </body>, with your plc_… placement id.
  • A data-aon-slot="end-of-content" spot in the static HTML of every page, after its main content.
  • Pages are public, on your own domain, and served over HTTPS (shared preview domains and tunnels are not read).
  • iOS / Android: nothing to do until the package is published.

Next

Return to Quick Start