Download the PHP package torresani/redirectanalytics without Composer

On this page you can find all versions of the php package torresani/redirectanalytics. 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 redirectanalytics

redirectanalytics – TYPO3 Extension

TYPO3 13 extension for server-side redirect tracking via Google Analytics 4.

Every time a URL managed by the TYPO3 Redirects module is hit, the extension sends an event directly to GA4 via Measurement Protocol, before the browser executes the redirect. This means the hit is counted even for redirects to external sites, with no dependency on any client-side JavaScript tag.


Requirements

Requirement Version
TYPO3 13.x
PHP 8.2+
ext:redirects included in TYPO3 core

Installation

Copy the redirectanalytics/ folder into your project, for example under packages/redirectanalytics/, then add the local repository to the root composer.json:

Then install and activate:


Configuration

1. Get your GA4 credentials

Measurement ID: go to Google Analytics → Admin → Data Streams → select your web stream. The Measurement ID is shown at the top in the format G-XXXXXXXXXX.

API Secret: on the same Data Stream page, scroll down to Measurement Protocol API secrets → Create → give it any name → copy the generated value. Save it immediately: it will not be shown again.

2. Configure the extension

Go to Admin Tools → Settings → Extension Configuration → redirectanalytics and fill in the fields:

Google Analytics 4 section

Field Description
measurementId Your GA4 property Measurement ID, e.g. G-XXXXXXXXXX
apiSecret The Measurement Protocol secret created above
pageView When enabled, sends a standard page_view event to GA4. Redirect hits will appear in the standard Pages & Screens report without any custom exploration. Default: disabled
redirectHit When enabled, sends a custom event to GA4 with the redirect source and destination URLs. Default: enabled
redirectHitName Name of the custom redirect event sent to GA4. Change it only if you need to align with an existing event naming convention. Default: redirect_hit
debugMode When enabled, sends to the GA4 debug endpoint and logs the response. Use only during testing — disable in production
timeoutSeconds Maximum HTTP timeout for the call to GA4. Default is 2 seconds: a low value ensures a network issue never slows down the redirect

Privacy / Consent section

Field Description
consentStrategy Consent verification strategy (see below)
consentCookieName Name of the cookie to check (only for cookie strategy)
consentCookieValue Expected cookie value (only for cookie strategy)

3. Consent strategy

Strategy Behaviour
always Always track, no cookie check. Use only if you have no consent banner
cookiebot Reads the CookieBot CookieConsent cookie and tracks only if statistics:true
cookie Checks that a specific cookie (configurable name and value) is present. Compatible with Klaro and custom banners
none Tracking completely disabled without uninstalling the extension

Klaro note

Klaro saves consent in localStorage by default, which is not accessible server-side. To make it work, add storageMethod: 'cookie' to your Klaro configuration so it also writes a klaro cookie:

Then set the extension fields as follows:

Field Value
consentStrategy cookie
consentCookieName klaro
consentCookieValue google-analytics-7 (or the exact service name used in your Klaro config)

How it works

The listener never blocks the redirect: it uses a configurable timeout and catches all exceptions internally, ensuring any GA4 or network issue is completely transparent to the user.


GA4 event

The event is named redirect_hit and includes the following parameters:

Parameter Content
source_url Original URL that received the redirect
destination_url Destination URL
page_location Same as source_url
page_referrer HTTP referrer of the request
session_id Extracted from the GA4 stream cookie to associate the event with the correct session
debug_mode Present only when debugMode is enabled

To find it in GA4: Reports → Configure → Events or Explore → Event Explorer, filtering by event_name = redirect_hit. In DebugView it appears in real time during testing.


Enabling debug logs

Add the following to config/system/additional.php:

Logs are written to var/log/typo3_redirectanalytics_*.log. Monitor them in real time with:

Possible log messages:

Message Meaning
extension not configured Measurement ID or API Secret missing
tracking skipped – no consent Consent not given, normal redirect proceeds
event sent to GA4 Everything ok, event registered
GA4 returned non-2xx status GA4 responded with an error
exception while sending Network or firewall issue

GDPR notes

The user's IP address is never sent to GA4: the user_ip_address parameter is intentionally omitted. GA4 will use the server IP for any aggregate geographic processing. The client_id is extracted from the _ga cookie when available; if absent, an anonymous hash-based ID is generated that does not persist across sessions. To respect user consent, use the cookiebot or cookie strategy.


File structure


All versions of redirectanalytics with dependencies

PHP Build Version
Package Version
Requires typo3/cms-core Version ^13.0
typo3/cms-redirects Version ^13.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 torresani/redirectanalytics contains the following files

Loading the files please wait ...