Automatically segmenting by on-site behavior or available data

RightMessage includes a powerful framework for segmenting visitors.

This allows for:

  • Tracking landing page (for inferring what the visitor was searching for)
  • Seeing what pages someone has viewed or hasn’t viewed (allowing you to on-site retarget people back to a product they viewed but didn’t purchase)
  • Tracking original referrer (for personalizing based on affiliate referrals)
  • Tracking based on UTM data (for personalizing based on ad campaign / ad targeting)
  • Targeting based on any data you have about someone in your ESP/CRM
  • And much, much more

Below is a detailed overview of how to use RightMessage’s auto-segmentation to profile your visitors.

This guide is broken up into three parts:

  1. Why it’s important to think about the ordering of your segments
  2. How our and/or rule system functions
  3. The various rules available, and how to use them

Order matters!

On every page view, and for each Segment Group you’ve created, RightMessage attempts to find a segment for your visitors.

And as we traverse through each Segment Group, we’re going to start with the top-most segment and try to match the visitor into that segment.

If we can, they’re segmented and our engine moves on to the next Segment Group.

But if we can’t, the engine tries to place the visitor into the second segment, and so on…

Unless managed correctly, this can lead to some unexpected issues.

For example, say you have a Segment Group that tracks a customer’s lifecycle:

  • Anonymous: Not on your email list
  • Subscriber: On your email list
  • Customer: A customer on your email list

Customer Lifecycle segmentation overview

If someone is back on your website who is a subscriber, and they’re tagged Customer, then you’d rightfully expect RightMessage to put them in your “Customer” segment.

But we wouldn’t. Here’s why…

Our engine will first check the “Anonymous” segment. You’ve set a auto-segment rule that checks to see if they’re NOT in your ESP/CRM (i.e. they’re anonymous.) This would prove false, so the segmentation engine would then continue down to the next segment.

Customer Lifecycle segmentation overview

The rule you’ve set for “Subscriber” is simple – this time, we’re checking to see if they ARE in your ESP/CRM’s database. This would prove true because even though this person is a customer, they’re also a subscriber.

Customer Lifecycle segmentation overview

RightMessage would then place them in the “Subscriber” segment, and then move on to the next Segment Group.

It’s really, really important to make sure that you order your segments that are defined by auto-segment rules appropriately. In the above example, “Customer” should be the topmost segment. And the default, or fallback, segment (“Anonymous”) should be at the bottom.

Customer Lifecycle segmentation overview

The above only applies to segments with auto-segment rules

If someone is segmented automatically via our synchronization with your ESP/CRM or they’ve self-segmented by answering a question, then order doesn’t matter.

Order only matters for the purposes of knowing which segment ultimately “wins” given a competing set of rules.

Setting up complex conditions

When setting up auto-segment rules for a segment, you can create a limitless number of groups that, when matched, will cause the visitor to be segmented.

Each group is separated by a visible “- OR -“

Within each group, you can create a limitless number of “AND” conditions that must all be met in order for the group to match and, ultimately, segment the visitor.

Here are a few examples of what we mean:

This segment is impossible to trigger

This could never be true, as someone can’t be both a subscriber and anonymous simultaneously.

A common OR condition

If either /some-landing-page or /another-landing-page are the first page a visitor visited, then they’ll be matched into this segment.

Two OR conditions with an AND

In this example, it’s the same as the above but if you arrive at /some-landing-page you also need to have come there from to match this segment.

Available segmentation rules

Data from your ESP/CRM

Once you’ve successfully integrated with your ESP/CRM, we can segment visitors based:

  • Whether they’re anonymous or a subscriber (i.e. if they’re in your contacts database or not)
  • Tags / Groups they belong to
  • Custom field / property values
  • Lists they’re subscribed to

Note: The language used (i.e. tags vs. groups) changes from integration to integration.

Segmentation rule - data from your ESP/CRM

For details about how we know that a visitor is a specific contact, head over here.


If you’ve already set up ESP synchronization for your Segment Group, there’s no need to redefine auto-segment rules for “reading” any segmentation data you’ve stored in your ESP/CRM.

For example, if you’ve set up synchronization mappings already for your “Industry” Segment Group, we’ve implicitly added a if custom field industry=XXXXXX rule for each of your segments.

Referring domain

If an outside website sent somebody to your website, enter the domain name you’d like to match here.

Don’t include http:// or anything beyond just the domain itself.

Segmentation rule - referring domain

Strategy tip:

If you dig into your analytics software, you’ll be able to see what domains consistently send you traffic.

