iugosds/sherlaravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

iugosds/sherlaravel

Composer 安装命令:

composer require iugosds/sherlaravel

包简介

Sherlock Score integration for Laravel projects

README 文档

README

Latest Version on Packagist Total Downloads

Sherlock Score integration for Laravel.

Track your users, trials, and paid accounts with Sherlock’s Product Engagement Scoring engine.

Installation

Via Composer

$ composer require iugosds/sherlaravel

Usage

First of all, add a SHERLOCK_SCORE_API_KEY key to your .env file:

SHERLOCK_SCORE_API_KEY=a12b34c56...

You can also disable this package by adding a SHERLOCK_SCORE_ENABLED key set to false (true by default).

In case you don't want to wait for the API to respond, you can run all interactions with Sherlock Scores as asynchronous calls (jobs will be dispatched to the "default" queue of your laravel application). To enable this feature, set the SHERLOCK_ASYNC_CALLS variable to true in your .env file.

To start interacting with Sherlock Score, use the following methods:

use SherLaravel;
SherLaravel::identifyAccount("groupIdHere");

With Sherlock you can keep track of Accounts (or groups of users). To identfy a new account, add the line above to your controller.

SherLaravel::identifyUser("userIdHere");

The identifyUser method is used to identify a new User. It will be tipically added to the register method on your login controller, or to the "created" event of your User Model in case you are using Observers.

SherLaravel::trackEvent("userID", "event-name");

In your controllers, use the trackEvent method every time you want to track an interaction with a user.

SherLaravel::identifyAccount(String $group_id, ?Array $traits= [], ?int $timestamp = null)
SherLaravel::identifyUser(String $user_id, ?String $group_id = null, ?Array $traits= [], ?int $timestamp = null)
SherLaravel::trackEvent(String $user_id, String $event, ?int $timestamp = null)

##Sample:

SherLaravel::identifyUser("1234", "Customer44", [
        'name' => 'John Doe',
        'email' => 'johndoe@example.com'],
    '1553647710707');

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Credits

License

MIT. Please see the license file for more information.

统计信息

  • 总下载量: 935
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固