# Live and development snippet reference

You'll know which snippet to use on your live or staging site, how each handles drafts and analytics, and what to look for in Snippet Health.

Use this page to choose the right snippet for your website and understand what happens when it runs. The snippet loads RightMessage, checks visitor conditions, shows eligible widgets, applies your selected configuration, and records supported activity when analytics is on.

You'll find your code in **Settings** > **JavaScript Snippet** under **Project**. Each project's snippet contains its own public project ID.

## Choose the live or development snippet

**Live website** is selected by default. Changing this selection changes the code you can copy. It doesn't change code you've already installed or publish your project.

| If you're installing on…            | Choose                    | Configuration it loads                                       | Analytics                           |
| ----------------------------------- | ------------------------- | ------------------------------------------------------------ | ----------------------------------- |
| Your public website                 | **Live website**          | Your last published project configuration                    | On unless you disable it separately |
| A staging or local development site | **Staging / development** | Requests a draft debugger session, which needs authorization | Off                                 |

![RightMessage live-website Snippet Code panel with the Copy to clipboard icon highlighted in orange](https://rightmessage.com/help/screens/platforms-snippet-copy.light.webp)

The development snippet adds these settings before the normal loader:

```javascript
window.RightMessage = window.RightMessage || {};
window.RightMessage.useDraftConfig = true;
window.RightMessage.disableAnalytics = true;
```

`useDraftConfig` requests the draft debugger. Authorize it with your RightMessage account to load your draft. If the draft request fails, RightMessage keeps the published configuration. Check which configuration the debugger loaded.

> **Development previews need a RightMessage login**
>
> A signed-out tester can be redirected away from your staging page to RightMessage's login. Don't use the development snippet for anonymous stakeholder previews.

`disableAnalytics` turns off analytics recording whether or not draft access succeeds. A development visit won't update **Snippet Health**.

The debugger keeps its visitor state separate and simulates RightMessage's email-platform writes, form submissions, and webhooks. To check that a contact really updates, use an approved published test path outside the debugger. Links, redirects, and your own custom code can still run in the debugger, so use approved test data and destinations. See [testing your changes](https://rightmessage.com/help/best-practices-for-testing).

After **Exit Debugger**, that tab ignores the development snippet's draft request and uses the published configuration until you explicitly open another debug or preview session.

## Where to put the snippet

Put the full snippet in the `<head>` of every page where you want RightMessage to run. A site-wide custom-code setting covers pages that share it. Standalone landing pages, subdomains, and pages served by another platform may need their own installation.

The loader requests your project script asynchronously. It also adds visibility rules for RightMessage's cloaking controls. A tag manager adds its own loading and tag-firing delay before RightMessage runs. Direct head installation is preferable if late loading makes an original headline appear before its personalized version.

Asynchronous loading still has a performance cost. Your website, connection, configuration, and other scripts affect it. Measure your own page if performance is a concern.

Use one installation method per page. Combining a plugin, theme injection, and a tag-manager tag can load the snippet more than once.

For the steps, see [getting started](https://rightmessage.com/help/getting-started-with-rightmessage), [Google Tag Manager](https://rightmessage.com/help/google-tag-manager), or [your website platform](https://rightmessage.com/help/topics/platforms).

## Other platform installation choices

The platform guides use one main installation method. These alternatives let you cover a smaller or larger set of pages. Use one method per page so the snippet doesn't load twice.

### ClickFunnels funnels and individual pages

For one funnel, open **Funnels** and select the settings icon beside it. Paste the snippet into **Head Code**, then choose **Update Funnel**. This covers that funnel's pages, not every funnel in your workspace.

For one page, open its editor and choose **Settings** > **Tracking Code**. Paste the snippet into **Header Code** and save. Repeat only for other pages you want to cover.

Use either method instead of the site-wide installation. Saving tracking settings and publishing a new page are separate from publishing changes in RightMessage.

### Instapage variations and workspace scripts

For one variation, open it in the builder and choose **JavaScript** in the right sidebar, then **Header**. Add the JavaScript without its outer script tags, save, and publish. The Cookie Bar doesn't automatically control this location, so don't use it to bypass required consent.

For several pages, follow Instapage's [Workspace Scripts instructions](https://help.instapage.com/hc/en-us/articles/4415768719895-Workspace-Scripts) to assign a shared script. Remove overlapping page or variation copies when you switch methods.

### Kajabi individual pages

Instead of using **Header Page Scripts**, find the page under **Website** and choose **Customize**. In the builder, open **Settings** > **Custom Code**.

Paste only the JavaScript inside the snippet into **Custom JavaScript**. Remove the HTML comment and the opening and closing script tags. Choose **Save** and publish the page if it isn't live yet.

This covers only that page. Don't combine it with the site-wide copy.

### Squarespace individual pages

Instead of site-wide code, open **Pages**, hover over the page, and choose its settings gear. Open **Advanced**, paste the snippet into **Page Header Code Injection**, and save.

This covers only the selected page. Don't combine it with the site-wide copy. Squarespace 7.0 has template-specific limits, including Index landing pages. Check the [code injection guide](https://support.squarespace.com/hc/en-us/articles/205815908-Customize-parts-of-your-site-with-code-injection) for your template.

### Unbounce custom domains

Script Manager requires a custom domain. It can't add scripts to Unbounce's test domain. Use the [page-level installation](https://rightmessage.com/help/unbounce-landing-pages) for that domain or when you don't want broader coverage.

1. In Unbounce, open **Settings** > **Script Manager**.
2. Choose **Add a Script**, then **Custom Script**, and name it `RightMessage`.
3. Open **Add Script Details** and set **Placement** to **Head**.
4. Under **Included on**, choose **Main Landing Page**. Add other locations only if you want RightMessage there too.
5. Paste the snippet and select your custom domains under **Script Usage**.
6. Choose **Save Changes** and check that the script is enabled.

Script Manager covers pages on those domains, including new pages published there. It doesn't cover unrelated domains in the account. If you're replacing page-level copies, remove them and republish those pages to avoid duplicates. See Unbounce's [Script Manager guide](https://documentation.unbounce.com/hc/en-us/articles/360035250491-Adding-Your-Custom-Scripts-Using-Script-Manager).

### Webflow individual pages

Instead of the site-wide installation, open that page's **Page settings** in the Designer. Under **Custom code**, paste the snippet into **Inside `<head>` tag**. Save and publish the site.

This code covers only that page and loads after site-wide custom code. Don't add it if **Head code** already contains RightMessage. Webflow's [custom-code guide](https://help.webflow.com/hc/en-us/articles/33961357265299-Custom-code-in-head-and-body-tags) covers both locations.

### Wix selected pages

Use **Choose specific pages** instead of **All pages**, without adding a second all-pages copy. Site-wide installation is preferable when people can arrive on different pages and navigate between them.

## How widget embed code differs

The project snippet loads RightMessage. An inline widget's embed code marks where it belongs inside your page content. You need both for an inline widget.

An embed shortname belongs to a widget, not a project. The widget also needs a linked flow or offer, the right enabled state, and targeting that lets it appear. [Build a resource recommendation in the app](https://rightmessage.com/help/first-experience-in-the-app) introduces flows and widgets.

### WordPress embedded placements

The WordPress plugin's **Default Embedded Widget** field accepts an embedded widget's shortname and appends its placement to individual posts and pages. Leave it empty if you want to choose each location yourself.

For a selected location, add this shortcode to your WordPress content:

```text
[rm_area name="workforge-next-step"]
```

The example name is for [WorkForge](https://workforge.rightmessage.com). Replace it with your widget's exact **Shortname**, then publish or update the content. The shortcode adds a placement. It doesn't create or publish a flow.

## Check when RightMessage last received data

**Snippet Health** shows when RightMessage last received data for your project. Before it receives data, it asks you to install the script and visit your website. Its checking message isn't a guaranteed detection time.

Look for an actual recent timestamp. A success sentence with a blank date or empty parentheses isn't confirmation that data arrived.

Use the timestamp to check that data is coming through. Use the debugger to inspect the visitor's path and visible widgets, and check your email platform to confirm a contact update. A development visit with analytics disabled won't update this timestamp.

## Read your publish history

When you've published changes, **Publish History** shows **Published** and **Message**. If you didn't leave a note, it shows **No message provided**.

The list shows 10 entries per page. The page states that the last 25 versions are kept for rollback. This table records publishes but doesn't have a rollback button. The [publishing and recovery guide](https://rightmessage.com/help/publishing-your-changes) covers reviewing changes and restoring a version.

## What the snippet knows about a visitor

RightMessage can use arrival parameters, visited pages, and survey answers before someone identifies themselves. Browser storage also affects remembered answers, dismissals, and other visitor state.

Connecting an email platform doesn't identify every browser. Supported forms, identifying email links, and integration-specific methods can establish who someone is. Installing the snippet alone doesn't watch every third-party form. [Automatic identification](https://rightmessage.com/help/identifying-visitors-automatically) needs its own supported setup, such as the optional **Email Watcher** or a Popup's form-submission trigger.

Contact fields and tags become available for targeting after the browser is identified. Another device needs its own identification event.

Answers in RightMessage, segments assigned to a visitor, and fields written to an email platform are separate records. See [how visitor identification works](https://rightmessage.com/help/how-do-we-identify-returning-subscribers-or-contacts) and [syncing contact data](https://rightmessage.com/help/synchronizing-contact-data-with-your-email-platform-or-crm).

## Consent and blocked scripts

The data RightMessage uses depends on your configuration, forms, integrations, and visitor activity. Review those choices with whoever manages your consent and privacy requirements. This page doesn't establish legal compliance for your site.

If JavaScript is off, or a browser, consent tool, network rule, or extension blocks the snippet, RightMessage's browser-based features can't run normally. Keep your original page and important destinations usable without a widget.

For installation, publishing, targeting, or saved-browser-data problems, use [installation troubleshooting](https://rightmessage.com/help/common-set-up-issues). Open **Debug on site** for an authorized debugger session. A query parameter alone isn't an installation test.
