Embed script reference
How embed.js loads, what it stores in the browser, the events it sends and keyboard support.
How it loads
- The script reads
data-site-keyfrom its own tag. Without one, it does nothing. - It requests the active tours for the current URL path from
app.lovelysomething.com. - If none match (or the account is over its monthly views), it stops — nothing is added to the page.
- Otherwise it checks display conditions, picks the tour to show, injects its styles and renders the launcher, welcome card and step UI.
All tour UI is added at the end of <body>, with ids and classes prefixed ls-, so it won’t collide with your CSS.
Navigation
The script follows client-side navigation via history.pushState, replaceState, popstate and a DOM observer. When the path changes it removes the current tour and loads the tours for the new path.
Keyboard
| Key | Action |
|---|---|
| → | Next step |
| ← | Previous step |
| Esc | Close the tour, or the welcome card |
Browser storage
The script sets no cookies. It remembers per-visitor state in localStorage on your domain, keyed by walkthrough id:
| Key | Stores |
|---|---|
ls-guide-dismissed-<id> | The visitor clicked “Don’t show again”. |
ls-guide-completed-<id> | The visitor finished the tour (used by prior-tour conditions). |
ls-guide-shows-<id> | How many times the tour showed itself automatically (for max shows and “seen” conditions). |
ls-guide-autolaunch-<id> | How many times it auto-launched. |
ls-carousel-shows-<id> | How many times the splash carousel showed. |
Network requests
| Request | When |
|---|---|
GET /api/walkthrough/<siteKey>?path=… | On load and on each path change. |
POST /api/events | For each analytics event. Sends the tour id, event type, step number and a random per-page-view session id. |
Visual Editor live preview
When the Visual Editor extension saves steps, it posts a message to the page and the open tour redraws without a reload. Only messages from the same window, for the tour already loaded, are accepted, and nothing is saved by the page itself.
Removing Tooltip Tour
Delete the script tag. Nothing else is left behind except the small localStorage entries above.
<script src="https://app.lovelysomething.com/embed.js" data-site-key="sk_xxxxxxxxxx" async></script>