Skip to content

Commit f1ce818

Browse files
committed
docs(product tours): add element targeting, button, and progression docs
1 parent e6feee7 commit f1ce818

File tree

5 files changed

+195
-10
lines changed

5 files changed

+195
-10
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Step buttons
3+
sidebar: Docs
4+
showTitle: true
5+
---
6+
7+
import Alpha from './_snippets/alpha.mdx'
8+
9+
<Alpha />
10+
11+
Each Product Tour step (or modal announcement) has a primary button and, optionally, a secondary button. Toggle on "custom buttons" in the Product Tour editor to configure your steps with these actions:
12+
13+
## Next step
14+
15+
Default primary button behavior - moves your tour to the next step.
16+
17+
_Not available for announcements._
18+
19+
## Previous step
20+
21+
Default secondary button behavior - moves your tour to the previous step.
22+
23+
**Note:** if your tour casues users to navigate to another page, this action **will not navigate them back.** In these cases, we recommend disabling the secondary button, or swapping to a different action.
24+
25+
_Not available for announcements._
26+
27+
## Start tour
28+
29+
Ends the current tour and starts another one. This is great for triggering product tours from [announcements](/docs/product-tours/creating-announcements)!
30+
31+
## Open link
32+
33+
Opens a given link in a new tab.
34+
35+
## Dismiss
36+
37+
Dismisses the current tour or announcement.

contents/docs/product-tours/creating-product-tours.mdx

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,67 @@ Product tours are multi-step walkthroughs that highlight elements in your UI. Yo
1414

