1. Go to this page and download the library: Download clicktrail/php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
clicktrail / php-sdk example snippets
use ClickTrail\Core\{AttributionInput, StoredState, TouchMerger};
// A paid-search landing...
$merged = TouchMerger::observe(
StoredState::fromJson($session['ct'] ?? null),
new AttributionInput(
query: $_GET,
host: 'example.com',
landingPage: 'https://example.com/promo',
touchTimestamp: '2026-08-24T10:00:00.000Z',
),
);
$session['ct'] = $merged->toJson();
// first->source === 'google', first->clickIds['gclid'] set,
// and this exact result replays identically in WordPress, GTM and Shopware.
use ClickTrail\Consent\{ConsentBehavior, ConsentSnapshot};
if (! ConsentBehavior::can($snapshot, 'ad_user_data')) {
// enhanced conversion suppressed; reason recorded:
// "adUserData was unknown at lead capture (source: cookieyes)"
}