vTilt
By roleFoundersKnow what to fix firstMarketersSee what happens after the clickCMOsSee what your budget really buys
By businessSaaSTurn signups into active usersEcommerceSee why shoppers abandon cartsAgenciesProve your work to clientsEnterpriseOne customer record for every team
MeasureWeb AnalyticsFind where buyers leaveSession ReplaySee why they left, not just that they didAdsKnow what paid visitors do nextIntegrationsOne snippet feeds your stack
ThinkPeopleOne profile per customerCustomer MemoryvTilt remembers every visitorSite KnowledgeAnswers and audits from your own pages
ActAsk AIAnswers from real behaviorAI ChatChat that knows the visitorEmail CampaignsEmail from real visits
PricingWhy vTiltDocs
Docs / PHP
Getting Started
OverviewInstallInitializeIdentify usersTrack eventsLogout & resetVerify eventsCommon mistakes
Guides
Event forwardingReverse proxyRealtime dashboardSite knowledge
Frontend frameworks
Next.jsNuxt.jsVue.jsReactReact RouterRemixGatsbySvelte / SvelteKitAstroAngularTanStack StartDocusaurus
Backend frameworks
NestJSHonoCloudflare WorkersDjangoFlaskLaravelPhoenixRuby on Rails
Backend languages
PythonPHPRubyElixirGoJava.NET / C#Rust
Stack guides
Vue + PHP
API Reference
Browser SDK
Script bundlesAutocaptureWeb VitalsSession recordingChat widgetFeature readinessRemote configurationDebug logging
Node SDK
Install & setupCapture, identify & aliasContext & shutdownGlobal properties & opt-outError tracking
MCP server
Guides
OverviewAuthenticationOAuthAgent skills (prompts)AI intelligenceSite knowledgeGoogle AdsMeta Ads
Client setup
CursorClaude DesktopVS CodeCodex

Getting Started

OverviewInstallInitializeIdentify usersTrack eventsLogout & resetVerify eventsCommon mistakes

Guides

Event forwardingReverse proxyRealtime dashboardSite knowledge
PythonPHPRubyElixirGoJava.NET / C#Rust

API Reference

MCP server

On this page

On this page

  • 1. Configure
  • 2. Capture helper
  • 3. Capture events
  • 4. Symfony Messenger (recommended)
  • Next steps
DocsGuidesBackend languagesPHP

PHP

Last updated July 22, 2026

Send vTilt events from any PHP code (Symfony, Slim, scripts) by POSTing to the ingest API.

There's no native PHP SDK yet, but vTilt's wire format is a plain JSON POST so any PHP code can emit events. Use this guide for non-framework PHP projects (Symfony, Slim, plain PHP, CLI scripts). For Laravel and full-stack Vue + PHP, see the dedicated Laravel and Vue + PHP guides.

#1. Configure

# .env
VTILT_TOKEN=YOUR_PROJECT_TOKEN
VTILT_HOST=https://www.vtilt.com
text

#2. Capture helper

A small client built on curl_*. No Composer dependencies. Add Guzzle if you want a richer HTTP client.

<?php
// vtilt.php
function vtilt_capture(string $distinct_id, string $event, array $properties = []): void
{
    $payload = json_encode([
        'api_key'     => $_ENV['VTILT_TOKEN'],
        'event'       => $event,
        'distinct_id' => $distinct_id,
        'properties'  => $properties,
    ], JSON_THROW_ON_ERROR);

    $ch = curl_init(($_ENV['VTILT_HOST'] ?? 'https://www.vtilt.com') . '/api/e');
    curl_setopt_array($ch, [
        CURLOPT_POST           => true,
        CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
        CURLOPT_POSTFIELDS     => $payload,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT        => 2,
    ]);
    @curl_exec($ch);
    curl_close($ch);
}

function vtilt_identify(string $distinct_id, array $properties): void
{
    vtilt_capture($distinct_id, '$identify', ['$set' => $properties]);
}
php

#3. Capture events

require __DIR__ . '/vtilt.php';

vtilt_identify('user_42', ['email' => 'alice@example.com', 'plan' => 'pro']);

vtilt_capture('user_42', 'purchase_completed', [
    'amount'   => 99.99,
    'currency' => 'USD',
]);
php

#4. Symfony Messenger (recommended)

Run captures in a queue handler so analytics never blocks the user-facing response.

#[AsMessageHandler]
class CaptureVTiltEventHandler
{
    public function __invoke(CaptureVTiltEvent $msg): void
    {
        vtilt_capture($msg->distinctId, $msg->event, $msg->properties);
    }
}
php

#Next steps

  • Laravel integration guide — Laravel-specific helpers + Blade layout.
  • Vue + PHP integration guide — full Vue front-end + PHP back-end walkthrough.
  • Identify & alias — full identification model.
  • Event forwarding — fan events out to GA4, Meta CAPI, PostHog.
  • Common mistakes — integration pitfalls to avoid before you ship.
PreviousPythonIntegration guidesNextRubyIntegration guides