Tutorial: Generate a Log from Your Site

This tutorial demonstrates how to generate a log from your site code. We will then view the generated log using Wix Logs.

In this tutorial, we will:

  1. Add a button to your site's homepage.
  2. Create an event handler that generates a log whenever the button is clicked.
  3. View the generated log using Wix Logs.

Note: In this tutorial, logs are generated from page code. However, you can also generate logs from code that runs on the site backend.

Step 1 | Add a button to your site

Add a button to your site and create an event handler:

  1. Add a button labeled button1 to your site's home page.

  2. In the site's home page code, add an event handler that runs whenever the button is clicked:

    Copy
  3. Preview or publish your site.

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

Step 2 | Generate and view a site log

Generate a log and view it using Wix Logs as follows:

  1. In a separate browser tab or window, open the Wix Logs dashboard page.

  2. In your live site's homepage, click the button you created:

    The log appears in the Wix Logs page:

    Click the log to view its full details:

    You can also view the site logs for frontend events in your browser's console:

See also

Did this help?