Session Replay and Heatmaps are based on session capture. By making changes to your session capture settings, it's possible to start capturing sessions only when an event occurs on your site (for example: a modal appears, user scrolls, typing etc.). You can also use events to exclude your employees from Contentsquare tracking.
To get started, you'll first need to set up the Contentsquare Events feature on your site. Our article on Events API can help with this.
It isn't possible to trigger a screenshot based on an event, however you can filter Heatmap session data based on an event. When filtering, Contentsquare will show data collected from sessions where users triggered the event at some point during their session. This doesn't mean the Heatmap screenshot will be captured at the moment the event fired.
For A/B testing purposes, ensure the event names you're using are unique to the page being tested.
Set up session targeting triggered by a specific event
1. Go to your Sites & Organizations Pages
2. Click on the site settings gear icon to visit the site settings page.
3. Click on the Session targeting & tracking section on your site settings page.
4. Select Start capturing sessions on specific pages or when a custom event fires.
5. Enter the event name in the Event field.
This is the name of the event that, when triggered on your site, will start session capture for Replays and Heatmaps.
Click the + icon if you would like to add another targeting rule. Only alphanumeric characters (a-z, A-Z, 0-9), underscores (_), and dashes (-) can be used in the event name.
If an event is present on a page, it will take priority over other targeting rules present, including URL targeting rules.
6. Click Save changes.
Session capture for Session Replay and Heatmaps will start based on these event settings.
Using events to exclude your employees from Contentsquare tracking
1. In your website's code, define a cookie that is stored only for users that are your employees.
Note: Consult a web developer to find the optimal solution for your specific website setup.
2. Adjust your website's code to send an event to Contentsquare only if the employee cookie isn't present.
As an example, you could achieve this by using an if statement to check for the cookie presence:
Javascript
if (isnotEmployee)`window._uxa.push(["event", "start_hotjar"]);`
The isNotEmployee condition should check if the employee cookie is present. If the employee cookie is not present, the start_hotjar event should be fired.
3. Modify your Session targeting and tracking settings in Contentsquare, using the event name to start the session capture.
Follow the steps described in the Setting up session targeting triggered by a specific event section above to complete the setup.