Hatch resource banner image for How to set up product analytics and event tracking

How to set up product analytics and event tracking

Setting up product analytics allows you to see exactly how customers use your software so you can stop guessing and start building what they actually want.

To set up product analytics, you need to choose a tracking tool, define the key actions users take in your app, and install a small snippet of code or an SDK to capture those moments. Start by focusing on the 'Golden Path'—the sequence of steps a user takes to find value in your product—and ensure you are tracking each milestone along that journey.

1. Choose your analytics tool

While standard web analytics tell you where people come from, product analytics tell you what they do once they arrive. For a UK startup, several tools offer generous free tiers for early-stage businesses:

  • PostHog: An all-in-one platform that includes session recordings and heatmaps. It is very popular with developers because it is open-source.
  • Mixpanel: Excellent for 'funnel analysis' (seeing where people drop off) and is very user-friendly for non-technical team members.
  • Amplitude: Best suited for deep-dive behavioural analysis if you have a complex product with many different user paths.

2. Create a tracking plan

The biggest mistake is 'tracking everything'. This leads to messy data that nobody uses. Instead, create a simple spreadsheet (a tracking plan) listing the specific 'Events' you want to monitor. Common events include:

  • Account Created
  • Workspace Invited
  • Feature Used (e.g., 'Report Generated')
  • Subscription Started

For every event, decide what extra info you need. For a 'Report Generated' event, you might also want to track the 'Report Type' or 'File Size'.

3. Integrate the SDK

Once you have your tool and your plan, you need to connect your software to the analytics provider. This usually involves:

  1. Installing the Library: Your developer will add a small package (SDK) to your code via a manager like NPM or Yarn.
  2. Initialising: Adding a unique API key to your app's header so the data knows which account to go to.
  3. Identifying Users: Use an 'identify' call to link anonymous browsing data to a specific user ID once they log in. This is crucial for seeing a single user's journey across different devices.

4. Use consistent naming conventions

To keep your data clean as you grow, adopt a strict naming convention immediately. A popular choice is the 'Object + Action' framework (using the past tense). For example:

Bad Event NameGood Event Name
click_button_1Project Created
SignupUser Signed Up
form_submitProfile Updated

Tips for success

Always ensure your analytics setup is GDPR compliant. In the UK, this means you should only trigger non-essential tracking cookies after the user has given consent via your cookie banner.

  • Test your events: Before launching, use the 'Live Stream' or 'Debugger' view in your chosen tool to make sure events are actually firing when you click buttons.
  • Keep it simple: Start with just 5 to 10 core events. You can always add more later, but deleting bad data is much harder.

Created by hatch. • Updated on April 28, 2026