Download the PHP package clicktrail/symfony-bundle without Composer
On this page you can find all versions of the php package clicktrail/symfony-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download clicktrail/symfony-bundle
More information about clicktrail/symfony-bundle
Files in clicktrail/symfony-bundle
Package symfony-bundle
Short Description Symfony bundle for ClickTrail attribution: config tree, request capture subscriber, consent resolver gate, Messenger delivery, Twig helpers, diagnostics command, webhook signature verification.
License MIT
Informations about the package symfony-bundle
中文
Index
- Why
- Installation
- Quick start
- Reading attribution
- Twig helpers
- Async delivery via Messenger
- Consent
- Diagnostics
- Webhook signatures
- Flex recipe plan
- Not included (deliberate)
- How it differs
- Testing
- License
Why
Most tracking packages store what a page showed. ClickTrail proves which campaign created the lead or sale. This bundle is a thin adapter over clicktrail/php-sdk, which owns the deterministic parse/classify/merge core; the bundle owns Symfony effects: request subscriber, consent gate, Messenger delivery, Twig helpers, diagnostics.
Installation
Requires PHP >= 8.1. The bundle resolves clicktrail/php-sdk as a stable public Composer dependency.
Quick start
Create config/packages/clicktrail.yaml:
All values pass through Symfony env processors (%env(...)% placeholders). The bundle auto-registers itself; from here every request with campaign parameters builds attribution state:
A direct visit afterwards changes nothing — first touch stays, stored last touch persists. That is the SDK's merge law, tested, not promised.
Reading attribution
Attribution\ContextHolder is a stateless read-side accessor for the current request's AttributionContext. The subscriber stores it as a request attribute, so controllers, services, and event listeners read the same merged state.
Twig helpers
Render-only extensions; all output is escaped with htmlspecialchars(..., ENT_QUOTES).
Async delivery via Messenger
Route the delivery message to your transport:
The handler flushes the SDK BatchClient. The container must provide PSR-18 client/request/stream factories (e.g. symfony/http-client). Delivery never happens during the request unless configured.
Consent
ClickTrail is a consent consumer, not a CMP. Set resolver_class to an FQCN implementing ConsentResolverInterface, or override the alias with your own CMP adapter. Until then the shipped NullConsentResolver returns an unknown snapshot, treated as denied everywhere: no identifiers are persisted and no events are delivered.
Diagnostics
Prints the effective configuration (secrets masked) and runs a local signature self-test.
Webhook signatures
Verify ClickTrail webhook callbacks with constant-time SHA-256 comparison:
Flex recipe plan
A symfony/recipes-contrib pull request providing the default config/packages/clicktrail.yaml skeleton is planned post-release — the recipe cannot be submitted before the package has a tagged version. Until then, create the config file manually as shown above.
Not included (deliberate)
Doctrine integration (persisting attribution snapshots to entities, doctrine event listeners) is intentionally out of scope here. It is planned as an optional follow-up package so apps that do not use ORM keep a dependency-free install.
How it differs
- DIY UTM-to-cookie snippets store whatever the URL carried, unvalidated. ClickTrail applies deterministic first/last-touch merge laws validated by golden fixtures shared with our WordPress and GTM engines, gates persistence on consent, and delivers batched events with idempotency keys.
- DirectoryTree/Metrics counts anonymous events. Complementary — ClickTrail connects campaigns to identities and revenue, not page-view counters.
See ../docs/COMPETITOR-NOTES.md for the full analysis.
Testing
CI lints all PHP files on PHP 8.1–8.3 (.github/workflows/ci.yml, canonical template from ../templates/ci-php-matrix.yml).
License
MIT — see LICENSE.
All versions of symfony-bundle with dependencies
symfony/framework-bundle Version ^6.4|^7.0
symfony/messenger Version ^6.4|^7.0
symfony/twig-bundle Version ^6.4|^7.0
symfony/clock Version ^6.4|^7.0
twig/twig Version ^3.0
psr/log Version ^3.0
clicktrail/php-sdk Version dev-main