Download the PHP package protonemedia/laravel-analytics-event-tracking without Composer

On this page you can find all versions of the php package protonemedia/laravel-analytics-event-tracking. 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 laravel-analytics-event-tracking

:warning: This package is unmaintained and doesn't work with GA4.

Laravel Analytics Event Tracking

https://twitter.com/pascalbaljet/status/1257926601339277312

Latest Version on Packagist run-tests Quality Score Total Downloads Buy us a tree

Laravel package to easily send events to Google Analytics

Sponsor this package!

❤️ We proudly support the community by developing Laravel packages and giving them away for free. If this package saves you time or if you're relying on it professionally, please consider sponsoring the maintenance and development. Keeping track of issues and pull requests takes time, but we're happy to help!

Laravel Splade

Did you hear about Laravel Splade? 🤩

It's the magic of Inertia.js with the simplicity of Blade. Splade provides a super easy way to build Single Page Applications using Blade templates. Besides that magic SPA-feeling, it comes with more than ten components to sparkle your app and make it interactive, all without ever leaving Blade.

Features

Installation

You can install the package via composer:

Configuration

Publish the config and view files:

Set your Google Analytics Tracking ID in the .env file or in the config/analytics-event-tracking.php file.

This package supports Google Analytics 4 as of version 1.2.1. Please republish the view file if you're upgrading to a new Google Analytics 4 property.

Blade Directive

This package comes with a @sendAnalyticsClientId directive that sends the Client ID from the GA front-end to your Laravel backend and stores it in the session.

It uses the Axios HTTP library the make an asynchronous POST request. Axios was choosen because it is provided by default in Laravel in the resources/js/bootstrap.js file.

Add the directive somewhere after initializing/configuring GA. The POST request will only be made if the Client ID isn't stored yet or when it's refreshed.

If you don't use Axios, you have to implement this call by yourself. By default the endpoint is /gaid but you can customize it in the configuration file. The request is handled by the ProtoneMedia\AnalyticsEventTracking\Http\StoreClientIdInSession class. Make sure to also send the CSRF token.

Broadcast events to Google Analytics

Add the ShouldBroadcastToAnalytics interface to your event and you're ready! You don't have to manually bind any listeners.

Handle framework and 3rd-party events

If you want to handle events where you can't add the ShouldBroadcastToAnalytics interface, you can manually register them in your EventServiceProvider using the DispatchAnalyticsJob listener.

Customize the broadcast

There are two additional methods that lets you customize the call to Google Analytics.

With the withAnalytics method you can interact with the underlying package to set additional parameters. Take a look at the TheIconic\Tracking\GoogleAnalytics\Analytics class to see the available methods.

With the broadcastAnalyticsActionAs method you can customize the name of the Event Action. By default we use the class name with the class's namespace removed. This method gives you access to the underlying Analytics class as well.

Handling the Client ID outside a HTTP Request

You might want to track an event that occurs outside of a HTTP Request, for example in a queued job or while handling a 3rd-party callback/webhook. Let's continue with the Order example. When the Order is created, you could save the Client ID in the database.

When you receive a webhook from your payment provider and you dispatch an OrderWasPaid event, you can use the withAnalytics method in your event to reuse the google_analytics_client_id:

Additional configuration

You can configure some additional settings in the config/analytics-event-tracking.php file:

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Other Laravel packages

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Treeware

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.


All versions of laravel-analytics-event-tracking with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1 || ^8.2
illuminate/bus Version ^9.0 || ^10.0
illuminate/queue Version ^9.0 || ^10.0
illuminate/http Version ^9.0 || ^10.0
illuminate/validation Version ^9.0 || ^10.0
theiconic/php-ga-measurement-protocol Version ^2.7
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 protonemedia/laravel-analytics-event-tracking contains the following files

Loading the files please wait ....