Skip to content

Hooks

The module registers the following PrestaShop hooks on install.

Category cache invalidation hooks

Hook What the module does
actionCategoryAdd Deletes FabFacebookPixel_CategoriesTree, FabFacebookPixel_AllCategories, FabFacebookPixel_ProductFetcher from the backoffice cache
actionCategoryUpdate Same as above
actionCategoryDelete Same as above

Frontend tracking hooks

actionFrontControllerInitAfter

Fires on every front controller init. The module uses this hook for two purposes:

1. Guest context capture (always runs, regardless of Iubenda consent): - Reads id_guest, user agent, client IP, _fbp cookie, _fbc cookie from the current request. - If _fbp is associated with a different id_guest (stale guest), remaps pending events and deletes the stale guest context. - Inserts or updates fbp_guest_context for the current guest.

2. CA event dispatch (runs only if Iubenda consent is granted): - Always fires a PageView CA event. - If the page is the checkout (php_self === 'order' or order-opc): also fires InitiateCheckout. - If the page is a category (php_self === 'category'): also fires ViewCategory. - Special case: if the request is from the blockwishlist module (page_name === 'module-blockwishlist-action') and the action is addProductToWishlist, fires AddToWishlist and returns early (skips the other logic).

actionFrontControllerSetMedia

Injects the Vite-compiled frontend JavaScript bundle into the page. Passes the poll, confirm, and revoke URLs to the script via Media::addJsDef() as window.fbpConsumer. Also passes iubendaIntegration and consoleEnabled flags.

actionCartUpdateQuantityBefore

Fires when a product's cart quantity changes. If the operator is up or the quantity is positive, fires AddToCart via CA.

actionSearch

Fires when a storefront search is executed. Fires a Search CA event with the query string and result count.

displayProductAdditionalInfo

Fires on the product page (display hook in the additional info area). Fires ViewContent CA event with product ID, price, and name.

actionValidateOrder

Fires when an order is validated. Fires Purchase CA event with order total and product list.

actionCustomerAccountAdd

Fires when a new customer account is created. Fires CompleteRegistration CA event.