Traffic Control¶
Overview¶
Traffic control lets you decide when Rose appears on your website. It is most often used for gradual rollout: you can start with a small percentage of visitors and increase it as you gain confidence.
Rose can also be restricted by page URL, device type, and host-page data made available in window.dataLayer.
How It Works¶
When traffic control is enabled, the widget uses a deterministic allocation to decide whether each visitor sees the widget. Each visitor is assigned a stable bucket (0-99) based on their client ID. If their bucket is below the configured traffic percentage, they see the widget.
The allocation is computed fresh on every page load from the server-side configuration, so changes to the traffic percentage take effect immediately.
Configuration¶
In the Rose backoffice, open Config Studio > Website Agent > Display Rules. This page holds the traffic percentage, mobile display, URL rules and, with advanced settings shown, dataLayer display conditions. Your Rose account manager can also configure them for you.
Display Conditions Based on dataLayer¶
If your website already publishes page context to window.dataLayer, Rose can use those values to decide whether the widget should appear.
This is useful when URL rules are not enough. For example, you might want Rose to appear only for visitors in France, but the relevant pages are dynamic and cannot be listed one by one.
Example host-page data:
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
pageLanguage: 'en',
countryCode: 'FR',
pagePostType: 'resources'
});
</script>
Example Rose display rule:
With this rule, Rose appears only when the latest dataLayer value for countryCode is FR.
You can also match nested values with dot notation:
How Matching Works¶
- All configured conditions must match.
- A condition matches when the
dataLayervalue equals one of the configured values. - If the
dataLayervalue is an array, any item in the array can match. - Later
dataLayer.push(...)entries override earlier values for the same key. - If a configured key is missing, Rose does not appear.
- Values are read when Rose decides to display and again on each page change in single-page apps. Push them before Rose loads.
To configure these rules:
- In the Rose backoffice, open your profile menu (top right) and turn on Show advanced settings.
- Open Config Studio > Website Agent > Display Rules.
- In Data Layer Targeting, add a condition: Key is the
dataLayerfield name or dot path, Values lists the allowed values, one per row. - Save.
Hiding Rose from Existing Customers¶
Rose does not know which visitors are your customers. Visitor identification, when enabled, can reveal who a visitor is, but Rose does not check that against your customer base or use it to decide whether to appear. Your website, which knows when a visitor is logged in, has to tell Rose. Choose one of these options.
Option 1: Don't load Rose for customers¶
Rose only appears when its script is on the page. Add a condition around it so the script is not added for visitors your site knows are customers:
- Script in your site code: wrap the Rose snippet in a condition such as
if (!visitorIsCustomer) { ... }. - Google Tag Manager: add a trigger exception to the Rose tag based on a "visitor is customer" variable.
- Rose already loaded: call
window.InboundXWidget.destroy()to remove it from the page. See Widget Public API.
Option 2: Show Rose only to prospects with dataLayer¶
Push a value for every visitor before Rose loads:
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ rose_audience: visitorIsCustomer ? 'customer' : 'prospect' });
</script>
Then add a dataLayer display condition with Key rose_audience and Values prospect.
Warning
The value must be pushed for all visitors, not only customers. If rose_audience is missing, Rose is hidden for everyone.
Option 3: Hide Rose on your login page¶
In Display Rules > Page Display Rules, add the pattern */login* with display hidden. Patterns match the full page address, so a bare /login does not match; keep the *.
This only hides Rose on that page. Rose does not remember that the visitor went there, so it appears again on other pages.
What happens during a conversation¶
Rules are checked again each time the visitor changes page, including in single-page apps. If a rule hides Rose while a conversation is open, the widget closes and the conversation comes back on the next page where Rose is allowed.
Current limits¶
- Rose cannot import a list of customers to exclude, and does not check visitors against your CRM.
- Rose cannot keep a conversation while excluding it from lead notifications, CRM sync or Slack alerts.
Contact your Rose account manager if you need either of these.
Forcing the Widget Display¶
If you need to see the widget regardless of traffic allocation percentage (for testing, demos, or troubleshooting), you can override the allocation using your browser's console. URL rules and dataLayer display conditions still apply.
Enable Widget Display¶
Open your browser's Developer Tools (F12), go to the Console tab, and run:
const data = JSON.parse(localStorage.getItem('rose'));
data.widget.trafficControlOverride = true;
localStorage.setItem('rose', JSON.stringify(data));
Then refresh the page to see the widget.
Disable Widget Display¶
To simulate being outside the traffic allocation:
const data = JSON.parse(localStorage.getItem('rose'));
data.widget.trafficControlOverride = false;
localStorage.setItem('rose', JSON.stringify(data));
Reset to Natural Allocation¶
To remove your override and let the system decide naturally:
const data = JSON.parse(localStorage.getItem('rose'));
data.widget.trafficControlOverride = null;
localStorage.setItem('rose', JSON.stringify(data));
Checking Your Current Status¶
To see your current traffic control status:
const data = JSON.parse(localStorage.getItem('rose'));
console.log('Override:', data?.widget?.trafficControlOverride);
console.log('Last computed decision:', data?.widget?.trafficControl);
This will show:
trafficControlOverride: true- You have forced the widget to showtrafficControlOverride: false- You have forced the widget to hidetrafficControlOverride: null(or missing) - No override; the system decides based on traffic allocation
The trafficControl object shows the last computed decision (for debugging only — it does not influence the widget behavior).
Troubleshooting¶
If you don't see the widget after forcing the display:
- Refresh the page - The override only takes effect after a page reload
- Accept cookies - Some websites only load the Rose widget after cookie consent; make sure you've accepted cookies
- Check
dataLayervalues - If Rose is configured to display only when adataLayervalue matches, verify the value exists before Rose loads. This also applies when using the Chrome plugin or a local traffic override. - Disable ad blockers - Ad blockers may interfere with the widget, especially if it's loaded through Google Tag Manager
If the issue persists after trying these steps, contact your Rose account manager.
Notes¶
- Traffic control overrides are stored per-browser and per-domain
- Clearing your browser's localStorage will reset your override and allocation
- Traffic control settings are managed server-side by Rose; the localStorage override only affects your individual browser
dataLayerdisplay conditions apply in addition to URL and traffic allocation settings