Everything you need to know about your RightMessage tracking script

Each account in RightMessage is given it’s own unique tracking script.

Below we cover:

  1. What this script does
  2. Where it should go on your website
  3. What impact this script has on your site’s speed
  4. A more technical overview of our script

What the RightMessage tracking script does

Whenever you Publish new changes from RightMessage, our servers compile a custom script that, from then on out, your website will begin to load.

RightMessage's tracking script

This script does four things:

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

When you set up personalizations or CTA Funnel 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 CTA Funnels.

Additionally, when our segmentation engine learns something new about a known visitor – maybe they answer a survey question in a CTA Funnel, 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:

View your RightMessage tracking script snippet

The code you see is your unique tracking script.

RightMessage's 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 CTA Funnels, 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.

Next up

Google Tag Manager

If you’re using Google Tag Manager (GTM), adding RightMessage to your website is a piece of cake.