setono/meta-conversions-api-php-sdk
最新稳定版本:v0.2.4
Composer 安装命令:
composer require setono/meta-conversions-api-php-sdk
包简介
PHP library with basic objects and more for working with Facebook/Metas Conversions API
README 文档
README
Installation
The easiest way to install this library is by installing the library along with its HTTP client dependencies:
composer require setono/meta-conversions-api-php-sdk kriswallsmith/buzz nyholm/psr7
If you want to use your own HTTP client, just do composer require setono/meta-conversions-api-php-sdk and then
remember to set the HTTP client and factories when instantiating the Setono\MetaConversionsApi\Client\Client
Usage
use Setono\MetaConversionsApi\Event\Event; use Setono\MetaConversionsApi\Pixel\Pixel; $event = new Event(Event::EVENT_VIEW_CONTENT); $event->eventSourceUrl = 'https://example.com/products/blue-jeans'; $event->userData->clientUserAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36'; $event->userData->email[] = 'johndoe@example.com'; $event->pixels[] = new Pixel('INSERT YOUR PIXEL ID', 'INSERT YOUR ACCESS TOKEN'); // $event->testEventCode = 'test event code'; // uncomment this if you want to send a test event $client = new Client(); $client->sendEvent($event);
统计信息
- 总下载量: 107.85k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-01