tourze/user-track-bundle

用户埋点

Installs: 15

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

This package is auto-updated.

Last update: 2025-05-11 17:47:56 UTC


README

English | 中文

User behavior tracking bundle for recording various user operations in the system.

Features

  • Automatic recording of user interaction events
  • Support for asynchronous log storage
  • Provides RPC interface for manual behavior recording
  • Support for automatic cleaning of expired logs

Installation

composer require tourze/user-track-bundle

Testing

Run tests with the following command:

./vendor/bin/phpunit packages/user-track-bundle/tests

Test Plan Status

  • Entity tests - Completed
  • Event tests - Completed
  • Event Subscriber tests - Completed
  • RPC Procedure tests - Completed
  • Dependency Injection Extension tests - Completed
  • Bundle tests - Completed

Usage

  1. Register the Bundle
// config/bundles.php
return [
    // ...
    Tourze\UserTrackBundle\UserTrackBundle::class => ['all' => true],
];
  1. Record user behavior by listening to UserInteractionEvent

  2. Manually record user behavior via RPC interface

// Using JSON-RPC call
$result = $client->call('SubmitCrmTrackLog', [
    'event' => 'user.login',
    'params' => ['ip' => $ipAddress]
]);