About Analytics Events

Analytics events provide real-time information about user actions on a Wix site. These events can be used by any integration that injects JavaScript into a Wix site. These events can help you track user behavior, measure performance, or react to site activity in real-time.

To listen to these events in your code, call registerEventListener().

Event categories

Analytics events are organized into the following categories:

  • General Events: Basic site interactions like page views, content views, and form submissions.
  • Wix Bookings Events: Service booking and appointment scheduling.
  • Wix Events Events: Event ticket bookings, registrations, and RSVP tracking.
  • Wix Members Events: Sign ups or logins to Wix Members.
  • Wix Stores Events: eCommerce interactions such as product views, cart actions, and purchases.

Listen for analytics events

The code below registers a listener that captures all analytics events triggered on your site. The callback function receives the event name and associated data for every event. While all events are captured, you need to add a case in the switch statement for each event type you want to handle.

Note: This example is for a Wix-hosted environment that doesn't require authentication with a client. When building apps, the authentication method depends on your development environment. See the Site API introduction for detailed setup instructions for your specific environment.

Copy
Did this help?