Hotjar — Documentation
Hotjar for PrestaShop adds Hotjar tracking and browser Events API events to your storefront, so you can study heatmaps, recordings, feedback, and key shopping actions from your Hotjar dashboard. It helps you see where shoppers click, scroll, hesitate, search, add products, start checkout, and complete orders.
Features
- Hotjar script injection. The module loads Hotjar from
displayHeaderafter tracking is enabled and a numeric Hotjar Site ID is saved. - Numeric Site ID validation. The configuration form blocks invalid Site IDs and shows a required-configuration notice until the store is ready.
- Consent-aware loading. Hotjar can wait for marketing consent from
mprcookiesrevolutionormprcookiebannerbefore loading the browser script. - Employee session exclusion. Administrator storefront visits can be excluded so your own browsing does not pollute recordings.
- Standard storefront events. The module can send
page_view,product_view,category_view,add_to_cart,add_to_wishlist,checkout_start,search,purchase, andsign_up. - Per-event switches. Each standard event type can be enabled or disabled from the module configuration.
- Order confirmation tracking. The
displayOrderConfirmationhook sends thepurchaseevent when a valid order is available. - Registration tracking. The
actionCustomerAccountAddhook marks new account creation and sendssign_upon the next storefront page. - Custom JSON event rules. You can trigger Hotjar events from CSS selector clicks, URL path contains rules, controllers, module-name fallback checks, or custom DOM events.
- Readiness diagnostics. The Back Office configuration page shows Site ID, browser tracking, consent guard, standard event, custom event, and server-side API status.
Configuration options
Set these in Modules > Module Manager > Hotjar > Configure.
- Enable Hotjar. Turns the storefront Hotjar tracking code and Events API calls on or off; default:
0. - Site ID. Stores the numeric Hotjar Site ID from Hotjar Sites & Organizations; default: ``.
- Exclude employee sessions. Prevents tracking when a logged-in Back Office employee browses the storefront; default:
1. - Respect marketing consent. Loads Hotjar only after marketing consent when
mprcookiesrevolutionormprcookiebanneris installed and enabled; default:1. - Track page views. Sends
page_viewon tracked storefront pages; default:1. - Track product views. Sends
product_viewon product pages when the current product can be detected; default:1. - Track category views. Sends
category_viewon category pages when the current category can be detected; default:1. - Track add to cart. Sends
add_to_cartfrom common add-to-cart button clicks, including.add-to-cartanddata-button-action="add-to-cart"; default:1. - Track add to wishlist. Sends
add_to_wishlistfrom common wishlist button clicks; default:1. - Track checkout start. Sends
checkout_starton native checkout and known checkout routes, including extramprcheckoutrevolutioncart paths; default:1. - Track searches. Sends
searchon detected search pages when a search term is available. Search page detection checks selected controllers,s, orsearch_query; default:1. - Track purchases. Sends
purchaseon the order confirmation page throughdisplayOrderConfirmation; default:1. - Track registrations. Sends
sign_upafter a new customer account is created; default:1. - Track custom events. Enables the JSON custom event rule engine; default:
0. - Custom event rules. Stores the JSON array used for custom Hotjar events; default: ``.
Customization examples
Send a Hotjar event when a shopper clicks the main product image:
[
{
"event": "GalleryBrowse",
"trigger": "click",
"selector": ".product-cover img",
"label": "Gallery browse"
}
]
Send a Hotjar event when the URL path contains /checkout:
[
{
"event": "CheckoutPathViewed",
"trigger": "url",
"contains": ["/checkout"]
}
]
Send an event on product pages by controller name:
[
{
"event": "ProductPageViewed",
"trigger": "controller",
"controllers": ["product"]
}
]
Send one event on native checkout controllers or, if those controller names do not match, on an mprcheckoutrevolution front module route:
[
{
"event": "CheckoutFlowViewed",
"trigger": "controller",
"controllers": ["order", "orderopc"],
"modules": ["mprcheckoutrevolution"]
}
]
Listen for a custom browser event from your theme or another module:
[
{
"event": "SizeGuideOpened",
"trigger": "event",
"dom_event": "mprhjar:size-guide",
"params": {
"placement": "product_page"
}
}
]
Dispatch that browser event from a theme script:
document.dispatchEvent(new CustomEvent('mprhjar:size-guide', {
detail: {
source: 'size_guide_button'
}
}));
Hotjar receives the event name through the browser Events API:
hj('event', 'add_to_cart');
Installation
- In your Back Office, go to Modules > Module Manager.
- Click Upload a module and select the module ZIP file.
- Once installed, click Configure.
- Enter your numeric Hotjar Site ID.
- Enable Hotjar tracking.
- Save and check the Hotjar tracking readiness table on the module page.
How it works
The module registers displayHeader, displayOrderConfirmation, and actionCustomerAccountAdd. In the storefront header it prepares the Hotjar runtime, loads Hotjar asynchronously from https://static.hotjar.com/c/hotjar-{SITE_ID}.js?sv=6, and sends enabled page-level or click-based events through the browser.
In the Back Office, you see a Hotjar settings form and a readiness table. In Hotjar, you see the usual Hotjar heatmaps, recordings, feedback tools, and event filters; the reports themselves stay inside your Hotjar account.
Honest limits
Hotjar's browser Events API receives event names only, such as purchase or add_to_cart. The module prepares ecommerce details such as product IDs, value, currency, search term, and order data for local demo monitoring, but Hotjar itself receives the clean event name.
The module does not store Hotjar heatmaps, recordings, feedback, or survey data on your PrestaShop server. It also does not provide a server token, retry queue, or cron worker because Hotjar event tracking here is browser-side.
If no supported MPR consent module is installed, the consent guard does not block Hotjar by itself. For privacy compliance, your cookie banner and privacy policy still need to cover Hotjar for your market.
Frequently Asked Questions
Does the module store Hotjar recordings in PrestaShop?
No. The module loads Hotjar and sends browser event names. Heatmaps, recordings, feedback, and Hotjar reports are managed in your Hotjar account.
Do I need to mention Hotjar in my cookie policy?
Yes. Hotjar sets cookies and collects behavior data. For EU stores, disclose Hotjar in your privacy and cookie policy and use consent gating before loading analytics or behavior tracking.
Can the module wait for cookie consent?
Yes, when consent handling is enabled and an MPR consent module is installed. The module supports mprcookiesrevolution and mprcookiebanner.
Does Hotjar receive product IDs, order totals, or customer data from this module?
No. Hotjar receives the event name only. The module's ecommerce payload is used for local demo verification, not as Hotjar event properties.
Will Hotjar slow down my store?
The Hotjar script is loaded asynchronously from Hotjar's domain, so it should not block page rendering. As with any third-party script, you should still review performance with your normal speed testing tools.
Compatibility: PrestaShop 1.6 to 9.0 (latest), PHP 7.1+. We continue to support upcoming PrestaShop versions.