> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: analytics.registerEventListener(eventHandler: RegisterEventListenerEventHandler) # Method Link: https://dev.wix.com/docs/sdk/host-modules/site/analytics/register-event-listener.md # Method Description: Registers an event handler that runs whenever an analytics event occurs on the site. Call this method to register an event handler that runs for all analytics events that occur on the site. The handler runs for both [standard events](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/embedded-scripts/analyze-user-behavior-using-embedded-scripts.md#listen-to-standard-wix-events) and [custom events](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/embedded-scripts/analyze-user-behavior-using-embedded-scripts.md#track-custom-events). > **Note:** To handle specific events, use conditional logic in your handler code. Learn more [about analytics events](https://dev.wix.com/docs/sdk/host-modules/site/events/about-analytics-events.md). # Method Permissions: # Method Permissions Scopes IDs: undefined # Method Code Examples: ## Register an event listener and display event in the console ```javascript ```typescript import { analytics } from '@wix/site'; analytics.registerEventListener((eventName, eventData) => console.log(eventName, eventData) ); ``` ```