Headless and custom storefronts

Bring Ottla to any storefront

A headless commerce AI shopping assistant: a chat widget you add with two script tags, and a REST API for answers, search, recommendations and your catalogue. For PWA Studio, React, Vue or a front end your team built from scratch.

  • Chat widget in two tags
  • REST API under /api/v1
  • Send your catalogue by API
Illustration of a custom storefront with the Ottla assistant embedded on a product page

The chat widget

An embeddable AI chat widget for ecommerce

You can find the code snippet for your assistant by clicking Install on it in the console. You can change the colours, wording and behaviour of your widget from the console, so changing them never needs a code release.

On product pages, add the product’s SKU to the loader tag (or keep it in a product meta tag) so answers start from the product the shopper is looking at. The widget draws itself inside its own shadow root, so your stylesheet and its styles stay out of each other’s way.

  • One tag in the head and the loader before the closing body tag
  • Floating chat, docked sidebar or inline on a page
  • Uses a browser key with only the ask and feedback permissions
  • Your storefront’s address goes under that key’s Allowed origins
Floating chat widget
<!-- Ottla: in the <head> of every page -->
<script async src="https://ottla.ai/widget/ottla-bootstrap.min.js"
  data-widget-public-id="wgt_abc123"
  data-website-id="1"
  data-mode="chat"
  data-position="bottom-right"></script>

<!-- Ottla: before </body> on every page -->
<script async src="https://ottla.ai/widget/loader.js"
  data-token="YOUR_BROWSER_KEY"
  data-widget-public-id="wgt_abc123"
  data-website-id="1"></script>

Copy the real snippet from Storefront → Widgets → Install. It populates with your own widget and website ids.

Without the Magento module

Getting set up without the module

The console’s setup checklist follows these four steps for a custom storefront and ticks each one off as you go.

  1. 01

    Step 1: Add your website

    Add your storefront using the console with platform set to Custom / headless (REST API).

  2. 02

    Step 2: Create an ingest key

    Generate a key that can edit your catalogue, and keep that one on your server.

  3. 03

    Step 3: Send your catalogue

    Push products to the ingestion API, and content to the other ingestion endpoints.

  4. 04

    Step 4: Place the assistant

    Create it in Widgets and paste its snippet, with a separate browser key that lists your storefront under Allowed origins.

Ottla console API key page showing its permissions and allowed storefront address

Module or API: what you get

The Magento module serves your storefront with pre-built blocks. On a custom storefront you receive the same assistant, console and analytics, then build the rest on the API. There’s no right answer here for most stores. It depends how much of your front end you want to own.

Module or API: what you get
Magento module Custom storefront
On the storefront
Shopping assistant (chat widget) Yes Yes
Instant search box Ready-made Build on the API
Search results and category pages Ready-made Build on the API
Recommendation rows and kits Ready-made Build on the API
Badges, alerts and free-delivery progress Yes Build your own
Behind the scenes
Catalogue sync Automatic You send it by API
Console, Questions log and analytics Yes Yes
Live chat (a plan feature) Yes Yes
Revenue on Analytics Automatic Report orders to the attribution feed

Questions

Headless questions

For the developer who has to make it work on Monday.

What does Ottla offer a PWA Studio store?

The chat widget and the REST API. The Magento module isn’t tested on PWA Studio, so plan it like any custom storefront: add the widget, then build your search and recommendation blocks on the API.

Do I still need the Magento module?

Not for the widget and the API. Without it you send your catalogue by API and build your own search and recommendation blocks, because the ready-made blocks are Magento module features.

Which key goes in the browser?

A browser key with only the ask and feedback permissions, with your storefront’s address under Allowed origins. The key that can change your catalogue stays on your server. API keys and allowed origins covers the rules.

Can our developers try the widget on a local copy of the site?

Yes. Allowed origins accept http:// for local development addresses (localhost, 127.0.0.1, [::1] and names ending in .test or .localhost) on any port. There’s no separate test key, so any key can list them.

Why is revenue missing from Analytics on our custom storefront?

Revenue comes from orders reported to the attribution feed. Order events posted to the events endpoint will apply to any holdouts and will not report orders and revenue to Analytics.

Start building

Sign up for a workspace, generate your keys and follow along with the quick start. No card required, and you get a 14-day free trial.

14 days free. No card needed.