Download the PHP package vipertecpro/app-analytics without Composer

On this page you can find all versions of the php package vipertecpro/app-analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package app-analytics

App Analytics & Remote Config for NativePHP — works with Firebase

Latest version Tests PHP NativePHP Mobile Platforms Licence Downloads

Measure how your NativePHP Mobile app is used and change its behaviour without a release. This plugin gives you one PHP API for analytics events, user properties and screen views and for Remote Config feature flags with in-app defaults, backed by the Firebase Analytics and Remote Config SDKs — the only third-party code — with hand-written Swift and Kotlin around them.

It is built to fail safe: an app without a google-services.json / GoogleService-Info.plist still builds and runs. Analytics calls are skipped, Analytics::status() tells you why, and every flag returns your default.

Features

Requirements

Installation

Requiring with Composer is not enough — an unregistered plugin does nothing. Always run native:plugin:register and confirm with native:plugin:list.

Firebase setup

  1. In the Firebase console, create a project (or open yours) and add an Android app with your NATIVEPHP_APP_ID as the package name, and an iOS app with the same value as the bundle id.
  2. Download google-services.json (Android) and GoogleService-Info.plist (iOS) and put both in your project root, next to composer.json.
  3. Rebuild. The plugin copies them into the native projects on every build:
File in your project root Copied to Used by
google-services.json app/src/main/assets/vipertecpro/google-services.json read at runtime to initialise Firebase (no Google Services Gradle plugin needed)
GoogleService-Info.plist NativePHP/GoogleService-Info.plist read at launch through the plugin's init function
  1. Check it on the device: Analytics::status()['configured'] is true and projectId is your project. Turn on DebugView in the Firebase console to see events as you log them.

Both files are optional. Keep them out of public repositories if you prefer; they hold identifiers, not secrets, but there is no need to publish them.

Permissions

Platform What the plugin adds Why
Android INTERNET, ACCESS_NETWORK_STATE Sending analytics and fetching Remote Config
iOS nothing —

The Analytics SDK collects an app instance id and device data. Declare it in your App Store privacy details and Google Play data safety form, and ask for consent where the law requires it — the free Consent plugin pairs with Analytics::setConsent().

Usage

Fetch fresh flags, e.g. when the app starts:

Switch collection with your consent screen (here with the free Consent plugin):

Defaults

config/app-analytics.php:

Defaults are served until the first successful fetch, when the app has no Firebase config, and for any key the server does not define. Add more at runtime with RemoteConfig::setDefaults([...]).

API

Validation throws InvalidArgumentException before anything is sent: event, parameter and property names must be letters, digits and underscores starting with a letter (40 characters, 24 for user properties), may not start with firebase_, google_ or ga_, and may not be one of the events the SDK logs itself (first_open, session_start, …); string values are limited to 100 characters (36 for user properties).

Events

Event Payload Fired when
Vipertecpro\AppAnalytics\Events\RemoteConfigFetched bool $activated, int $keys The fetch succeeded. activated is false when the values were already current.
Vipertecpro\AppAnalytics\Events\RemoteConfigFetchFailed string $reason, ?string $message not_configured, throttled, network or error.

Web-view screens

A JS bridge is shipped at resources/js/appAnalytics.js with logEvent(), logScreenView(), status() and fetchAndActivate().

What you can build

App Analytics & Remote Config is a building block: events, screen views and feature flags are done, and the product around them is yours. These ideas sit comfortably inside store policy as long as you tell people what you measure, ask for consent where the law requires it, and never put personal data such as an email address or phone number into an event or a user id. Real data needs your own Firebase project and its config files.

Shops and subscriptions

Content and media

Internal and field apps

Analytics only collects what you log. Pair it with a consent screen (Analytics::setConsent() and setCollectionEnabled()) before collecting where required, and describe the collection in your privacy policy and in the store's data-safety and privacy-label forms. Dashboards beyond the Firebase console, or sending data to your own server, need your own backend. Remote Config changes are cached and throttled, so they are not instant.

Limitations

Verified on

Demo

The companion demo app free-plugins-demo contains an "Analytics & Remote Config" screen — status, events, user property, validation and the flags with their sources — in one small NativeComponent you can copy from.

Contributing

Issues and pull requests are welcome. See the CONTRIBUTING.md file included with the package for local setup, the project layout and how it works.

Changelog

See the CHANGELOG.md file included with the package for the full version history.

Licence

MIT — see the LICENSE file included with the package.

vipertecpro is an independent developer. NativePHP, Laravel, Apple, Google, Firebase and other names are trademarks of their respective owners; this package is not affiliated with or endorsed by them. iOS and Apple are trademarks of Apple Inc. Android, Google Play and Firebase are trademarks of Google LLC.

App Analytics & Remote Config is a free plugin from vipertecpro.com, home of the paid plugins for NativePHP Mobile: Rich-Text Editor, Onboarding & Tours, Health Data, Native Charts, Paywalls & Purchases and Pausewall.


All versions of app-analytics with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
nativephp/mobile Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vipertecpro/app-analytics contains the following files

Loading the files please wait ...