PHP code example of buqiu / sensors
1. Go to this page and download the library: Download buqiu/sensors library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
buqiu / sensors example snippets
php artisan vendor:publish --tag=buqiu-sensors-config
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();
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();
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();
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();
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();