Velo: Generating a Log Event to Debug Your Site

Visit the Velo by Wix website to onboard and continue learning.

Every time a console message (e.g. console.log, console.error) runs anywhere in your site code it generates a site event, producing a log in the Site Events window. You can use log information to debug your site.

Example: Monitoring Button Clicks

Note In the example below we generate a site event by running a console message in our page code. You can also generate site events by running console messages from the backend, web modules, public, or anywhere else in your site.

Follow the instructions below to generate a log every time a site visitor clicks a specific button in your site. Or adapt the example to monitor any part of your site.

  1. In the Editor, add a button labeled "button1" to a page on your site called "Test".
  2. Create an event handler via the Properties & Events panel that runs when button1 is clicked.
  3. Add a console.log message to the event handler.
  4. Publish your site.

Note You can also generate site event logs when previewing your site, but some log information is only available once your site is published.

  1. Make sure the Logs Site Events window is open in your Dashboard.
  1. In your live site, navigate to the Test page.

  2. (Optional) Open your browser's developer tools to view console messages in your browser.

  3. Click button1.

    The console message appears in the browser console.

  1. Reload the Site Events window.

    A site event is generated and a log of the event appears in the Site Events window.

To view log information, click the event in the table.

Note For a detailed description of log information, click here.

Was this helpful?
Yes
No