registerEventListener( )


Deprecated

This method is deprecated.

Deprecated. This method will continue to work, but a newer version is available. Use the registerEventListener() method instead.

Migration Instructions

If this method is already in your code, it will continue to work. To stay compatible with future changes, migrate to registerEventListener().

To migrate to the new method:

  1. Add the new import statement:

    Copy
  2. If you plan to migrate all methods that use registerEventListener(), remove the original import { window } from "@wix/site-window"; statement.

  3. Look for any code that uses window.registerEventListener(), and replace it with analytics.registerEventListener(). Update your code to work with the new registerEventListener() call and response properties.

  4. Test your changes to make sure your code behaves as expected.

Note: Check the new method documentation for any differences in parameters, return values, or behavior compared to the deprecated registerEventListener() method.

Registers a listener for all events triggered by trackEvent().

This method captures every tracking event sent to external analytics tools. You don't need to specify a particular event name or parameters. The listener receives each event triggered by trackEvent(), along with the event name and parameters provided as arguments.

For standard tracking event descriptions refer to trackEvent().

Migration Instructions

If this method is already in your code, it will continue to work. To stay compatible with future changes, migrate to registerEventListener().

To migrate to the new method:

  1. Add the new import statement:

    Copy
  2. If you plan to migrate all methods that use registerEventListener(), remove the original import { window } from "@wix/site-window"; statement.

  3. Look for any code that uses window.registerEventListener(), and replace it with analytics.registerEventListener(). Update your code to work with the new registerEventListener() call and response properties.

  4. Test your changes to make sure your code behaves as expected.

Note: Check the new method documentation for any differences in parameters, return values, or behavior compared to the deprecated registerEventListener() method.

Method Declaration
Copy
Method Parameters
eventNamestringRequired

The name of the event triggered by trackEvent().


paramsanyRequired

The parameters of the event triggered by trackEvent().

Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?