The Page Change Listener captures browsing activities for single-page applications by applying event logic rules that track visitor navigation.
Adding a Page Change Listener
- Click Listeners in the navigation bar.
- Click Add Listener.
- A pop-up window appears. Check the Show all box. Enter "page change" in the search bar. Click Page Change Listener.
- The Page Change Listener page opens. You can expand or collapse metadata fields (favorite, labels, and description) by clicking the chevron at the top of the page.
Configuring the Page Change Listener
1. Select channel(s)
Define the channels, and optionally specific URLs within these channels, on which you want this connection to be active.
2. Create rules to apply specific logic.
Create rules to apply specific logic that tracks navigation behavior in the Page Change listener. To create a new rule, click the "Add capturing method" button and choose one of the following options:
- On hashChange event - Triggers a page view based on the hashChange event in the browser activity.
- On popState event - Triggers a page view based on the popState event in the browser activity.
- On pushState event - Triggers a page view based on the pushState event in the browser activity.
- On replaceState event - Triggers a page view based on the replaceState event in the browser activity.
3. Save your settings.