Download the PHP package clicktrail/twig without Composer

On this page you can find all versions of the php package clicktrail/twig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package twig

中文

**clicktrail/twig** Render-only [Twig 3](https://twig.symfony.com/) helpers for ClickTrail attribution — your adapter precomputes the values, these functions only render and escape the markup.

CI

Index

Why

Attribution markup usually grows by hand inside templates: copy-pasted loader tags, hidden inputs nobody keeps in sync with the GTM variable list, consent attributes that drift. clicktrail/twig gives October components, Craft modules and Symfony bundles one canonical way to render ClickTrail markup — and none of the logic.

Installation

Requires PHP >= 8.1, Twig ^3.0, and clicktrail/php-sdk.

Quick start

That is the whole contract: values in, escaped markup out. No HTTP calls, no storage, no consent judgment — ever.

Loader script tag

clicktrail_head(array $config): string

Renders the first-party loader <script> tag plus data-ct-* configuration attributes. $config keys:

Hidden attribution inputs

clicktrail_hidden_attribution_inputs(array $attribution): string

Renders hidden <input> fields carrying the full attribution context into forms — same field list as the ClickTrail GTM attribution variables and the October AttributionHidden component: visitor/session/event/site IDs, utm_* values, all 10 ad click IDs, landing page, initial referrer, and consent state.

$attribution is a flat precomputed map, e.g. ['visitor_id' => ..., 'session_id' => ..., 'event_id' => ..., 'site_id' => ..., 'utm_source' => ..., 'gclid' => ..., 'landing_page' => ..., 'initial_referrer' => ..., 'consent_state' => 'granted']. Empty values are skipped.

Consent state attributes

clicktrail_consent_state(array $snapshot): string

Renders normalized consent state as data-ct-consent-* attributes from a ClickTrailConsentSnapshot-shaped array (functional, analytics_storage, advertising_storage, ad_user_data, ad_personalization). Intended for use inside an opening tag:

Unknown or missing keys render nothing — the function makes no consent judgment of its own.

How it differs

Typical template helpers clicktrail/twig
Fetch, track or persist inside the template Render only: never HTTP, never storage, never side effects
Evaluate whether consent was legally valid Renders whatever snapshot the caller passes in
Ad-hoc escaping per helper Every dynamic value through htmlspecialchars(..., ENT_QUOTES)

Positioning: layer-1 framework package (ADR-0001 polyrepo). Platform adapters own the effects (clock, storage, HTTP, consent resolution); this package owns none of them.

Testing

Or inside a container:

License

MIT © 2026 Vizuh OÜ.


All versions of twig with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
twig/twig Version ^3.0
clicktrail/php-sdk Version dev-main
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package clicktrail/twig contains the following files

Loading the files please wait ...