# give/4.16.9/src/Tracking/Contracts/TrackEvent.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 53 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/Tracking/Contracts/TrackEvent.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/Tracking/Contracts/TrackEvent.php
- Modified: 2021-11-23T23:55:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/Tracking/Contracts/TrackEvent.php#L10-L20`.

```php
<?php

namespace Give\Tracking\Contracts;

use Give\Tracking\Enum\EventType;
use Give\Tracking\TrackRegisterer;

/**
 * Class TrackEvent
 *
 * This class represents a send tracked data request event
 *
 * @package Give\Tracking\Contracts
 * @since 2.10.0
 */
abstract class TrackEvent
{
    /**
     * @var EventType
     */
    protected $eventType;

    /**
     * @var TrackRegisterer
     */
    protected $track;

    /**
     * @var string
     */
    protected $dataClassName;

    /**
     * TrackEvent constructor.
     *
     * @param TrackRegisterer $track
     */
    public function __construct(TrackRegisterer $track)
    {
        $this->track = $track;
    }

    /**
     * Record track id and data.
     *
     * @since 2.10.0
     */
    public function record()
    {
        $this->track->register($this->eventType, $this->dataClassName);
    }
}

```
