Download the PHP package blomstra/fathom-analytics without Composer

On this page you can find all versions of the php package blomstra/fathom-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 fathom-analytics

Fathom Analytics

License Latest Stable Version Total Downloads

A Flarum extension. Integrate Fathom Analytics into your Flarum forum.

You can add custom events through your own extension! For more info, read the extending section

Installation

Install with composer:

Updating

Links

Extending

This extension is designed to be built upon by other Flarum extensions. We've tried to make this as simple as possible for you to do.

Creating an event

All custom events should be defined in your extension's common folder. Create a new folder inside js/src/common named fathomEvents. This is where all your custom events will be stored.

Create a new Javascript/Typescript file in this folder with the following template:

Fill in the metadata accurately. It's strongly recommended that your id is scoped to your extension to prevent conflicts.

You can import any Flarum code into this file, and run it inside the code(e) { } method. To track an event occurring, call e.track() and the extension will handle the rest.

:warning: Due to how the Fathom extension is designed, you will often need to import files from the forum namespace from Flarum or other extensions. This is ok, even though this file is in common, provided you only use these imports inside the code(e) method.

For example, if you want to track when any button is clicked in Flarum, your event might look like this:

For more examples of events, check out the default events included with the extension: js/src/common/DefaultEvents.

Registering your events

After you define your events, you need to register them with the extension.

To do this, create a new file at src/js/common/registerFathomEvents.js.

In this file, export a function which registers your events with app.fathomEventsRepository:

You should import and call this registerFathomEvents() function in your src/admin/index.js and src/forum/index.js files.

If you have multiple custom events, you can chain calls to registerEvent():

If you build your extension JS, you should see your custom event(s) inside the Fathom Analytics extension settings. Custom events are accompanied by a small plug-in icon to show that they are from another extension.

Typescript support

For Typescript typings support, copy the code below into a new file at js/src/@types/fathom.d.ts. Typescript should automatically pick this up and remove those red squiggles under your code:


All versions of fathom-analytics with dependencies

PHP Build Version
Package Version
Requires flarum/core Version ^1.2.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 blomstra/fathom-analytics contains the following files

Loading the files please wait ....