setono/sylius-google-ads-plugin
Composer 安装命令:
composer require setono/sylius-google-ads-plugin
包简介
Google Ads plugin for Sylius.
关键字:
README 文档
README
This plugin tracks conversions in your Sylius store. It's done with the Google Ads API instead of the default javascript tracking. It has a few benefits to do this:
- Easier to control the consent status for a given user
- Easier to change the value of an order after the fact
- No javascripts on your page to track Google Ads, which means faster page load
- You decide the ttl on your cookies, not Apple and their ITP
- No risk of losing tracking because of ad blockers
Installation
Step 1: Install gRPC
Internally this plugin uses the google-ads-php. To use that library properly
it's advised to install the gRPC PHP extension. It should work by just running pecl install grpc and enabling the extension
in your php.ini by adding extension=grpc.so.
Step 2: Install and enable plugin
composer require setono/sylius-google-ads-plugin
Add the bundle to your config/bundles.php before the SyliusGridBundle:
<?php # config/bundles.php return [ // ... Setono\SyliusGoogleAdsPlugin\SetonoSyliusGoogleAdsPlugin::class => ['all' => true], // Added before the grid bundle Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], // ... ];
Step 3: Add configuration
# config/packages/setono_sylius_google_ads.yaml imports: - "@SetonoSyliusGoogleAdsPlugin/Resources/config/app/config.yaml"
# config/routes/setono_sylius_google_ads.yaml setono_sylius_google_ads: resource: "@SetonoSyliusGoogleAdsPlugin/Resources/config/routes.yaml"
Step 4: Create migration file
php bin/console doctrine:migrations:diff php bin/console doctrine:migrations:migrate
Step 5: Set up cronjobs
The first cronjob will process Google Ads conversions. Run this cronjob regularly, e.g. every 5 minutes:
php bin/console setono:sylius-google-ads:process-conversions
The next cronjob will prune the conversions table. Run this job as often as you'd like, maybe daily:
php bin/console setono:sylius-google-ads:prune-conversions
Step 6: Map the Messenger command to an async transport (optional, but recommended)
The plugin uses the Symfony Messenger to dispatch a message (ProcessConversion) which will trigger the processing
of a conversion. If you want to do this asynchronously, you can do something like the following in your messenger config:
framework: messenger: transports: async: '%env(MESSENGER_TRANSPORT_DSN)%' routing: 'Setono\SyliusGoogleAdsPlugin\Message\Command\CommandInterface': async
This maps all messages implementing that interface to the async transport.
Now the plugin is installed. Please read the next section to learn how to use it in your store.
Usage
To start using the plugin, go to https://your-domain.com/admin/google-ads and follow the instructions.
Backward compatibility
The plugin adheres to semantic versioning. However, any class, interface, method or property
annotated with @experimental or @internal is not covered by that promise and may change or be removed in any release.
Right now the customer lists feature is experimental. In addition, the classes that expose types from the underlying
Google Ads PHP library (for example the Client, its resources and the
conversion events) are marked @internal, because those types change with every Google Ads API version we upgrade to.
统计信息
- 总下载量: 36.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-27