How to exclude pages from tracking on Hotjar
You can exclude pages from Hotjar tracking by using URL targeting rules in your site settings to specify which pages should not be tracked. This involves setting up exclusion patterns or using the Hotjar API to disable tracking on specific URLs.
Prerequisites
- Active Hotjar account with admin access
- Hotjar tracking code installed on your website
- Knowledge of URL patterns and regex basics
- Understanding of your website's page structure
Step-by-Step Instructions
Access your Hotjar dashboard
Navigate to site settings
Configure URL targeting rules
Set up exclusion patterns
*/admin/*- excludes all admin pages*/login- excludes login page*/private/*- excludes private sections
Configure recording and heatmap exclusions
Implement JavaScript exclusions (optional)
window.hj=window.hj||function(){(hj.q=hj.q||[]).push(arguments)};
hj('event', 'disable_tracking');Place this code before the standard Hotjar tracking script on pages you want to exclude.
Save and verify settings
Test exclusion effectiveness
Common Issues & Troubleshooting
Exclusion rules not working immediately
Hotjar exclusion rules can take up to 24 hours to fully propagate. Clear your browser cache and wait for the changes to take effect before testing.
Wildcard patterns excluding too many pages
Refine your URL patterns to be more specific. Use /admin/dashboard/* instead of /admin/* if you only want to exclude dashboard pages, not all admin pages.
Some tracking data still appearing from excluded pages
Check if you have multiple Hotjar tracking codes installed or if there are cached versions. Also verify that your exclusion patterns exactly match the URL structure of your pages.
Unable to exclude dynamic URLs with parameters
Use regex patterns in your exclusion rules or implement JavaScript-based exclusions for pages with complex URL structures or query parameters.