1515
1. Go to [Product tours](https://us.posthog.com/product-tours) in PostHog
1616
2. Click **New tour** and select **Product tour**
17-
3. Enter the URL where you want to build the tour and click **Open toolbar**
17+
3. Enter the URL where you want to build the tour and click **Launch**
1818

19-
## Select elements
19+
## Define your tour steps
2020

21-
Click elements on your page to create steps. PostHog generates a CSS selector for each element automatically.
21+
The Toolbar is where you'll build the "skeleton" of your tour. Create steps, optionally attached to elements on your page, and configure some basic settings for them.
2222

23-
>**Note:** If your target elements do not have stable selectors like `id` or `data-*`, the tour may fail to correctly identify them. We're working on a new element-finding algorithm, stay tuned!
23+
<ProductScreenshot
24+
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2026_02_05_at_10_04_48_PM_129f5894c4.png"
25+
imageDark="https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2026_02_05_at_10_04_17_PM_a56ff45a20.png"
26+
alt="Product Tour Toolbar editor"
27+
classes="rounded"
28+
/>
29+
30+
When attaching elements to steps, you'll be able to choose between **Auto** and **Manual** targeting:
31+
32+
- **Auto**: simply click your element and we'll collect data about it so we can reliably find it again during tours
33+
- **Manual**: you provide a CSS selector for us to target the element
34+
35+
To learn more about auto vs. manual element targeting, see [Element selection](/docs/product-tours/element-selection).
2436

2537
## Edit step content
2638

2739
After defining your tour structure in the toolbar, edit step content (text, formatting, images) in the main PostHog app.
2840

29-
Tour-wide settings like styling and display conditions are available in the right panel. You can also do basic editing in the toolbar while selecting elements on your site.
41+
Tour-wide settings like styling and display conditions are available in the right panel.
42+
43+
Below the content editor, you'll find step-specific settings like button configuration and targeting precision.
44+
45+
<ProductScreenshot
46+
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2026_02_05_at_10_00_11_PM_d3f39b13c4.png"
47+
imageDark="https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2026_02_05_at_9_59_06_PM_bcf1538067.png"
48+
alt="Product Tour editor"
49+
classes="rounded"
50+
/>
3051

3152
## Step progression
3253

3354
Steps can progress via buttons or when the user clicks the target element. Guide users through real interactions, not just info.
3455

3556
## Step types
3657

37-
### Element steps
38-
39-
The default. Highlights a specific element with a tooltip. Positioning is automatic based on available viewport space.
58+
### Pop-up steps
4059

41-
### Modal steps
60+
The default. Show a tooltip with your content, positioned anywhere on the screen or attached to a particular element on the page.
4261

43-
Screen-positioned dialogs not anchored to any element. Useful for welcome messages or summary screens.
62+
<ProductScreenshot
63+
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2026_02_05_at_9_43_34_PM_3f352cf68b.png"
64+
alt="Pop-up step example"
65+
classes="rounded"
66+
/>
4467

4568
### Survey steps
4669

4770
Embed a survey question mid-tour (open text or rating scale). Responses are captured as events.
4871

72+
<ProductScreenshot
73+
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2026_02_05_at_10_02_02_PM_e335e8f0bb.png"
74+
alt="Survey step example"
75+
classes="rounded"
76+
/>
77+
4978
## Save and launch
5079

5180
Click **Save** in the toolbar to save your tour as a draft. When ready, [launch the tour](/docs/product-tours/managing-tours).
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Element selection
3+
sidebar: Docs
4+
showTitle: true
5+
---
6+
7+
import Alpha from './_snippets/alpha.mdx'
8+
9+
<Alpha />
10+
11+
PostHog provides two ways to target specific elements for Product Tours: **auto** and **manual**.
12+
13+
## TL;DR
14+
15+
By default, we use a robust **automatic** targeting algorithm to find your elements. This is the recommended approach, but may need some configuration tweaks depending on your app.
16+
17+
If you prefer, you can swap to **manual** targeting, and provide a CSS selector for us to use for finding tour elements.
18+
19+
## Automatic element targeting
20+
21+
Automatic targeting is the default for all tour steps. This is the recommended option for most cases, but read on to learn when it may not work, or when you may need to tweak its configuration.
22+
23+
When you select an element, we collect information such as class names and other attributes so we can reliably find it again later.
24+
25+
Here's how it works:
26+
1. When you select an element, we gather many "groups" of selectors that match your element (and potentially other elements)
27+
2. These groups are sorted by specificity, so the groups matching the lowest number of elements are prioritized
28+
2. At tour runtime, we reverse this algorithm to see which elements are matched by each group
29+
3. Each found element gets a "vote"
30+
4. The element with the highest number of votes "wins" and is used for the given tour step
31+
32+
This process has proven to be far more robust than most other Product Tours products that simply build a single CSS selector for your chosen elements.
33+
34+
However, it won't always be perfect, so we provide some controls to help in case your tours match unexpected elements:
35+
36+
### Dynamic text
37+
38+
By default, automatic element targeting uses the **element's text** as a targeting attribute. For elements with static text, this results in extremely reliable element selection.
39+
40+
However, if your elements have dynamic text (such as a button that says `"Hello, {first_name}!"`), you should toggle on "Dynamic text" to prevent PostHog from attempting to find the element using its text value.
41+
42+
### Targeting precision
43+
44+
If you experience tours failing to find elements (or finding the wrong ones), you can tweak the **precision** for those elements.
45+
46+
Precision ranges from "loose" (0) to "strict" (1). Increase targeting precision if your tours find the wrong elements, and decrease if they fail to find elements.
47+
48+
Under the hood, here's how it works:
49+
- We use the precision value (0-1) as a ratio to determine how many groups will be searched
50+
- The default precision is 1, the strictest, which always means we'll only use the group with the highest specificity. This is great for elements with specific attributes like `data-attr`.
51+
- A precision of 0 ("loose") means we'll search _all_ groups to find your target element
52+
53+
Generally speaking, a precision of 0 ("loose") is not recommended unless your tour has other conditions to help prevent matching the wrong elements, such as specific URL targeting.
54+
55+
## Manual element targeting
56+
57+
If automatic selection does not work, or you want to guarantee your tours never match the wrong elements, we recommend using **manual** targeting.
58+
59+
With manual targeting, you simply provide a CSS selector like `[data-attr="dashboard-button"]`, and we'll use that at tour runtime to find your element.
60+
61+
You should **not use manual targeting** if your element(s) only have selectors that generic, such as class names repeated throughout the page.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Tour progression
3+
sidebar: Docs
4+
showTitle: true
5+
---
6+
7+
import Alpha from './_snippets/alpha.mdx'
8+
9+
<Alpha />
10+
11+
Product Tours can progress in one of two ways: **button click** or **element click**.
12+
13+
These options are available in the "Advance on..." section of tour step settings in both the Toolbar and PostHog's main app.
14+
15+
## Next button
16+
17+
This is the default behavior for new tour steps. We'll show a button that takes the user to the next step in your tour.
18+
19+
To learn more about customizing this button and its behavior, see [Button actions](/docs/product-tours/button-actions).
20+
21+
<ProductScreenshot
22+
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2026_02_05_at_9_43_34_PM_3f352cf68b.png"
23+
alt="Tour step with next button"
24+
classes="rounded"
25+
/>
26+
27+
## Element click
28+
29+
For more interactive tours, you can choose **Element click** as a step's progression trigger.
30+
31+
With this option we will not show a "Next" button by default, and users will get to the next step by clicking on the current step's element.
32+
33+
<ProductScreenshot
34+
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2026_02_05_at_9_43_51_PM_1bc40810ca.png"
35+
alt="Tour step with element click"
36+
classes="rounded"
37+
/>

src/navs/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4629,6 +4629,27 @@ export const docsMenu = {
46294629
icon: 'IconToggle',
46304630
color: 'orange',
46314631
},
4632+
{
4633+
name: 'Concepts',
4634+
},
4635+
{
4636+
name: 'Element selection',
4637+
url: '/docs/product-tours/element-selection',
4638+
icon: 'IconCursorClick',
4639+
color: 'orange',
4640+
},
4641+
{
4642+
name: 'Tour progression',
4643+
url: '/docs/product-tours/tour-progression',
4644+
icon: 'IconArrowRight',
4645+
color: 'orange',
4646+
},
4647+
{
4648+
name: 'Button actions',
4649+
url: '/docs/product-tours/button-actions',
4650+
icon: 'IconButton',
4651+
color: 'orange',
4652+
},
46324653
{
46334654
name: 'Guides',
46344655
},

0 commit comments

Comments
 (0)