It’s a good idea to catalog those domains and set up segments that target this traffic and personalize their experience based on the type of person who reads this website, or with social proof from the people behind the referring website.

Referring URL

This is similiar to segmenting by referring domain, but in this case you’re segmenting someone based on a specific page that sent them to your website.

Segmentation rule - referring URL

Original landing page

Here you can target the very first page RightMessage that someone visited on your website.

Segmentation rule - original landing page

Strategy tip:

Search engines like Google no longer send over search keywords within the referring URL data, however knowing where someone first arrived on your website is the next best thing.

If someone first landed on /blog/how-do-I-start-a-bakery, you could probably safely assume that they don’t yet have a baking business.

Pages previously (or currently) viewed

You can also segment visitors based on pages they’ve viewed, including the page they’re currently looking at.

Segmentation rule - pages viewed

Remember that RightMessage (re)segments on every page view. This means that segmentation that might be true right now (“Viewing the pricing page”) won’t be view a page view later, when they’re no longer viewing that page.

First-time visitor

If the visitor has never been to your site before (or, more specifically, RightMessage has never seen them), you can then segment first-time visitors.

Segmentation rule - first time visitor

Returning visitor

If someone has visited in the past, you can segment based off of:

  • Whether or not they’ve ever been to your site in the past (this)
  • If they have visited within the last X weeks/days/hours
  • If they have NOT visited within the last X weeks/days/hours

Segmentation rule - returning visitor

Strategy tip:

This is a great way to not only greet first-time visitors differently than everyone else, but it can also be used to diffuse heavy-hitting CTAs. For example, if you only want to show a flashy CTA to someone if they haven’t been back in a while, that’s totally doable.

Other segments

Additionally, “hybrid” segments can be created that combine multiple other segments in RightMessage.

This is useful if you want to create Personas or a Segment Group that calculates a quiz result from a series of questions asked within a CTA Funnel.

Segmentation rule - hybrid

UTM parameters

Visitors can also be targeted based on standard UTM parameters:

  • utm_source
  • utm_medium
  • utm_content
  • utm_campaign
  • utm_term
  • utm_content

Segmentation rule - UTM conditions

Strategy tip:

Many customers who run sizable ad campaigns are using RightMessage to eliminate the need for hosting multiple landing pages. By driving paid traffic to a single landing page, and then are using RightMessage’s segmentation engine to segment them based on the UTM parameter data attached to the ad click to make the landing page truly one-off.

A great way to do this is to think in terms of the kind of campaigns you’re regularly creating. Say you regularly run campaigns on Facebook/Adwords targeting people who want to build strength, and they all include some variation of “strength” in the utm_campaign.

You could set up a rule that targets utm_campaign contains "strength" to capture all current and future campaign variations (i.e. “strength-powerlift-dec-2020”)

Any other query string / URL parameters

Additionally, if you’re getting referral traffic that includes affiliate IDs or other details, you can segment visitors using these custom query string / URL parameters.

Segmentation rule - query string parameters

Javascript variables

Some customers find themselves needing to pipe additional data into RightMessage that they can segment off of.

Visitors can be segmented using data that you’ve exposed to your website via JavaScript variables. All that’s required is to attach the variables you want us to reference to the window object wherever you want us to segment.

Let’s say you want to send into RightMessage some information about a user who’s logged in to your app. You could set up the following:

window.currentUser = {
  id: 123,
  email: "",
  onboardingStage: "activated",
  plan: {
    level: "gold",
    price: 29.99

You could easily segment returning, signed in users of your app on your marketing site by drilling down into the currentUser data.

  • currentUser.onboardingStage = "activated" would target people who have activated
  • currentUser.plan.price > 20 would target people who are on a billing scheme that pays more than $20/mo

Segmentation rule - Javascript data

Strategy tip:

If you’re using a 3rd party IP enrichment tool (like Clearbit Reveal), then this is how you’d integrate those products with RightMessage. Any data, regardless of where it comes from, that you want to push into RightMessage is fair game.

WordPress-specific data

If you’re using WordPress, you can also segment visitors based on:

  • Current page
  • Current post
  • Current post’s tags
  • Current post’s category
  • Favorite tag
  • Favorite category

Segmentation rule - WordPress meta data

If you’re curious about how we determine things like “Favorite tag” or “Favorite category”, you’re going to want to read through our WordPress set up guide.

WordPress plugin required

In order to make the above rule filters work, you’re going to want to make sure you’re using our WordPress plugin to add RightMessage to your website!

Next up


While not a first-class feature of RightMessage, many of our customers have asked about geolocation.