arttiger/laravel-cpa
Composer 安装命令:
composer require arttiger/laravel-cpa
包简介
Laravel CPA (Cost Per Action) network integration package
关键字:
README 文档
README
Laravel Package for CPA networks integration and target customer actions registration in your application. Currently supported: Admitad, Credy, DoAffiliate, Finline, LeadGid, Leads.su, PapaKarlo, Sales Doubler, Storm Digital, Loangate, Appscorp, PAP, GoodAff, LetMeAds, GuruLeads, Nolimit.
Installation
Install the package via composer:
$ composer require arttiger/laravel-cpa
Next, you need to run migrations:
$ php artisan migrate
For Laravel 5.4 and below it necessary to register the service provider
Configuration
In order to edit the default configuration you may execute:
php artisan vendor:publish --provider="Arttiger\Cpa\CpaServiceProvider"
After that, config/cpa.php will be created.
Environment
This package can be configured by environment variables out-of-box:
- SALES_DOUBLER_ID - personal id for request to SalesDoubler
- SALES_DOUBLER_TOKEN - token for request URI for SalesDoubler
- STORM_DIGITAL_GOAL - (default: 1), goal in URL for StormDigital
- STORM_DIGITAL_SECURE - secure in URL for StormDigital
- PAPA_KARLO_TYPE - ('offer' or 'goal') postback type for PapaKarlo
- PAPA_KARLO_OFFER - (default: 35) personal offer id for PapaKarlo
- PAPA_KARLO_GOAL - (default: 75) personal goal id for PapaKarlo
- PDL_PROFIT_OFFER - ID of the advertiser in the PDL-Profit system
- DO_AFFILIATE_PATH - path for DoAffiliate API (example: pozichka-ua in http://tracker2.doaffiliate.net/pozichka-ua)
- LEADS_SU_TOKEN - token for LeadsSu
- ADMITAD_POSTBACK_KEY - postback request authentication key, constant string 32 char
- ADMITAD_CAMPAIGN_CODE - AdmitAd defined campaign code, constant string 10 char
- ADMITAD_ACTION_CODE - target action code, get it from AdmitAd
- CREDY_OFFER - offer code, get it from Credy
- LET_ME_ADS_PATH - path for LetMeAds API (example: api/v1.1/y7r/dcfgs1tg:awvv47ghn1jv1f$am/get/postback.json)
- GURU_LEADS_PATH - path for GuruLeads API (example: postback)
- CLICK2MONEY_PATH - path for Click2Money API (example: cpaCallback)
- NOLIMIT_PATH - path for Nolimit API (example: postback)
If one of key for some CPA network not set postback requests for this network will not be done.
Register Middleware
You may register the package middleware in the app/Http/Kernel.php file:
<?php namespace App\Http; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { /** * The application's route middleware. * * @var array */ protected $routeMiddleware = [ /**** OTHER MIDDLEWARE ****/ 'lead.check' => \Arttiger\Cpa\Middleware\LeadCheckMiddleware::class ]; }
You may add middleware to your group like this:
Route::group( [ 'middleware' => [ 'lead.check' ] ], function(){ //... });
Usage
Create Lead when user registered
CpaLead::createFromCookie(auth()->user()); // or CpaLead::createFromCookie($userId);
When goal is achieved register conversion
CpaConversion::register($user, $transactionId, 'sale');
Events (e.g. 'sale') must be specified in config. You can add additional params for specific events. See config/cpa.php samples
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
arttiger/laravel-cpa 适用场景与选型建议
arttiger/laravel-cpa 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 56 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 09 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「admitad」 「cpa」 「pap」 「loangate」 「cost per action」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 arttiger/laravel-cpa 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 arttiger/laravel-cpa 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 arttiger/laravel-cpa 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Admitad api library
Admitad OAuth2 Provider for Laravel Socialite
Admitad user bundle
Laravel CPA (Cost Per Action) network integration package
PHP lib for taxonomy
Admitad api library
统计信息
- 总下载量: 56
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-01
