utopia-php / analytics
A simple library to track events & users.
Installs: 77 749
Dependents: 1
Suggesters: 0
Security: 0
Stars: 15
Watchers: 9
Forks: 21
Open Issues: 5
Requires
- php: >=8.0
- utopia-php/cli: 0.19.*
- utopia-php/system: 0.8.*
Requires (Dev)
- laravel/pint: dev-main
- phpunit/phpunit: ^9.3
- dev-main
- 0.13.0
- 0.13.0-RC2
- 0.13.0-RC1
- 0.12.1
- 0.12.0
- 0.11.0
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.1
- 0.9.0
- 0.8.0
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
- dev-feat-update-composer
- dev-revert-52-feat-orbit-hotfix
- dev-feat-remove-error-handling
- dev-feat-fix-silent-fails
- dev-feat-improve-hubspot
- dev-fix-typehints
- dev-feat-hubspot-adapter
- dev-update-mixpanel-adapter
- dev-add-mixpanel-adapter
- dev-fix-content-type
- dev-code-cleanup
- dev-fix-orbit-tags
- dev-add-account-to-props
- dev-temp-console
- dev-dev
- dev-feat-implement-orbit
- dev-dev2
- dev-refactor-plausible-adapter
- dev-fix-google-events
- dev-feat-improve-activecampaign
- dev-analytics-refactor
- dev-orbit-adapter
- dev-dev1
- dev-activecampaign-adapter
- dev-remove-exceptions
This package is auto-updated.
Last update: 2024-11-09 16:06:37 UTC
README
Utopia Analytics is a simple and lite library to send information about events or pageviews to Google Analytics. This library is aiming to be as simple and easy to learn and use. This library is maintained by the Appwrite team.
Although this library is part of the Utopia Framework project it is dependency free and can be used as standalone with any other PHP project or framework.
Getting Started
Install using composer:
composer require utopia-php/analytics
Init in your application:
<?php require_once __DIR__ . '/../../vendor/autoload.php'; use Utopia\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");
System Requirements
Utopia Framework requires PHP 7.4 or later. We recommend using the latest PHP version whenever possible.
Copyright and license
The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php