PHP code example of utopia-php / analytics

1. Go to this page and download the library: Download utopia-php/analytics 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/ */

    

utopia-php / analytics example snippets




topia\Analytics\GoogleAnalytics;

$ga = new GoogleAnalytics("UA-XXXXXXXXX-X", "CLIENT-ID");

// Sends a pageview for `appwrite.io/docs/installation`.
$ga->createPageView("appwrite.io", "/docs/installation");

// Sends an event indicating an installation.
$ga->createEvent("Installation", "setup.cli");
// Sends an event indicating that the fall campaign promotional video was played.
$ga->createEvent("Videos", "play", "Fall Campaign");

bash
composer