PHP code example of moirei / event-tracking

1. Go to this page and download the library: Download moirei/event-tracking library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

moirei / event-tracking example snippets


Events::track('Purchase', $order);

// or auto track app events

// Somewhere in your app
Events::listen(OrderPlacedEvent::class);

// Elsewhere in your app
OrderPlacedEvent::dispatch($order);

Events::identify($user->id, [
    'name'             => $user->name,
    'email'            => $user->email,
    'phone'            => $user->phone,
    'city'             => $user->city,
    'country'          => $user->country,
    "Favorite Color"   => $user->favoriteColor,
]);
bash
php artisan vendor:publish --tag="event-tracking"