Everything you need to know about your RightMessage tracking script

So you've got RightMessage set up and you're wondering what exactly that little snippet of code is doing on your website? Let's dig in.

What's This Script All About?

When you sign up for RightMessage, you get a unique tracking script that looks something like this:

One line of code. That's it. But this single line transforms your static website into something that can react and adapt to each visitor in real-time.

Here's What It Actually Does

1. Makes Your Website Personal

The moment someone lands on your site, the script gets to work:

  • Scans your page looking for elements you've told it to personalize
  • Swaps out content based on who's visiting (and what you know about them)
  • Runs surveys or quizzes using the Flows you've created
  • Does it fast – before the page fully loads, so visitors don't see content jumping around
  • Tracks what's working so you know which personalizations are actually moving the needle

What can you personalize? Pretty much anything:

  • Headlines that speak directly to different segments
  • Images that change based on visitor attributes
  • Call-to-action buttons with different text
  • Entire sections that can be shown or hidden
  • Custom HTML injected anywhere you need it

2. Learns About Your Visitors

Here's where things get interesting. The script builds a profile of each visitor using:

The Basics (Always On):

  • What page they're on (and have visited before)
  • What device they're using (mobile, desktop, tablet)
  • How they found you (Google, Facebook ad, email link)
  • What they're doing on your site (scrolling, clicking, time spent)
  • Where they're located (country, timezone – nothing creepy)
  • Answers provided to questions you ask via surveys or quizzes

