PHPackages                             buqiu/sensors - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. buqiu/sensors

ActiveLibrary

buqiu/sensors
=============

上报神策数据

v1.2.1(1y ago)0473PHP

Since Sep 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/buqiu/sensors)[ Packagist](https://packagist.org/packages/buqiu/sensors)[ RSS](/packages/buqiu-sensors/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

sensors
=======

[](#sensors)

#### Description

[](#description)

神策数据SDK

#### Software Architecture

[](#software-architecture)

神策数据上报

添加 composer.json
----------------

[](#添加-composerjson)

```
    "require": {
        "buqiu/sensors": "^1.0"
    },

    "repositories": [
        {
            "type": "git",
            "url": "https://gitee.com/buqiu-community/sensors.git"
        }
    ],

```

安装
--

[](#安装)

```
composer require buqiu/sensors

```

或
-

[](#或)

```
composer install

```

配置 config/app.php
-----------------

[](#配置-configappphp)

```
'providers' => [
    Buqiu\Sensors\SensorsProvider::class
],

```

发布配置
----

[](#发布配置)

```
php artisan vendor:publish --tag=buqiu-sensors-config

```

env配置上报日志的绝对路径
--------------

[](#env配置上报日志的绝对路径)

```
SENSORS_LOG_PATH="/home/Helix/www/helixlife/v4/helixlife-platforms/blog/storage/logs"

```

参数含义
----

[](#参数含义)

```
$action : 字符串类型，上报事件或上报用户属性；【track：事件记录追踪，profileSet：用户属性设置，profileSetOnce：用户属性初始化，profileIncrement：属性自增，profileAppend：追加属性，bind：绑定，unbind：解绑】
$identityList : 数组类型,上报唯一身份;【user_uuid:用户uuid(必填)，identity_mp_unionid： 微信的unionid (有就上报，无则置空），identity_cookie_id: 神策生成的唯一身份id (有就上报，无则置空）】
$properties:数组类型，事件属性，或用户属性
$common：数组类型，公共用户属性，（事件上报必填，用户属性上报可置空为数组）
$event:字符串类型，上报的事件名，（上报事件必填，用户属性上报则为空）

```

如何使用
----

[](#如何使用)

track 事件上报
----------

[](#track-事件上报)

```
use Buqiu\Sensors\Sensors;

$action ='track';
$identityList=['user_uuid'=>'3b5513c8-552d-466b-b362-42de7b6bbf66245','identity_mp_unionid'=>'','identity_cookie_id'=>''];
$properties=['city'=>'上海'];
$common=['ip'=>'111'];
$event='RegisterSuccess';

$sensors = new Sensors($action, $identityList, $properties, $common, $event);
$sensors->executeAction();

```

profileSet 用户属性上报
-----------------

[](#profileset-用户属性上报)

```
use Buqiu\Sensors\Sensors;

$action ='profileSet';
$identityList=['user_uuid'=>'3b5513c8-552d-466b-b362-42de7b6bbf66245','identity_mp_unionid'=>'','identity_cookie_id'=>''];
$properties=['ip'=>'上海'];
$common=[];
$event='';

$sensors = new Sensors($action, $identityList, $properties, $common, $event);
$sensors->executeAction();

```

profileSetOnce 属性初始化
--------------------

[](#profilesetonce-属性初始化)

```
use Buqiu\Sensors\Sensors;

$action ='profileSetOnce';
$identityList=['user_uuid'=>'3b5513c8-552d-466b-b362-42de7b6bbf66245','identity_mp_unionid'=>'','identity_cookie_id'=>''];
$properties=['source'=>'PC'];
$common=[];
$event='';

$sensors = new Sensors($action, $identityList, $properties, $common, $event);
$sensors->executeAction();

```

profileIncrement 属性自增
---------------------

[](#profileincrement-属性自增)

```
use Buqiu\Sensors\Sensors;

$action ='profileIncrement';
$identityList=['user_uuid'=>'3b5513c8-552d-466b-b362-42de7b6bbf66245','identity_mp_unionid'=>'','identity_cookie_id'=>''];
$properties=['GamePlayed'=>1];
$common=[];
$event='';

$sensors = new Sensors($action, $identityList, $properties, $common, $event);
$sensors->executeAction();

```

profileAppend 追加属性
------------------

[](#profileappend-追加属性)

```
use Buqiu\Sensors\Sensors;

$action ='profileAppend';
$identityList=['user_uuid'=>'3b5513c8-552d-466b-b362-42de7b6bbf66245','identity_mp_unionid'=>'','identity_cookie_id'=>''];
$properties=['Games'=>["Call of Duty", "Halo"]];
$common=[];
$event='';

$sensors = new Sensors($action, $identityList, $properties, $common, $event);
$sensors->executeAction();

```

bind 绑定
-------

[](#bind-绑定)

```
use Buqiu\Sensors\Sensors;

$action ='bind';
$identityList=['user_uuid'=>'3b5513c8-552d-466b-b362-42de7b6bbf66245','identity_mp_unionid'=>'','identity_cookie_id'=>'','$identity_mobile'=>'123'];
$properties=[];
$common=[];
$event='';

$sensors = new Sensors($action, $identityList, $properties, $common, $event);
$sensors->executeAction();

```

unbind 解绑
---------

[](#unbind-解绑)

```
use Buqiu\Sensors\Sensors;

$action ='unbind';
$identityList=['user_uuid'=>'3b5513c8-552d-466b-b362-42de7b6bbf66245','identity_mp_unionid'=>'','identity_cookie_id'=>'','$identity_mobile'=>'123'];
$properties=[];
$common=[];
$event='';

$sensors = new Sensors($action, $identityList, $properties, $common, $event);
$sensors->executeAction();

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~149 days

Total

3

Last Release

670d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97229ae0e947eeff418e092a036e90d81654fb9a640281ed22438ec5685bc22b?d=identicon)[buqiu](/maintainers/buqiu)

---

Top Contributors

[![smallk1002](https://avatars.githubusercontent.com/u/36835076?v=4)](https://github.com/smallk1002 "smallk1002 (3 commits)")

### Embed Badge

![Health badge](/badges/buqiu-sensors/health.svg)

```
[![Health](https://phpackages.com/badges/buqiu-sensors/health.svg)](https://phpackages.com/packages/buqiu-sensors)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
