# Event tracking

Learn how to track events for analysis and personalization.

Events track user interactions with your application, such as button clicks, content views, purchases, and more. They feed the personalization engine and help you measure how users interact with your application and track conversions.

The following sections provide examples of how you can use the Laravel SDK to track these events in your application.

## Basic usage

To track an event, call the [`track`](/reference/sdk/javascript/api/plug/track) method with the event name and its properties. Because tracking runs in the browser, you invoke it from your views with the [`@croct`](/reference/sdk/laravel/api/blade) Blade directive, which runs the snippet once the SDK has loaded.

For example, to track a conversion when a user places an order:

**resources/views/checkout.blade.php**

```blade
@extends('layouts.app')

@section('content')
    <button id="place-order">Place order</button>

    @croct
        const button = document.getElementById('place-order');

        button.addEventListener('click', () => {
            croct.track('goalCompleted', {goalId: 'paymentApproved'});
        });
    @endcroct
@endsection
```

For the events worth tracking and their payloads, see the [recommended events](/reference/sdk/javascript/event-tracking#recommended-events), and the [Events reference](/reference/event/overview#event-types) for the complete list.

## Explore

- [Event reference](/reference/event/overview): Learn more about the available events and their properties.
- [Track reference](/reference/sdk/javascript/api/plug/track): Explore the track method and the available options.
