Advanced Targeting Techniques
Use custom properties and JavaScript to target by time of day, language, IP address, geolocation, or scroll position.
Table of Contents
These techniques go beyond the standard page and audience targeting UI. Most require adding a small JavaScript snippet to your app so that custom properties are sent to Appcues via the Appcues.identify() call.
Target by time of day or date
Send the user's local time as custom properties so you can restrict experiences to business hours, specific months, or days of the month.
Add this snippet after the user logs in:
const now = new Date();
Appcues.identify('USER_ID', {
currentDayOfWeek: now.getDay(), // 0 = Sunday, 6 = Saturday
currentDayOfMonth: now.getDate(), // 1–31
currentHour: now.getHours(), // 0–23
currentMonth: now.getMonth() // 0 = January, 11 = December
});
Show a Flow only during business hours (9 AM – 5 PM)
In the experience's Audience section, add two conditions with All:
-
currentHouris greater than8 -
currentHouris less than17
Show a Flow only during a specific month
-
currentMonthequals0(January)
Show a Flow only in the last week of the month
-
currentDayOfMonthis greater than24
Alternative for date-based scheduling: If you want an experience to start and stop on specific calendar dates without code, use the Schedule feature instead.
Target by language (localization)
There are two approaches depending on how many languages you support.
Approach 1: One Flow per language
Best for a small number of languages.
- Build your Flow in a base language.
- Clone the Flow for each additional language. Rename each clone (e.g., "Welcome Tour — French").
- Translate the content in each clone.
- Add a Language condition to each Flow's audience targeting, selecting the matching language.

You can target a broad language (e.g., "Chinese (all)") or a specific dialect (e.g., "Chinese — Hong Kong"). To target multiple dialects, add them as separate conditions with Any logic.
Approach 2: One Flow with HTML blocks
Best when you're comfortable with HTML and want fewer Flows to manage.
Use Advanced > HTML blocks instead of text blocks. Inside each block, add a <div> per language with a CSS class that controls visibility based on the user's browser language:
<div class="lang en">Show in English.</div>
<div class="lang fr">Afficher en français.</div>
<div class="lang de">Auf Deutsch anzeigen.</div>
<style>
.lang { display: none; }
.lang.{{_lastBrowserLanguage}} { display: block; }
</style>
Only the <div> matching the user's browser language will appear.
Fallback for unlisted languages: Add the class names of all unspecified languages to your default block so it shows for any language you haven't explicitly translated.
Using a custom language property: If your app tracks language separately from the browser, send it as a property via Appcues.identify() and reference that property name in the CSS instead of {{_lastBrowserLanguage}}.
Target by IP address
Appcues doesn't target by IP address natively, but you can send the user's IP as a custom property.
Use the Appcues IP endpoint to fetch the user's IP and pass it in the identify call:
fetch('https://api.appcues.net/v1/remote_ip')
.then(response => response.json())
.then(json => {
Appcues.identify('USER_ID', {
ip: json.remote_ip,
// ...other properties
});
});
Once the ip property is populated, you can use comparators like starts with or contains to target IP ranges in your audience conditions.
Blocking a user or IP: There's no built-in block feature. Use audience targeting with a "doesn't equal" or "doesn't contain" condition on the
ipproperty to exclude specific addresses.
Target by geolocation
If your users have enabled browser geolocation, you can pass their coordinates to Appcues and target by geographic area.
Geolocation requires user permission. Test your implementation for cases where the user has and has not enabled it. The geolocation call can also time out — confirm the location data exists before passing it.
function setLocationProperties() {
if (!navigator.geolocation) return;
navigator.geolocation.getCurrentPosition(position => {
Appcues.identify('USER_ID', {
currentLatitude: position.coords.latitude,
currentLongitude: position.coords.longitude
});
});
}
setLocationProperties();
To target a geographic area, define a bounding box using "greater than" and "less than" on both latitude and longitude. Use latlong.net to find coordinates.
Example targeting a region around Boston (42.36, -71.06):
-
currentLatitudeis greater than42.36AND is less than42.37 -
currentLongitudeis greater than-71.07AND is less than-71.05
Trigger a Flow on scroll
Use the Appcues.show() JavaScript call to display a Flow when a user scrolls past a threshold.
This requires adding code to your application.
Appcues.show()bypasses all targeting rules — the Flow will show regardless of audience, frequency, or page targeting.
let shown = false;
window.addEventListener('scroll', () => {
if (shown) return;
const scrollPercent = (window.scrollY + window.innerHeight) / document.body.scrollHeight;
if (scrollPercent > 0.75) {
shown = true;
Appcues.show('FLOW_ID');
}
});
Replace FLOW_ID with the ID of the Flow you want to trigger. You can find the Flow ID on its settings page URL in Studio.
Important: Since Appcues.show() ignores targeting, a "show once" Flow can appear multiple times, and users outside your intended audience will still see it. Set the Flow's trigger to Show manually so it doesn't also fire on page load.
If you need to swap this Flow out later, your developers will need to update the snippet with the new Flow ID.