Academy/Integrations/Connect your WooCommerce store
GuideBeginner

Connect your WooCommerce store

Two jobs, one afternoon: create the REST API keys that let your agent read products and orders, and get the chat widget loading before the closing </body> tag — which WooCommerce gives you no field for. Every step below is a screenshot of the real admin.

AAssistantLabs Team
Academy
8 min read Updated Sep 2026

Create your API keys

The keys are what let your agent look things up in the store — a price, whether something is in stock, where an order got to. They live in WooCommerce itself, four clicks deep, under a tab most people never open.

Start at WooCommerce → Settings → Advanced. That screen is also the answer to the other question everyone asks first: there is no box here for custom code — six sub-tabs, none of them a place to paste a script.

1
WooCommerce → Settings → Advanced. The sub-tab row is the thing to notice: Page setup, REST API keys, Webhooks, WooCommerce.com, Blueprint, Features.

Click REST API keys. On a store that has never issued one, it's an empty screen with a single button.

2
Empty on a new store. Hit Create an API key (or Add key next to the heading).

Three fields, and only one of them has a wrong answer:

  • Description — name it after who gets the key (“Assistant Labs”). This is how you'll know what you're revoking in a year.
  • User — the account the key acts as. Leave it on your admin user.
  • Permissions — choose Read. Not Read/Write. Your agent only ever looks things up; a key that can write is a key that can change your prices.
3
Description, user, and Permissions: Read — then Generate API key.
The secret is shown once. WooCommerce says so on the next screen, and it means it — leave the page and the consumer secret is gone for good. Copy both values somewhere safe before you click anything, or you'll be generating a second key five minutes from now.
4
The pair you need: a ck_… consumer key and a cs_… consumer secret. (Blurred here — never paste yours into an email or a chat.)

Connect the store to your agent

Back in Assistant Labs, open Build → Integrations → WooCommerce and fill in three things:

  • Site URL — your store's address, exactly as customers reach it (https://…, no trailing path)
  • Consumer Key — the ck_… value
  • Consumer Secret — the cs_… value

Hit Connect WooCommerce. From then on the agent can search your products and categories, and look up a customer's own orders when they ask “where is my parcel” — all read-only, which is why Read was the right permission.

Store on HTTP, not HTTPS? WooCommerce only accepts key-and-secret authentication over HTTPS. On a plain HTTP store the REST API falls back to a signed OAuth handshake, and most integrations — ours included — expect the simple case. Get a certificate first; every host gives them away now.

Add the chat widget

The other half is the bubble customers actually click. In your agent, go to Build → Channels → Website, set the position, language and look, and hit Copy code. What lands on your clipboard is one script tag:

Your snippet
<!-- START Assistant Labs Chat Widget --> <script src="https://assistantlabs.io/assistantlabs-loader.js" async data-assistant-id="assistant_…" data-position="right" data-lang="he" data-skin="whatsapp"></script> <!-- END Assistant Labs Chat Widget -->
Yours will carry a real assistant id and the options you picked. Copy it from the app rather than retyping this.

It has to load before the closing </body> tag on every page — and as screenshot 1 showed, WooCommerce has no field for that. Neither does WordPress. The fix is a free plugin called WPCode, which adds the box that's missing: Plugins → Add New Plugin, search WPCode, Install Now, then Activate.

5
The one you want is WPCode – Insert Headers and Footers + Custom Code Snippets. Free tier is enough.

A Code Snippets item appears at the bottom of the sidebar. Open Code Snippets → Header & Footer and you get three boxes, each labelled with exactly where its contents end up.

6
Header goes in <head>, Body just after the opening <body>, and Footer — “above the closing </body>tag”. That third one is what every install guide is asking for.

Paste your snippet into the Footer box and hit Save Changes.

7
The snippet in the Footer box, with the hint line under it confirming where it will be printed.
8
Saved — and read the notice: clear your cache if you run a caching plugin, or visitors keep getting the old page.
Header or Footer? Either works for an async widget, but Footer is the right habit: anything in the Header box runs before your store has drawn anything, and a slow third-party script there delays the whole page.

Without a plugin

Two alternatives if you'd rather not add a plugin. Both work; neither survives a theme change the way WPCode does.

1. Your theme may already have the field. Most premium themes ship one — look for “Custom Code”, “Header & Footer Scripts” or “Hooks” in the theme's own options (Astra, GeneratePress, Divi and OceanWP all have a version of it). Paste into its footer field and you're done.

2. On a block theme, use the Site Editor. If your store runs a block theme — Twenty Twenty-Four, Twenty Twenty-Five, anything with Appearance → Editor — you can put the snippet in the footer itself:

  • Appearance → Editor → Patterns
  • Under template parts click Footer, then open the footer your theme actually uses
  • Click +, search Custom HTML, add the block at the end
  • Paste the snippet into it and Save

The honest caveat: this puts the snippet inside your footer's markup rather than at the end of the document, and it only reaches pages using that template part. For an async chat widget that's fine — it still loads on shop, cart and checkout — but if an integration insists on “the last thing before </body>”, use WPCode.

3. If you have a developer, the real WordPress answer is the wp_footer hook in a child theme's functions.php:

wp-content/themes/your-child-theme/functions.php
add_action( 'wp_footer', function () { ?> <script src="https://assistantlabs.io/assistantlabs-loader.js" async data-assistant-id="assistant_…"></script> <?php }, 999 );
Priority 999 makes it run last. Never edit the parent theme's functions.php — the next theme update overwrites it and the widget silently disappears.

Check it really landed

Don't trust the settings page — trust the store. Open your shop page in an ordinary tab and check three things.

  • The bubble appears. Bottom corner of the shop page. Give it a second; it loads after the page does.
  • The tag is in the HTML. Right-click → View Page Source, then Ctrl/Cmd+F for assistantlabs-loader. If it's there, the install worked and anything still wrong is a setting.
  • Ask the agent a store question.“Do you have X in stock?” — a real answer means the API keys work too, not just the widget.
Where it ends up: after your theme's </footer> and before </body>, on every page including cart and checkout. WordPress's own footer scripts still print after it — normal for anything added this way, and an async widget doesn't care.

When it doesn't show up

Four causes, in the order they actually happen:

1. A cache is serving the old page. Clear the caching plugin and your host's cache, then reload with Ctrl/Cmd+Shift+R.

2. The store is still hidden. A new WooCommerce store starts in “Coming soon” mode: you see the store because you're logged in, while everyone else gets a placeholder page — no products, no widget. It's one radio button.

9
WooCommerce → Settings → Site visibility. Switch to Live when you're ready, and always test in a private window.

3. A consent or speed plugin is blocking the script. Cookie-banner plugins hold third-party scripts until consent, and “delay JavaScript” options can postpone them indefinitely. Allow-list the assistantlabs.io script.

4. It went in the wrong box. If you pasted into WPCode's snippet editor as PHP instead of into Header & Footer, nothing gets printed. Re-check Code Snippets → Header & Footer.

Switching themes later? The WPCode route survives it. The Site Editor block and the functions.php hook don't — if your widget vanished the day the site got a new look, that's why.
Was this helpful?