PHP code example of smronju / nativephp-firebase-analytics
1. Go to this page and download the library: Download smronju/nativephp-firebase-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/ */
smronju / nativephp-firebase-analytics example snippets
use Smronju\NativephpFirebaseAnalytics\Facades\FirebaseAnalytics;
// Respect a user's opt-out. Firebase remembers this across launches.
FirebaseAnalytics::setCollectionEnabled(false);
// Custom event — name: up to 40 letters/digits/underscores, starting with a letter.
FirebaseAnalytics::logEvent('entry_created', ['direction' => 'lent', 'has_due_date' => true]);
// Name a native screen (NativePHP runs every screen in one Activity).
FirebaseAnalytics::logScreenView('settings');