Target audiences
Audience rules decide which visitors on a page see which variation. Use them when a campaign should behave differently by location, device, language, traffic source, time or earlier visits. This page lists every signal audience rules can read and how each one behaves when the value is missing.
How audience rules work
Section titled “How audience rules work”You set audience rules on a campaign in the dashboard. A campaign with audience rules holds one or more groups, each with a condition and the variation, or test, that the group shows. On every page view the runtime does the following.
- Checks the campaign’s schedule and URL rules, as described in Target pages with URL rules.
- Walks the groups in order and takes the first group whose condition holds. A group can also have its own date window.
- Shows that group’s variation. If the group runs a test, the visitor’s sticky assignment picks the variation.
If no group matches, the campaign does not enrol the visitor and the next campaign in priority order can run on the page. Conditions can be combined with all, any and not.
Every signal is read once, when the campaign is checked on page load. Text values are trimmed and compared without regard to case.
Signals
Section titled “Signals”| Signal | What it reads | Comparisons |
|---|---|---|
| Location: country, region, city | The visitor’s location, taken from the CDN response that delivers the Grona script. No outside geolocation service is called. | is, is one of, is on a list, is known, is unknown |
| Device | phone, tablet or computer, worked out from the browser’s user agent |
is, is one of |
| Operating system | android, ios (iPhone and iPad), windows, macos, linux or chromeos |
is, is one of |
| Browser language | The visitor’s first preferred language, such as en-GB |
is, is one of, starts with (en matches en-GB) |
| Page language | The lang attribute of the page’s <html> element |
is, is one of, starts with |
| Market | A first path segment that looks like a market, such as /de or /en-eu, otherwise Shopify’s market setting |
is, is one of |
| Came from pages | The previous page on your own site, compared by path | is, is one of, is on a list, starts with |
| Query parameter | A parameter in the page address | is, is one of, is on a list, is known, is unknown |
| Time of day | The time on the clock of the rule’s time zone, as HH:MM |
before, after, between |
| Date | The date or date and time on the same clock | before, after, between |
| Visit memory | Earlier visits on this browser: whether the visitor is returning, pages seen on earlier visits, goals reached, and ad-link values remembered from an earlier landing | at least, equals, is known, is unknown |
| This visit | Counters for the current visit, such as named pages seen or basket adds | at least, equals |
Some details matter when you write conditions:
- Market is a guess from the path. Any first path segment of two letters, with an optional suffix of two to four characters, counts as a market, even if it is a site section. On Shopify stores, the store’s market setting is used when the path has no market segment.
- Came from pages covers your own site only. A visitor who arrives from another site, or with no referrer, came from none of your pages. To target traffic from another site or an ad, use UTM rules or query parameter conditions.
- Time rules use the rule’s time zone, not the visitor’s, so a switch at midnight happens at the same moment for every visitor. A between rule whose start is later than its end wraps past midnight, so
22:00to06:00covers the night. A rule can use the visitor’s own time zone instead. - Visit memory needs storage and consent. It is kept in the visitor’s browser for 30 days by default, or until the campaign ends. In a workspace that waits for consent, a group that uses visit memory never matches for a visitor who has not consented. See Consent and storage.
Unknown values
Section titled “Unknown values”If a signal has no value, it counts as unknown, and unknown never equals anything. A visitor whose location cannot be read does not match “country is one of US, CA”, and does not match a condition that lists every country. Two conditions do match them: “is unknown”, and any condition wrapped in not. For example, “not (country is one of US, CA)” includes visitors with no location. Add “country is known” to the group if they should be left out.
Conditions the runtime cannot read at all are different: a group whose condition uses a signal or comparison it does not know, or a value it cannot parse, never matches, even inside not, all or any.
Location for VPN and cloud visitors
Section titled “Location for VPN and cloud visitors”Location comes from headers on the CDN response, read through the browser’s Resource Timing API. It is unknown when:
- the visitor uses a VPN or a cloud provider’s network, which Grona reports as an unplaceable country;
- the browser or an extension strips the timing headers, or does not support Resource Timing.
City names are matched in the spelling the CDN reports. Expect some share of visitors to have no location, and give them a sensible default group.
What audience rules cannot read
Section titled “What audience rules cannot read”Audience rules cannot read a page variable, a dataLayer value, a cookie you choose or a meta tag. To target visitors that your own systems pick out, create the campaign through the Public API and expose the value as a page variable. See Target visitors by page variable.
Consent
Section titled “Consent”In a workspace set to wait for consent, a visitor who has not consented still sees groups that show one variation to everyone in them and need no visit memory, such as a device, location, time or language group. Tests and groups that use visit memory show the original page until the visitor consents. See Consent and storage.