Download the PHP package setono/google-analytics-server-side-tracking-bundle without Composer

On this page you can find all versions of the php package setono/google-analytics-server-side-tracking-bundle. 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 google-analytics-server-side-tracking-bundle

Symfony Google Analytics Server Side Tracking Bundle

Latest Version Build Status

Use this bundle to track your visitors with Google Analytics, but using server side integration instead of the usual client side integration.

This bundle is based on the Google Analytics measurement protocol library which in turn is based on the Universal Analytics solution from Google. The new GA4 tracking solution will be implemented when it's feature complete and out of beta.

Installation

This bundle also depends on the Client Id Bundle and the Consent Bundle, which generates client ids and provides consent services respectively. If you're not bound by the EU cookie laws, take a look at the configuration of the Consent Bundle to have consent granted by default.

To install this bundle, simply run:

This will install the bundle and enable it if you're using Symfony Flex. If you're not using Flex, add the bundle manually to bundles.php instead.

Create migration

Hits are saved in the database, so you need to create a migration file:

Configuration

To enable the tracking, you need to supply Google Analytics properties to track:

If you have your properties stored somewhere else, i.e. in a database, you can just implement the Setono\GoogleAnalyticsServerSideTrackingBundle\Provider\PropertyProviderInterface which returns a list of properties.

You can also configure the minimum amount of seconds before hits are sent to Google:

Usage

Out of the box, the bundle will start tracking visitors just like the client side integration will, but just as with the client side integration you may want to add custom tracking specific to your application. Here's an example of the ecommerce event Purchase:

Send hits to Google

Use a cronjob to send hits to Google regularly:

No matter the interval in the cronjob, hits will never be sent before the send_delay has passed (see configuration).

FAQ

How are hit builders persisted?

When creating a hit builder using the hit builder factory, the factory will add the hit builder to the so-called hit builder stack. A response listener is then persisting the hit builders at the end of the request-response lifecycle. The same logic as the client side library is applied. This means that page views are persisted when the HTTP status code is one of 2xx, 4xx, or 5xx. All events are persisted no matter what, though. You can see this logic here.

Do I have to populate request/response parameters?

No. Out of the box, hit builders are populated with request and response parameters, i.e. the url, user agent, document title etc.


All versions of google-analytics-server-side-tracking-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
doctrine/doctrine-bundle Version ^1.12 || ^2.2
doctrine/orm Version ^2.7
doctrine/persistence Version ^1.3 || ^2.2
gedmo/doctrine-extensions Version ^2.4 || ^3.1
nyholm/psr7 Version ^1.3
setono/bot-detection-bundle Version ^1.7
setono/client-id-bundle Version ^0.2
setono/client-id-contracts Version ^0.2
setono/consent-bundle Version ^0.1
setono/consent-contracts Version ^0.1.3
setono/doctrine-object-manager-trait Version ^1.0
setono/google-analytics-measurement-protocol Version ^0.4.3
setono/symfony-main-request-trait Version ^1.0
symfony/config Version ^4.4 || ^5.4 || ^6.0
symfony/console Version ^4.4 || ^5.4 || ^6.0
symfony/dependency-injection Version ^4.4 || ^5.4 || ^6.0
symfony/event-dispatcher Version ^4.4 || ^5.4 || ^6.0
symfony/http-client Version ^4.4 || ^5.4 || ^6.0
symfony/http-foundation Version ^4.4 || ^5.4 || ^6.0
symfony/http-kernel Version ^4.4 || ^5.4 || ^6.0
symfony/lock Version ^4.4 || ^5.4 || ^6.0
symfony/messenger Version ^4.4 || ^5.4 || ^6.0
symfony/uid Version ^5.4 || ^6.0
symfony/workflow Version ^4.4 || ^5.4 || ^6.0
webmozart/assert Version ^1.11
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 setono/google-analytics-server-side-tracking-bundle contains the following files

Loading the files please wait ....