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 window. You can use log information to debug your site.
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.
- In the Editor, add a button labeled "button1" to a page on your site called "Test".
- Create an via the Properties & Events panel that runs when button1 is clicked.
- Add a console.log message to the event handler.
- 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.
- Make sure the Logs window is open in your Dashboard.
In your live site, navigate to the Test page.
(Optional) Open your browser's to view console messages in your browser.
The console message appears in the browser console.
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 .