Hotjar supports tracking across subdomains, however, it cannot track a user session across different top-level domains. Keep in mind that tracking a domain and subdomains simultaneously will mean that your Hotjar plan is shared, and recorded sessions across all domain/subdomains will be counted towards the shared Hotjar plan limits.
A limitation exists for tracking subdomains if session targeting is based on specific page URLs.
If your Site's session targeting criteria includes specific page targets, be sure to read the Limitations section at the bottom of this article.
Domains vs. subdomains
A domain is an easy-to-remember name that’s associated with an IP address on the Internet. It’s the unique name that appears after the @ in email addresses, and after www. in web addresses. Some familiar examples are domains like hotjar.com and google.com.
A subdomain is a secondary domain within a primary domain. Subdomain names will always appear to the left of the primary domain name. The table below has examples of common domains, related subdomains, and other pages/domains that are not related to the domains listed in the first column:
Anything added to the right of the primary domain is not a subdomain. This is just a page within the primary domain.
Tracking domain and subdomains together
To track sessions between a domain and one or more related subdomains, make sure to install the same Tracking Code on each of the related sites. You can find the Hotjar Tracking Code on the Sites & Organizations page by clicking on the View tracking code link next to the Hotjar Site you plan to use.
For help with installing your Tracking Code, check out: How to Install the Hotjar Tracking Code.
Using the same Tracking Code will allow you to collect data from your domain and subdomains in the same Hotjar Site Dashboard and prevent the need to create additional Hotjar Sites for each subdomain.
Using the same Tracking Code on multiple sites will cause your plan limits to be shared.
Sessions from your domain and shared subdomains will count towards your Observe plan's daily session allowance and Ask plan's monthly responses allowance. Consider this when choosing the best Ask/Observe plan to use with your Hotjar Site.
Tracking domain and subdomains separately
If you want to collect data for different subdomains separately, you can add a new Site for each domain/subdomain you plan to track with Hotjar. Then install the unique Tracking Codes from each Hotjar Site to the corresponding website you're tracking.
Installing unique Tracking Codes for each domain/subdomain will separate data collected from your sites across various Hotjar dashboards. To add additional Sites to your Hotjar account, check out How to Add Organizations and Sites.
You can search for Sites and Organizations within your account by using the search bar at the top of your dashboard.
Only admin-level team members have access to add sites
Only team members with admin access can make changes to the setup of your Hotjar account. A full explanation of our team member permissions can be found in our Team Member Permissions article.
Limitations with session targeting
Tracking sessions across top-level domains
Hotjar cannot track across different top-level domains, for example, going from example.com to hotjar.com.
For session capture (Recordings and Heatmaps), a unique identifier allows us to track a user's session across multiple pages. However, due to inherent browser limitations, we are unable to see this identifier when a user moves to a different top-level domain.
If this occurs, the user's Hotjar session will end and a new session will begin (not associated with the previous session).
Tracking sessions across subdomains with page-specific targeting
When your session capture targeting settings are configured to start on one or more specific pages, Hotjar sets a session cookie for the user telling our script to record all subsequent pages. However, since session cookies are bound to each domain/subdomain, Hotjar is not able to read the cookie if the domain/subdomain changes.
This causes the active Hotjar session to stop when the user navigates between a domain and a related subdomain. There are two workarounds to avoid this issue when tracking across related domain/subdomains:
Remove the specific page targeting in your targeting settings and instead record all pages.
Add any/all additional domain/subdomains to the page targeting settings.
For example, pretend you have an eCommerce store with a cart page on the following primary domain. www.example.com/cart. During the checkout process, users are redirected to a subdomain like this: checkout.example.com
To ensure the session is tracked across the domain and subdomain, you would need to alter the session capture targeting rules to include both domain and subdomain targets. It would look something like this:
For more help with updating the session targeting settings, visit Configuring Site Settings.