Skip to content

Event triggers

Event triggers in Wized allow you to define real-time event listeners that execute specific actions when certain conditions are met. These triggers operate independently of user interaction and can be used to automate logic, update data dynamically, and manage application behavior efficiently.

Each trigger can be accompanied by an optional condition, which determines whether the event should execute. If no condition is set, the event will always run when the trigger is activated.


Available triggers

Custom condition

  • Executes when a user-defined condition evaluates to true.
  • Conditions are created using the function editor and can leverage:
    • Variables
    • Cookies
    • requests responses
    • Input values

Attribute Present

  • Fires when an element with a specific Wized attribute is detected on the current page.
  • Useful for triggering actions based on dynamic elements that load or appear conditionally.

Request Finished

  • Executes immediately after a request completes, whether it succeeds or fails. You can set a conditional, so that this event is executed only when the validation is fulfilled and the request finishes.
  • Can be used to handle API responses dynamically, update UI components, or trigger subsequent requests.

Page Starts Loading

  • Fires as soon as the page starts rendering in the browser.
  • Ideal for:
    • Initializing variables before any user interaction.
    • Executing API requests early to preload data.
    • Displaying loading indicators for better UX.

Page Finishes Loading

  • triggers once all page elements have fully loaded.
  • Perfect for:
    • Handling UI adjustments that depend on the entire page being ready.
    • Running animations or interactive elements.
    • Final validations such as checking user authentication.

Page starts loading Or Page finishes loading

TriggerBest For
Page Starts LoadingInitializing critical data, preloading APIs, showing loading states.
Page Finishes LoadingHandling UI interactions, animations, final data validations.

Choosing the right trigger depends on when the action should take place for the best user experience.