Event Tracking with Simple Analytics

Image of Iron Brands

Published on Nov 23, 2023 and edited on Dec 11, 2023 by Iron Brands

Did you ever question “How many people visit X page?” or “How many people click Y button?”.

Those are important questions to answer to keep improving your product and grow your business.

You need to use an analytics tool to answer these questions and install events to track these numbers.

Tools like GA4 will help you do this, but it's quite complex. This blog will walk you through the steps to set up event tracking in the easiest way.

  1. What are Events?
    1. Step 1: Install the Script
    2. Step 2: Create the Events
    3. Step 3: Access Event Data
    4. Step 4: Create Goals
  2. Final Thoughts
Logo of the Government of the United KingdomThe UK Government chose Simple AnalyticsJoin them

What are Events?

Events represents all actions on your website, such as button click, page scrolling, or much more advanced ones, such as signup and login.

Check out how events look like in Simple Analytics.


Simple Analytics is a simple website analytics tool that provides a simple JS plugin to help you track all events.

There are two ways you can approach this:

Automated events: These are the ones that are automatically tracked by Simple Analytics, such as outbound clicks, emails, downloads, and a few more.

Custom events: On the other hand, custom events are meant to track all other events a user might need and are user-specific, such as tracking signup or tracking payment flow.

Let’s jump straight into installing it and start collecting data.

Step 1: Install the Script

If you aren’t a Simple Analytics user already, then this is a mandatory step, while others can jump to step 2.

Start by creating your account on Simple Analytics, which will prompt you to add your website and the code below onto your website’s <body> tag.

<script async defer src="<https://scripts.simpleanalyticscdn.com/latest.js>"></script>

<noscript><img src="<https://queue.simpleanalyticscdn.com/noscript.gif>" alt="" referrerpolicy="no-referrer-when-downgrade" /></noscript>

You can place it in the <head> section, but remember to omit the <noscript> part.

Also, if you choose to use our custom domain feature, replace scripts.simpleanalyticscdn.com and queue.simpleanalyticscdn.com with your custom domain.

Step 2: Create the Events

Once the script is installed, it’s time to add our events. Simple Analytics will start tracking and displaying them in the Events Explorer dashboard.

We’ll show you how automated events work and then move to custom events.

To use automated events, you must add the code below to your website. Once the script is added, all automated events will start showing up on your Simple Analytics account.

<script async src="<https://scripts.simpleanalyticscdn.com/auto-events.js>"></script>

If you want to track custom events, such as button clicks, that must be triggered manually using the code below.

// Event to track button click


Remember to trigger these only when your desired event occurs; below is the example of the button click event mentioned above.

<a class="btn" href="./a.html" onClick="sa_event("click_btn_A");">Signup</a>

Once these are added, all events will be sent to Simple Analytics, which we’ll process in the below steps.

Step 3: Access Event Data

With event tracking set up, you can access all your automated and custom events (”click_btn_A” in this case) in the events tab within the Simple Analytics dashboard.

This will give you important insights, such as how many users have clicked on the button, helping you understand the effectiveness of your call-to-action.

Step 4: Create Goals

Next is the final and most important step: Start visualizing your metrics using our “Goals” feature.

Let’s take the example of the custom event we just created and setup goals for it.

  • Define the goal: Give it a name like "Clicked Button <name e.g., A>."
  • Set the event: Choose the event "click_btn_A."
  • Mark the goal as important: Ensure it appears in the visitor dashboard for easy tracking.

In the image below, we use our "signup" button.


By creating these goals, you can monitor the performance of both the conversion (to analyze user interaction).

Final Thoughts

In conclusion, event tracking using Simple Analytics is crucial in understanding user behavior on your website. By tracking various actions such as signups, button clicks, or user flow, you can make data-driven decisions to improve your product or SaaS.

Additionally, setting up goals for each event allows you to monitor and optimize your website/product. With data-driven decisions, you can enhance user experience, improve conversion rates, and ultimately propel your business toward success.

Want to see what that looks like? Check our public dashboard here.

GA4 is complex. Try Simple Analytics

GA4 is like sitting in an airplane cockpit without a pilot license

Start 14-day trial