Single Page App Notes

Default Handling of Page Changes

By default, the ForeSee® Web SDK re-evaluates include/exclude rules and increments the pages viewed count on each page load or page URL change (including changes in the fragment of a URL). This default behavior is expected to work well in most cases.

Special Handing of Page Changes (rarely used)

If you'd like the ForeSee® Web SDK to ignore fragment URL changes, this setting change can be implemented by ForeSee Support.
(For reference, an example of a fragment URL change would be a navigation between and ForeSee Support can configure the SDK to ignore the fragment URL changes by setting our IgnoreNavigationEvents property to true.

If you chose the option to disable the capture of fragment URL changes, you may need to manually force the re-evaluation of include/exclude rules or increment the page count in-between page loads. In this case, two API commands are available: Re-evaluates include/exclude rules for CX Measurement survey and increments page view count. Example scenario: You want to increment page views when a user navigates down a long page in which the URL does not change, or only the fragment identifier changes.

FSR.resetFeedback(): Re-evaluates include/exclude rules for Feedback badge display.
Example scenario: You have configured a Feedback badge to appear on but not If a user is navigating from one URL to the other, you need this command to force a re-evaluation of the Feedback badge inclusion rules since, by default, the re-evaluation only occurs on non-fragment URL changes.

When implementing these methods, it is recommended to use our special fsReady() callback function as a wrapper. Due to the asynchronous way that the ForeSee code is loaded onto the page, there is no guarantee that specific methods will be available when you want to use them. Wrapping your calls in fsReady() ensure that they are available. For example:

// This should appear BELOW the foresee embed snippet
fsReady(function() {; // increments page view count and re-evaluates include/exclude rules for CX Measurement surveys
    FSR.resetFeedback() // re-evaluates include/exclude rules for Feedback site badge