The Advanced Stuff (When You Need It):

  • Data from your email platform (if they're a subscriber)
  • Custom JavaScript data that you pass to us
  • Time-based rules
  • A/B testing placement (assuming you're running tests)

3. Shows the Right Widgets at the Right Time

Remember those annoying popups that show up the second you land on a website? Yeah, we don't do that. The script controls exactly when and how your widgets appear:

Widget Types You Can Use:

  • Bars – Those slim notifications at the top or bottom
  • Modals – Center-screen popups (when used tastefully)
  • Toasters – Little corner popups
  • Inline – Embedded right alongside your existing site content
  • Takeovers – Full-screen experiences (use sparingly!)

4. Talks to Your Email Platform

This is where the magic happens. The script seamlessly connects with whatever email platform you're using:

  • Recognizes returning subscribers
  • Updates their profile with new segment data
  • Applies segmentation based on what they do or questions that they answer
  • Syncs custom fields in real-time

We play nice with pretty much everyone: Kit, ActiveCampaign, Mailchimp, HubSpot, Klaviyo, Drip, and a bunch more.

5. Tracks Everything (But Respectfully)

Every interaction gets tracked, but we're not creepy about it:

  • Which personalizations people see
  • How they answer survey questions
  • What causes them to convert (or not)
  • Which widget variants perform best

The Technical Bits (For the Nerds)

How It Loads

The script loads asynchronously, which is a fancy way of saying it doesn't slow down your website. Here's what happens:

  1. Your page starts loading
  2. The script loads in parallel (usually in 20-100ms)
  3. We inject only the code you actually need
  4. Everything runs, personalizations apply
  5. Your visitor sees a page tailored just for them

The whole thing is optimized to death – minified, compressed, and delivered via CDN. We're talking 50-80KB gzipped, which is smaller than most images on your site.

Where We Store Stuff

The script uses your visitor's browser to remember things:

In LocalStorage:

  • Which widgets they've dismissed
  • Custom data you've collected
  • Their anonymous visitor ID
  • Responses to questions

In Cookies:

  • Just the bare minimum for cross-domain tracking
  • Integration IDs (if they're a subscriber)
  • Debug preferences

Preventing the Dreaded "Flicker"

Since we're changing content after the page loads, there's a tiny moment where visitors might see the original content before it gets personalized. We've got tricks to minimize this:

  1. Put the script in your <head> – The earlier it loads, the less likely anyone notices
  2. Use our special CSS classes – Apply the CSS class .rm-cloak to any above the fold elements to eliminate having your existing content shown prior to personalized content appearing

Security & "What If" Scenarios

We Take Security Seriously

  • Everything runs over HTTPS
  • Scripts only work on domains you've approved
  • We sanitize all user input (no XSS attacks here)
  • API keys stay server-side where they belong

What If RightMessage Goes Down?

First off, we're hosted on Cloudflare with crazy redundancy. But if somehow the script can't load (which also likely means half of the Internet is also down):

  • Your website works normally (just without personalizations)
  • Visitors see your default content
  • No errors, no broken pages
  • Everything resumes when we're back

Pro Tips & Common Gotchas

Do This:

  • ✅ Install the script on EVERY page (yes, even your privacy policy)
  • ✅ Put it in the <head> section
  • ✅ Test your personalizations before going live
  • ✅ Keep an eye on your RightMessage dashboard to make sure everything's working early on
  • ✅ Make sure you don't accidentally change anything about how your email platform or CRM works with third parties (like RightMessage)

Don't Do This:

  • ❌ Try to "optimize" by modifying the script URL
  • ❌ Add the script multiple times on one page
  • ❌ Block it with Content Security Policies
  • ❌ Save a local copy (any changes you make within RightMessage won't take effect if you do this)
  • ❌ Load it conditionally (defeats the whole purpose)

When Things Go Wrong

Script Not Loading?

  • Look for errors in the browser console
  • Make sure you're using HTTPS
  • Try disabling ad blockers

Personalizations Not Working?

  • Turn on debug mode and see what's happening
  • Verify your visitor matching rules
  • Double-check your element selectors
  • Make sure everything's published

Widget Won't Show?

  • Clear your browser storage - by default, Flows won't show questions that have already been asked, which could cause some Flows not to trigger widgets
  • Check the display rules
  • Look for JavaScript errors
  • Try in an incognito window

Integration Acting Up?

  • Re-authenticate with your email platform
  • Check if you're hitting API limits
  • Verify the subscriber exists
  • Review the integration logs

Need Help?

We've tried to make this as bulletproof as possible, but sometimes things get weird. When that happens:

  • First, check debug mode (seriously, it usually has the answer)
  • Email us at support@rightmessage.com
  • Include any browser console errors you're seeing
  • Tell us what you were trying to do

The script is constantly evolving – we're always adding new features and making it faster. It's processing millions of personalizations every single day across thousands of websites, and we're pretty proud of how well it performs.

Got questions we didn't cover here? Let us know. We're always looking to make our docs better.













All that’s needed to set up RightMessage on your website is to install your account’s unique tracking script.

This script can run on any website, build on any platform / technology.

Each account in RightMessage is given it’s own unique tracking script that looks like this:

This script does four things:

1. Changes your website based on what you’ve set up in RightMessage

When you set up personalizations or Flows journeys in RightMessage, these changes are compiled into your custom script.

Additionally, your script also contains a few CSS classes that RightMessage uses to avoid content flickers when personalizing your website.

2. Connects with your ESP/CRM

Our script is capable of knowing when a returning contact is back on your website. When a visitor shows up, we make a few API calls to your integrated ESP/CRM to find out what we know about them (e.g. tags, lists, and/or custom fields) and make this data available to your personalizations and Flows.

Additionally, when our segmentation engine learns something new about a known visitor – maybe they answer a survey question in a Flows, or start binging articles on “marketing” – we can also push that data up to your ESP/CRM in the background.

3. Sends key events to RightMessage’s servers

Your RightMessage dashboard contains segmented conversion data and other metrics.

Our script anonymously tracks key events, like personalization goals you’ve set up or opt-ins, and enriches these events with any and all segment data we have about the visitor.

We never store personally identifiable information about your visitors/contacts on our servers. We just pass this data to and from your ESP/CRM. If this ever changes, this will be something you’ll need to opt-in to.

This means that if someone who is, say, self-identified as an “ecommerce company” and who has been behaviorally segmented as “struggling with marketing” opts-in to one of your forms, we track and store:

  • That someone opted in at a particular date/time
  • They opted-in to so-and-so form (i.e. your newsletter form)
  • They were segmented with: “ecommerce company” and “struggling with marketing”

We don’t store their email address or any other open-ended form data they might have submitted.

4. Tracks each visitor’s on-site activity

In the browser’s cache, RightMessage stores enriched page view information about each visitor, including:

  • The page they viewed
  • The referrer that brought them to this page (either another page on your website, or an entirely different website)
  • When this page was viewed
  • How they were segmented when they viewed this page

This data isn’t sent to RightMessage or tracked online in any way. It’s kept in the user’s browser cache and is used by our segmentation engine to profile visitors (i.e. “target visitors who viewed /pricing more than 4 weeks ago”) that drive underlying personalizations.

How do you add the tracking script to your website?

You can access your custom tracking script from your RightMessage dashboard:

The code you see is your unique tracking script.

The script needs to be included in the header of the pages you want us to personalize/track. If you’re technical, or have access to web developers, doing this is really straightforward and simple to do.

Alternatively, you can use Google Tag Manager to add RightMessage to your website without updating your website’s theme.

And if you’re using WordPress, our WordPress plugin does the trick.

What impact will our script have on your website’s speed?

RightMessage operates in the browser.

Here’s what that means:

  1. Someone enters in your website into their web browser.
  2. Your web server handles their request. If they want yoursite.com/ your web server will send them back your home page.
  3. This page likely has a few additional scripts included (i.e. Google Analytics, a Facebook tracking pixel, etc.) – RightMessage is one of those scripts.
  4. RightMessage’s script will load. It’s really small and compact, and it usually takes around 20 milliseconds.
  5. Before the page is fully displayed, RightMessage will run and determine what personalized content needs to be added or changed.
  6. The visitor sees the web page your server sent back – but with a twist. RightMessage has post-processed the content.

The only downside to the way RightMessage works is that if you’re personalizing your site’s content, there’s a chance that some content will “flicker.”

For example, if your web server says the headline of the page is “ABC”, the visitor might load that page and see “ABC” before RightMessage loads. When RightMessage loads and runs your personalizations, the replacement of “ABC” with, say, “XYZ” can be a bit jarring.

Especially since we’re talking about milliseconds… visitor’s might think something’s off with their computer.

Fortunately, there’s a fix for this. This guide covers what you need to know to ensure that this flicker – which is something that’s impossible to fix for a client-side product like ours – doesn’t affect you

Our script is engineered to be quick. We’re talking <100ms for even the most complicated and heavy sets of personalizations.

While this is barely noticeable, that “flicker” – left untreated – can be jarring for any content near the top of your page that’s being personalized.

If you’re just using RightMessage to set up Flows, then none of the above “flicker” issues have any effect on you.


What if RightMessage goes down?

RightMessage is hosted on Amazon AWS and delivered via Cloudflare.

These are two massive infrastructures that power most of the known Internet and – yes – even they can go down from time to time.

Should our script not load for whatever reason (i.e. AWS is down), then your standard website will be served.

This is one key benefit to client-side personalizations… we’re in no way a dependency. If our script can’t load, the same exact website you had pre-RightMessage would be shown until the problem is resolved.

Technical overview

When the “Publish to site” button is pressed from within RightMessage, we:

  1. Compile a rule set of if/then’s that handle all segmentation and personalization that’s been defined for the account in question
  2. This rule set is injected into a boilerplate RightMessage script and outputted as a minified JavaScript file
  3. This file is then uploaded to Amazon AWS
  4. The subdomain that the script is loaded through proxies through Cloudflare, allowing the serving of the script file to be geographically load balanced and aggressively cached

When a visitor loads a website that embeds our tracking script, the handling and loading of this script is entirely between the end user and Cloudflare/AWS.

Should the visitor be identified (meaning: they’ve been cookied as being Contact #12345 in the backend ESP/CRM), then the script will make an XHR request to our servers so we can fetch details about this contact. Our “middleman” server will then proxy on the request to the relevant API endpoint(s) for the ESP/CRM that contact record is housed within.

If an event is triggered, like the visitor opts-in to a form or completes a personalization goal, limited details are sent to our servers as a subsequent XHR request. We don’t send any personally identifiable information. The payload of this request includes the timestamp the event occured, what event occured, and a list of segments the person triggering the event has. This data is used to populate the account owner’s dashboard.

Installation guides for common platforms:

Custom, or don’t see your website platform here? No worries!

Above are easy-to-follow guides for the most common website platforms. If you use something else, or are installing RightMessage on a custom coded or static website, then you could either use Google Tag Manager or just include our tracking script directly.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us