Getting started
Install the Unless snippet
Unless runs on your website through a single script snippet. Once it is in place, everything else - the AI component, audiences, and the JavaScript API - works from your dashboard without further code changes.
To let an AI agent like ChatGPT, Claude or your coding assistant do the install for you, give it this URL: https://docs.unless.com/getting-started/install-the-snippet.md. That is this page as a single Markdown file, so one fetch is all the agent needs.
Get your snippet
Section titled “Get your snippet”The snippet contains your own account ID, so you have to copy it from your account:
- Open Account settings in the Unless dashboard.
- Click the Get Unless snippet button.
- Copy the code from the install instructions dialog.
Install the snippet
Section titled “Install the snippet”Paste the code into the HEAD section of the HTML on your website, on every page where you want Unless to run:
<html> <head> <!-- other head tags -->
<!-- paste your Unless snippet here --> <script data-unless="1.3" data-installer="snippet">...</script> </head> <body> ... </body></html>If your site is built with a template, a theme, or a tag manager, add it once to the shared layout or as a custom HTML tag that loads on all pages.
Verify the install
Section titled “Verify the install”Load a page of your website and check that window.Txt exists in the browser console. If it does, the snippet is running.
Next steps
Section titled “Next steps”- Identify your logged-in users so their profile follows them across devices.
- Wait for the Txt object before calling any JavaScript API function.
- Set up a Content Security Policy if your site restricts script sources.