# Try RightMessage on a website before installing it

You'll use the Tampermonkey browser extension to load your RightMessage draft on any website, so you can test or demo it before the snippet goes live.

You'll be able to see your RightMessage project running on a real website without changing that website's code. It's the quickest way to try personalization on your own site before you install the snippet, and it's how you show a prospect RightMessage working on *their* site in a sales demo.

The trick is [Tampermonkey](https://www.tampermonkey.net/), a free browser extension that runs a small script on the pages you choose. Your script adds RightMessage's development snippet, so only your browser sees the changes. Nobody else visiting the site does, and nothing is recorded in your analytics.

## Install Tampermonkey

Add Tampermonkey from your browser's extension store, using the links on [tampermonkey.net](https://www.tampermonkey.net/). Chrome, Edge, Firefox, and Safari are all supported.

Chrome and Edge also ask you to allow user scripts. Open the extension's details page and turn on **Allow User Scripts**. Tampermonkey's [FAQ](https://www.tampermonkey.net/faq.php) covers this if you can't find it.

## Copy your development snippet

1. In RightMessage, open **Settings** > **JavaScript Snippet** under **Project**.
2. Choose **Staging / development** and copy the code.

The development snippet loads your latest draft instead of your published project and turns analytics off. The [snippet reference](https://rightmessage.com/help/everything-you-need-to-know-about-your-rightmessage-tracking-script) explains the difference.

## Create the script

1. Open the Tampermonkey menu in your browser toolbar and choose **Create a new script**.
2. Replace everything in the editor with the script below.
3. Change the `@match` line to the site you want to test, such as `https://workforge.rightmessage.com/*`. Add another `@match` line for each extra site, like the `www.` version of a domain.
4. Replace the code between the backticks with your development snippet. Paste it exactly as copied, script tags included.
5. Save with **File** > **Save**.

```javascript
// ==UserScript==
// @name         RightMessage preview
// @match        https://example-prospect.com/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function () {
  const snippet = `PASTE YOUR DEVELOPMENT SNIPPET HERE`;

  const container = document.createElement('div');
  container.innerHTML = snippet;
  container.querySelectorAll('script').forEach((original) => {
    const script = document.createElement('script');
    script.textContent = original.textContent;
    (document.head || document.documentElement).appendChild(script);
  });
})();
```

`@run-at document-start` adds RightMessage as early as it would load from the page's `<head>`, so personalized headlines replace the originals before anyone sees them. `@grant none` runs the script in the page itself, where RightMessage needs to be.

## Open the site

1. Sign in to RightMessage in the same browser. The development snippet only loads your draft for someone signed in to the project.
2. Visit the site. RightMessage asks you to authorize the debugger, then opens it docked at the bottom of the page with **Draft** selected.
3. If you're asked to approve the website host, approve it. It's how RightMessage knows you meant to test on this site.

From here it works just like [testing your changes](https://rightmessage.com/help/best-practices-for-testing) on your own site: follow each path, try segment overrides, and watch **This page** to see why something is or isn't showing. Every edit you save in RightMessage shows up when you reload.

> **Running a sales demo**
>
> Set it up and open the site once before the call, so you're already signed in and authorized. During the demo, choose **Minimize debugger** to show the page the way a visitor would see it, and use segment **Override** to switch between audiences on the spot.

## Make your targeting match the site

Your page rules have to match the site you're testing. A rule that names your own domain won't match a prospect's, so for a demo, target by path (like `/pricing`) or build the campaign for their domain. Personalization that swaps page content also needs selectors that exist on their pages, so pick each element on the site you'll be showing.

## If nothing loads

- **Tampermonkey's icon shows no running script.** Check that the `@match` line covers the exact address in your address bar, including `www.` and `https`, and that the script is turned on in Tampermonkey's dashboard.
- **The script runs but RightMessage doesn't appear.** Some sites have a strict Content Security Policy that blocks scripts they didn't add themselves. Your browser's developer console will show a "Content Security Policy" error. Tampermonkey can't get around it, so test on another page or site.
- **You see your published project, not your draft.** Sign in to RightMessage, then reload. If you chose **Exit** in the debugger, that tab keeps the published version; open the site in a new tab.

## Switch it off

When you're done, turn the script off in Tampermonkey's menu or delete it. Once you're ready to go live on your own site, [install the live snippet](https://rightmessage.com/help/getting-started-with-rightmessage) and remove the userscript so RightMessage doesn't load twice.
