Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Anonlytics Lib Php Laravel Package

defixit/anonlytics-lib-php

PHP library for anonymous analytics (Anonlytics). Collect lightweight, privacy-first event data without cookies or personal identifiers, and send it to an Anonlytics server/API from your PHP apps and services.

View on GitHub
Deep Wiki
Context7

License PHP Version

Anonlytics Lib PHP

In a world with all GDPR rules, an IP address is now already labeled as personal information and can therefore not just be passed on by your website/application.

That's why we introduce Anonlytics, the server side analytics tool that only works with anonymized data for website analytics.

Entirely in accordance with all the rules of the GDPR. Our servers are all located in Europe and no IP addresses are used anywhere.

This library is part of https://anonlytics.eu, you need a (free) account to use this bundle for your website/application.

Requirements

  • PHP 8.3 or higher
  • cURL extension
  • JSON extension

Installation

Use composer to add the library as dependency for your project:

composer require defixit/anonlytics-lib-php

Usage

Setup

At first, you need to create an account on Anonlytics.eu to get your client_token and site_token to connect to our services.

After you created an account on our website you can create a file with the name anonlytics.yaml in the config/packages/ folder, with the following content:

Send data to our service

<?php

require 'vendor/autoload.php';

use DeFixIT\Anonlytics\Tracker;
use DeFixIT\Anonlytics\Exception\AnonlyticsDataNotSendException;

try {
    $tracker = new Tracker($_SERVER, $yourClientToken, $yourSiteToken);
    $response = $tracker->sendRequestData();
    
    if ($response) {
        echo "Analytics data sent successfully!";
    }
} catch (AnonlyticsDataNotSendException $e) {
    // Handle the exception as needed
    error_log("Failed to send analytics data: " . $e->getMessage());
}

For the $requestArray you can use $_SERVER in PHP. The response will be true or else we're throwing an AnonlyticsDataNotSendException exception.

Features

  • ✅ PHP 8.3+ compatible with modern features
  • ✅ GDPR compliant - no personal data collection
  • ✅ Respects "Do Not Track" headers
  • ✅ Readonly classes for immutability
  • ✅ Proper error handling and timeouts
  • ✅ Type-safe with strict typing
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
phpshko/laravel-livewire-depdrop
larasell-dev/larasell
calliostro/spotify-bundle
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer