affilify/module-tracking
最新稳定版本:1.0.1
Composer 安装命令:
composer require affilify/module-tracking
包简介
Magento 2 module for affiliate conversion tracking via Affilify API
README 文档
README
A Magento 2 module for affiliate conversion tracking that integrates with the Affilify platform.
Features
- Click Tracking: Captures affiliate IDs from URL parameters and stores them in cookies
- Conversion Tracking: Automatically tracks conversions on checkout success
- Async Processing: Uses MySQL message queues for non-blocking API calls
- Multi-Store Support: Configurable per store view
- GDPR Compliant: IP addresses are masked before sending to tracking API
- Retry Logic: Automatic retry with exponential backoff for failed API calls
- Debug Mode: Verbose logging for troubleshooting
Requirements
- Magento 2.4.0 or higher
- PHP 7.4 or higher
Installation
Via Composer (Recommended)
composer require affilify/module-tracking bin/magento module:enable Affilify_Tracking bin/magento setup:upgrade bin/magento cache:clean
Manual Installation
- Create directory:
app/code/Affilify/Tracking - Download and extract the module files to the directory
- Run:
bin/magento module:enable Affilify_Tracking bin/magento setup:upgrade bin/magento cache:clean
Configuration
Navigate to Stores > Configuration > Affilify > Conversion Tracking
General Settings
| Setting | Description | Default |
|---|---|---|
| Enable Tracking | Enable/disable the module | Yes |
| API Key | Your Affilify API Key (from Advertiser > API tab) | - |
| API URL | Tracking API URL | https://dashboard.affilify.it/api/track |
| URL Parameter Name | The URL parameter to capture | affilify_id |
| Cookie Duration | Days to keep the tracking cookie | 30 |
| Debug Mode | Enable verbose logging | No |
How It Works
Click Tracking
- A visitor arrives with an affiliate link:
https://yourstore.com/?affilify_id=abc123 - The module captures the
affilify_idparameter - The value is validated (alphanumeric, dash, underscore only, max 100 chars)
- A cookie is set with the affiliate ID
- Click data is sent to the Affilify API
Conversion Tracking
- Customer completes checkout
- The
checkout_onepage_controller_success_actionevent fires - If a tracking cookie exists, conversion data is captured
- Conversion is sent to the Affilify API with order details
- The tracking cookie is deleted (single conversion per click)
Message Queue
The module uses MySQL message queues for async processing:
- Topic:
affilify.tracking.click- Click events - Topic:
affilify.tracking.conversion- Conversion events
Running Queue Consumers
Magento's cron automatically processes queue consumers. Make sure cron is running:
# Verify cron is configured
bin/magento cron:run
For manual testing or dedicated consumer processes:
# Run click consumer manually bin/magento queue:consumers:start affilify.tracking.click # Run conversion consumer manually bin/magento queue:consumers:start affilify.tracking.conversion
Logs
Debug logs are written to: var/log/affilify_tracking.log
Support
- Issues: https://github.com/blhack-it/affilify-magento/issues
- Documentation: https://affilify.it/docs
License
MIT License - see LICENSE for details.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-10