setono / sylius-facebook-tracking-plugin
v3.0.0-alpha.3
2023-03-25 20:43 UTC
Requires
- php: >=7.4
- ext-json: *
- doctrine/collections: ^1.6
- doctrine/orm: ^2.12
- fakerphp/faker: ^1.19
- knplabs/knp-menu: ^3.3
- psr/event-dispatcher: ^1.0
- psr/log: ^1.1 || ^2.0 || ^3.0
- setono/meta-conversions-api-bundle: ^0.1
- setono/meta-conversions-api-php-sdk: ^0.2
- sylius/resource-bundle: ^1.6
- symfony/config: ^5.4 || ^6.0
- symfony/dependency-injection: ^5.4 || ^6.0
- symfony/event-dispatcher: ^5.4 || ^6.0
- symfony/form: ^5.4 || ^6.0
- symfony/http-foundation: ^5.4 || ^6.0
- symfony/http-kernel: ^5.4 || ^6.0
- symfony/options-resolver: ^5.4 || ^6.0
- symfony/routing: ^5.4 || ^6.0
- webmozart/assert: ^1.11
Requires (Dev)
- api-platform/core: ^2.7
- friendsofsymfony/oauth-server-bundle: >2.0.0-alpha.0 ^2.0@dev
- kriswallsmith/buzz: ^1.2
- lexik/jwt-authentication-bundle: ^2.16
- matthiasnoback/symfony-config-test: ^4.3
- matthiasnoback/symfony-dependency-injection-test: ^4.3
- nyholm/psr7: ^1.5
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.18
- psalm/plugin-symfony: ^5.0
- setono/code-quality-pack: ^2.4
- setono/tag-bag: ^2.0
- setono/tag-bag-bundle: ^3.0
- sylius/admin-api-bundle: ^1.11
- sylius/sylius: ~1.10.14
- symfony/debug-bundle: ^5.4 || ^6.0
- symfony/dotenv: ^5.4 || ^6.0
- symfony/intl: ^5.4 || ^6.0
- symfony/web-profiler-bundle: ^5.4 || ^6.0
- symfony/webpack-encore-bundle: ^1.14
- 3.x-dev
- v3.0.0-alpha.3
- v3.0.0-alpha.2
- v3.0.0-alpha
- 2.0.x-dev
- v2.0.0
- v2.0.0-alpha.5
- v2.0.0-alpha.4
- v2.0.0-alpha.3
- v2.0.0-alpha.2
- v2.0.0-alpha
- 1.0.x-dev
- v1.0.0-beta.9
- v1.0.0-beta.8
- v1.0.0-beta.7
- v1.0.0-beta.6
- v1.0.0-beta.5
- v1.0.0-beta.4
- v1.0.0-beta.3
- v1.0.0-beta.2
- v1.0.0-beta
- dev-dependabot/composer/setono/tag-bag-tw-2.2
- dev-dependabot/composer/lexik/jwt-authentication-bundle-tw-2.18
- dev-dependabot/composer/phpunit/phpunit-tw-9.6
- dev-dependabot/composer/setono/code-quality-pack-tw-2.4
- dev-dependabot/composer/doctrine/orm-tw-2.14
- dev-dependabot/composer/psalm/plugin-symfony-tw-5.0
- dev-dependabot/composer/fakerphp/faker-tw-1.21
- dev-dependabot/composer/sylius/resource-bundle-tw-1.8
- dev-dependabot/composer/doctrine/collections-tw-1.8
This package is auto-updated.
Last update: 2023-03-25 20:45:44 UTC
README
跟踪您商店中的电子商务事件并将它们发送到 Facebook,以在 Facebook 内部启用您的营销活动。
安装
步骤 1:下载插件
composer require setono/sylius-facebook-plugin
步骤 2:启用插件
然后,通过将其添加到项目中 config/bundles.php
文件中注册的插件/包列表中,在 SyliusGridBundle
之前启用插件
<?php $bundles = [ // the plugin must be added ABOVE the SyliusGridBundle Setono\SyliusFacebookPlugin\SetonoSyliusFacebookPlugin::class => ['all' => true], Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], // used for filtering bot requests Setono\BotDetectionBundle\SetonoBotDetectionBundle::class => ['all' => true], // this is the underlying bundle we use to track events Setono\MetaConversionsApiBundle\SetonoMetaConversionsApiBundle::class => ['all' => true], // OPTIONAL: See note below // Setono\ConsentBundle\SetonoConsentBundle => ['all' => true], ];
可选:如果您想启用同意(即 cookie / GDPR),您可以安装 consent bundle。
步骤 3:配置插件
# config/packages/setono_sylius_facebook.yaml imports: - { resource: "@SetonoSyliusFacebookPlugin/Resources/config/app/config.yaml" } # Uncomment next line if you want to load some example pixels via fixtures # - { resource: "@SetonoSyliusFacebookPlugin/Resources/config/app/fixtures.yaml" }
步骤 4:导入路由
# config/routes/setono_sylius_facebook.yaml setono_sylius_facebook: resource: "@SetonoSyliusFacebookPlugin/Resources/config/routes.yaml"
步骤 5:选择您的 HTTP 客户端实现
您可以选择安装默认的
composer require kriswallsmith/buzz nyholm/psr7
或者编写自己的 HTTP 客户端并调用
Client::setHttpClient() Client::setRequestFactory() Client::setResponseFactory() Client::setStreamFactory()
步骤 6:更新您的数据库模式
$ php bin/console doctrine:migrations:diff $ php bin/console doctrine:migrations:migrate
步骤 7:创建一个像素
在 Facebook 中创建像素时,您将收到一个像素 ID。
现在通过导航到 /admin/facebook/pixels/new
在您的 Sylius 商店中创建一个新的像素。请记住启用像素并启用您想要跟踪的渠道。
步骤 8:您已经准备好了!
被跟踪的事件位于 EventSubscriber 文件夹 中,但这里有一个列表
ViewContent
(即产品页面查看)添加到购物车
开始结账
购买
ViewCategory
(这是一个跟踪类视图的自定义事件)
相关链接
- https://developers.facebook.com/docs/marketing-api/audiences/guides/dynamic-product-audiences/#setuppixel
- https://developers.facebook.com/docs/marketing-api/conversions-api
- https://developers.facebook.com/docs/marketing-api/conversions-api/using-the-api
- https://developers.facebook.com/docs/marketing-api/conversions-api/guides/business-sdk-features
- https://github.com/facebook/facebook-php-business-sdk
贡献
您可以如何贡献
- 将 messages 翻译成您的母语
- 创建新的事件订阅者以处理尚未实现 Facebook 事件
谢谢!