InstallEVENTS GatewayOn Your Domain
This guide shows a direct path from the public GitHub repository to a workingEVENTS Gatewaysetup on your own domain. Create the required Cloudflare resources, add their real IDs and names to Wrangler, deploy the runtime, connect a collector subdomain, and install the tracker on your site.
What you need before you start.
The installation path is direct: start from GitHub, deploy the Workers runtime, and attach the tracker to a site you already control.
GitHub repository access
Start from the public GitHub repository so you can clone it, fork it, or deploy from your own copy.
Cloudflare account
You need a Cloudflare account with access to Workers and the domain where the collector subdomain will run. Create D1, Queues, KV namespaces, R2 buckets, and Durable Objects in your own account, keep the preset resource names, then add the generated IDs and names to Wrangler.
A target website
Your site can live on any stack.EVENTS Gatewayonly needs a tracker install and one collector endpoint.
Stripe account
If you want billing from day one, prepare your Stripe keys before filling in the private install values.
From GitHub page to live domain.
These steps describe a straightforward path for a team that wants to deployEVENTS Gatewayon its own Cloudflare account.
- The public website can stay on its own domain while the collector runs on a dedicated subdomain.
- The tracker can be added to marketing sites, stores, landing pages, and custom applications.
- The same Cloudflare Workers runtime can receive events from multiple sites or products.
Open the GitHub repository page
Start from GitHub, review the project, and clone or fork it into your own account so you can deploy and maintain your ownEVENTS Gatewayinstance.
Create Cloudflare resources manually
Create the D1 database, queue, KV namespaces, R2 ledger bucket, and Durable Object resources in your own Cloudflare account. Keep the preset project names and copy the generated IDs and names because the next step adds them to Wrangler.
Define resources in Wrangler and deploy
Add the Cloudflare resource IDs and names to Wrangler for the collector, API, and forwarder workers, then deploy them to Cloudflare. Smaller sites can often stay inside free-tier limits.
Attach a collector subdomain
Choose a subdomain such as events.example.com or edge.example.com and point it to the collector worker so every site event goes through one controlled entry point.
Install the tracker on the site
Add the script tag or SDK snippet to the target website and send events to your collector endpoint.
Configure routing and destinations
Use the dashboard to define routes, transformations, and destinations for Meta, GA4, Google Ads, TikTok, or custom webhooks.
Verify event flow on the real domain
Load the live site, confirm page views and custom events reach the collector, then validate routing, delivery status, and retries from the dashboard.
Activate Stripe billing
Set the Stripe publishable key, secret key, webhook secret, and billing return URL so payment methods, invoices, reminders, and suspension logic are ready.
Run the core installation commands.
These command blocks mirror a direct path from the repository to a working Cloudflare Workers deployment and tracker install.
git clone https://github.com/EventsGateway-com/EventsGateway.com.git
cd EventsGateway.comnpm install
cd apps/api-worker && npm install
cd ../collector-worker && npm install
cd ../forwarder-worker && npm installnpx wrangler d1 create eventsgateway-control-plane
npx wrangler queues create eventsgateway-ingest-production
npx wrangler kv namespace create EVENTSGATEWAY_CACHE
npx wrangler r2 bucket create eventsgateway-ledger-production"d1_databases": [
{
"binding": "DB",
"database_name": "eventsgateway-control-plane",
"database_id": "replace-with-your-d1-database-id",
"remote": true
}
],
"kv_namespaces": [
{
"binding": "CACHE",
"id": "replace-with-your-kv-namespace-id"
}
],
"r2_buckets": [
{
"binding": "LEDGER_BUCKET",
"bucket_name": "eventsgateway-ledger-production"
}
],
"durable_objects": {
"bindings": [
{
"name": "VISITOR_STATE_DO",
"class_name": "VisitorStateDurableObject"
}
]
},
"migrations": [
{
"tag": "v1",
"new_sqlite_classes": ["VisitorStateDurableObject"]
}
],
"queues": {
"producers": [
{
"binding": "EVENTS_QUEUE",
"queue": "eventsgateway-ingest-production"
}
]
}cd apps/api-worker
npx wrangler deploy
cd ../collector-worker
npx wrangler deploy
cd ../forwarder-worker
npx wrangler deploycd apps/api-worker
npx wrangler secret put STRIPE_SECRET_KEY
npx wrangler secret put STRIPE_WEBHOOK_SECRET
cd ../dashboard
set VITE_STRIPE_PUBLISHABLE_KEY=pk_test_replace_me<script
src="https://events.example.com/e/"
async
></script>A simple production layout.
Use separate hostnames so the event entry point stays explicit and easy to manage.
www.example.com
Your public site. This can stay on any frontend stack as long as you can add the tracker snippet.
events.example.com
Your Cloudflare Workers collector endpoint. The tracker sends events here first.
api.example.com
Optional management API hostname for dashboard calls and operational tooling.
Generate the private setup values before deployment.
This install flow helps self-hosted users create Cloudflare resources, keep the preset resource names, and paste the real IDs and names into Wrangler before deployment.
Start from the repository, not from a blank setup.
Clone the project from GitHub, deploy the Workers runtime on Cloudflare, then connect your domain and add the tracker snippet to the target site.
https://github.com/EventsGateway-com/EventsGateway.com- GitHub repository cloned or forked into your own account
- Cloudflare D1, Queues, KV namespaces, R2 ledger bucket, and Durable Object resources created in your own account
- Wrangler files updated with the real resource IDs and names before deploy
- Cloudflare Workers deployed for collector, API, and forwarding runtime
- Collector subdomain mapped on your domain
- Stripe publishable key, secret key, and webhook secret configured
- Tracker snippet added to the target site
- At least one destination configured in the dashboard
- Live events verified from the production domain