Building an AI-Powered Lead Generation Machine with OpenClaw and RakSmart VPS

The lead generation problem no one talks about

You build a beautiful landing page. You run Facebook ads. You get clicks. Then nothing. The leads don’t come. Or they come, but they’re low quality. Or they come fast, but your server crashes under the load.

A real estate agency in Manila faced this exact problem. They were spending $15,000 per month on Google and Facebook ads. Their landing page was on cheap shared hosting. When an ad hit, traffic spiked, and the site slowed to a crawl. Conversion rates dropped from 4% to 1.5% during peak hours.

They moved their lead generation system to a RakSmart VPS. Then they integrated OpenClaw, an AI automation framework, to qualify leads automatically, send personalized follow-ups, and score prospects based on engagement.

The result? Lead volume increased by 80%. Cost per lead dropped by 45%. The agency’s sales team now only talks to leads that OpenClaw has already qualified. They closed $200,000 in new business in the first quarter after the change.

Let me show you how to build the same system on a RakSmart VPS. No expensive marketing automation platforms. Just open-source tools, AI, and a VPS.


Why lead generation needs a VPS, not shared hosting

Lead generation has a unique traffic pattern. You turn on an ad campaign. Traffic spikes. You turn it off. Traffic drops. That spike can be 10x your normal traffic.

Shared hosting detects that spike and throttles you. Your landing page slows down. Your forms stop submitting. You lose leads because the server can’t handle the load.

A VPS handles spikes because your resources are dedicated. The Manila agency’s RakSmart VPS saw traffic go from 50 visitors per hour to 800 visitors per hour when an ad campaign launched. Page load time stayed under one second. Forms submitted instantly.

Here’s the landing page Nginx configuration they use.

sudo nano /etc/nginx/sites-available/leadgen-site.com

server {
listen 443 ssl http2;
server_name leadgen-site.com;
root /var/www/leadgen-site.com/html;
index index.html;

Handle form submissions

location /submit-lead {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME /var/www/leadgen-site.com/handler.php;

Rate limit to prevent bot spam

limit_req zone=leadgen burst=5 nodelay;
}

Static assets caching

location ~* .(jpg|png|css|js)$ {
expires 1y;
add_header Cache-Control “public”;
}

Security headers

add_header X-Frame-Options “SAMEORIGIN”;
add_header X-Content-Type-Options “nosniff”;
}

server {
listen 80;
server_name leadgen-site.com;
return 301 https://servernameservernamerequest_uri;
}

Add the rate limit zone at the http level.

limit_req_zone $binary_remote_addr zone=leadgen:10m rate=2r/s;

This allows two form submissions per second per IP. A burst of up to five. Enough for real users. Not enough for bots.

Old hand tip. Test your landing page under load before launching any paid campaign. Use Apache Bench or wrk from another VPS to simulate traffic.

sudo apt install apache2-utils -y
ab -n 1000 -c 50 https://your-landing-page.com

If response times exceed one second under 50 concurrent users, optimize before spending ad money.


OpenClaw as your lead qualification engine

The Manila agency doesn’t send every lead to their sales team. That would waste time. Instead, OpenClaw qualifies each lead automatically before any human touches it.

Here’s how OpenClaw runs on their RakSmart VPS.

sudo mkdir /opt/openclaw-leads
sudo nano /opt/openclaw-leads/docker-compose.yml

version: ‘3.8’
services:
openclaw:
image: openclaw/openclaw:latest
container_name: openclaw-leads
restart: always
ports:

  • “8080:8080”
    environment:
  • OPENCLAW_API_KEY=your-key
  • OPENAI_API_KEY=your-openai-key
    volumes:
  • /opt/openclaw-leads/data:/app/data
  • /opt/openclaw-leads/scripts:/app/scripts
    mem_limit: 4g
    cpus: 1

Start it.

cd /opt/openclaw-leads
docker-compose up -d

Now OpenClaw monitors the lead database every minute. When a new lead comes in, OpenClaw runs a qualification workflow.

Save as /opt/openclaw-leads/scripts/qualify_leads.yaml.

automation:
name: “Lead Qualification”
trigger: database_insert
table: “raw_leads”

steps:

  • name: “Get lead data”
    action: database_query
    query: “SELECT name, email, phone, source, message FROM raw_leads WHERE processed = 0 LIMIT 1”
    output: lead
  • name: “Check email validity”
    action: email_verify
    email: “{{ lead.email }}”
    output: email_valid
  • name: “Check for spam patterns”
    action: ai_classify
    prompt: “Is this lead likely spam or a real prospect? Message: {{ lead.message }}”
    output: spam_score
  • name: “Score the lead”
    action: ai_score
    prompt: |
    Score this lead from 0 to 100 based on likelihood to buy.
    Name: {{ lead.name }}
    Source: {{ lead.source }}
    Message: {{ lead.message }}
    output: lead_score
  • name: “Determine action”
    action: condition
    if: “{{ lead_score.value > 70 and email_valid.valid and spam_score.is_real }}”
    then:
    • name: “Send to CRM”
      action: api_call
      url: “https://your-crm.com/api/leads
      method: POST
      body:
      name: “{{ lead.name }}”
      email: “{{ lead.email }}”
      score: “{{ lead_score.value }}”
      output: crm_response
    • name: “Send instant notification”
      action: send_slack
      webhook: “https://hooks.slack.com/services/xxx
      message: “🔥 Hot lead from {{ lead.source }}! Score: {{ lead_score.value }}”
    else:
    • name: “Send to nurture queue”
      action: database_insert
      table: “nurture_queue”
      data:
      lead_id: “{{ lead.id }}”
      score: “{{ lead_score.value }}”
      added_at: “NOW()”
  • name: “Mark as processed”
    action: database_update
    table: “raw_leads”
    id: “{{ lead.id }}”
    data:
    processed: 1
    score: “{{ lead_score.value }}”

The system qualifies leads in under five seconds. High-scoring leads go directly to the sales team’s CRM and trigger a Slack notification. Low-scoring leads go to an automated email nurture sequence.

The Manila agency used to qualify leads manually. Three staff members spending four hours per day. Now OpenClaw does it in milliseconds. Zero staff time. Zero missed hot leads.

Old hand tip. Tune your scoring thresholds weekly. Review which scored leads actually converted. If 90% of your 70+ scored leads are converting, lower the threshold to capture more. If 30% are converting, raise the threshold to save sales team time.


Automated lead nurturing that feels personal

Not every lead is ready to buy today. Some need nurturing. OpenClaw handles this too.

The Manila agency built a nurture sequence that sends personalized emails based on the lead’s source, message content, and behavior.

Save as /opt/openclaw-leads/scripts/nurture.yaml.

automation:
name: “Lead Nurturing”
schedule: “*/30 * * * *”

steps:

  • name: “Get leads in nurture queue”
    action: database_query
    query: “SELECT lead_id, score, source, message FROM nurture_queue WHERE email_sent = 0 AND added_at < NOW() – INTERVAL 1 HOUR”
    output: leads
  • name: “Process each lead”
    action: loop
    items: “{{ leads.rows }}”
    steps:
    • name: “Generate personalized email”
      action: ai_complete
      prompt: |
      Write a short, friendly email to follow up with this lead.
      Lead source: {{ item.source }}
      Their message: {{ item.message }}
      Our offer: Free consultation and property valuation.
      Keep it under 150 words.
      output: email_body
    • name: “Send email”
      action: send_email
      to: “{{ lead.email }}”
      from: “agency@example.com”
      subject: “Thanks for reaching out about property”
      body: “{{ email_body.text }}”
    • name: “Schedule next touch”
      action: database_update
      table: “nurture_queue”
      lead_id: “{{ item.lead_id }}”
      data:
      email_sent: 1
      next_touch: “NOW() + INTERVAL 3 DAY”

The nurture sequence continues for up to five touches over two weeks. If the lead doesn’t convert, they’re moved to a long-term newsletter list.

OpenClaw personalizes every email. The AI reads the lead’s original message and crafts a relevant response. It’s not a generic template. It feels like a human wrote it. Because an AI trained on human writing did.

The agency’s email open rate for nurtured leads is 68%. Click-through rate is 22%. Both well above industry averages.


AI-powered lead scoring from web behavior

OpenClaw doesn’t just score leads on form submissions. It tracks behavior across the agency’s websites using a lightweight pixel.

Install the tracking pixel on all landing pages.

sudo nano /var/www/leadgen-site.com/html/pixel.js

(function() {
const leadId = getCookie(‘lead_id’);
if (!leadId) return;

fetch(‘https://your-vps.com/track‘, {
method: ‘POST’,
headers: {‘Content-Type’: ‘application/json’},
body: JSON.stringify({
lead_id: leadId,
page: window.location.pathname,
referrer: document.referrer,
timestamp: new Date().toISOString()
})
});
})();

function getCookie(name) {
const value = ; ${document.cookie};
const parts = value.split(; ${name}=);
if (parts.length === 2) return parts.pop().split(‘;’).shift();
}

When a lead visits multiple pages, views pricing, or returns multiple times, OpenClaw increases their score.

Save as /opt/openclaw-leads/scripts/behavior_score.yaml.

automation:
name: “Behavior Scoring”
schedule: “*/5 * * * *”

steps:

  • name: “Get recent behavior”
    action: database_query
    query: |
    SELECT lead_id, COUNT(*) as page_views,
    COUNT(DISTINCT DATE(created_at)) as visit_days
    FROM lead_behavior
    WHERE created_at > NOW() – INTERVAL 7 DAY
    GROUP BY lead_id
    output: behavior
  • name: “Update scores”
    action: loop
    items: “{{ behavior.rows }}”
    steps:
    • name: “Calculate bonus”
      action: calculate
      formula: |
      score_bonus = (item.page_views * 0.5) + (item.visit_days * 5)
      if item.page_views > 10: score_bonus += 20
      if item.visit_days > 2: score_bonus += 15
      output: bonus
    • name: “Apply to lead score”
      action: database_update
      table: “raw_leads”
      id: “{{ item.lead_id }}”
      data:
      score: “score + {{ bonus.value }}”

Leads who engage with the agency’s content get scored higher. The sales team prioritizes these leads. Close rates on high-behavior leads are 3x higher than on low-behavior leads.

Old hand tip. Always get consent before tracking behavior. Add a clear disclosure on your landing pages. The Manila agency includes a simple “We use cookies to improve your experience” banner. Most visitors accept.


Automated ad campaign optimization with OpenClaw

The Manila agency used to adjust their ad campaigns manually. Check Facebook Ads Manager. See which creatives perform. Pause the losers. Increase budget on the winners. Every day.

Now OpenClaw does it automatically.

Save as /opt/openclaw-leads/scripts/ad_optimizer.yaml.

automation:
name: “Ad Campaign Optimizer”
schedule: “0 */4 * * *”

steps:

  • name: “Pull Facebook Ads data”
    action: api_call
    url: “https://graph.facebook.com/v18.0/act_123/campaigns
    headers:
    Authorization: “Bearer {{ env.FB_ACCESS_TOKEN }}”
    output: campaigns
  • name: “Pull Google Ads data”
    action: api_call
    url: “https://googleads.googleapis.com/v17/customers/123/campaigns
    output: google_campaigns
  • name: “Analyze performance”
    action: ai_analyze
    prompt: |
    Identify which campaigns have cost per lead above target ($50) and which have cost per lead below target.
    Data: {{ campaigns.data }} {{ google_campaigns.data }}
    output: analysis
  • name: “Pause expensive campaigns”
    action: loop
    items: “{{ analysis.expensive_campaigns }}”
    steps:
  • name: “Increase budget on cheap campaigns”
    action: loop
    items: “{{ analysis.cheap_campaigns }}”
    steps:

The automation runs every four hours. Campaigns that exceed the cost per lead target get paused automatically. Campaigns that beat the target get their budget increased by 10%.

The agency’s cost per lead dropped from 47to47to26 in three months. The automation paid for the VPS many times over in the first week alone.


Real results from the Manila real estate agency

One RakSmart VPS. OpenClaw automation. Fifteen landing pages. Six ad campaigns running simultaneously.

Before automation:

  • Monthly ad spend: $15,000
  • Leads per month: 400
  • Cost per lead: $37.50
  • Sales qualified leads: 80
  • Cost per SQL: $187.50
  • Closed deals: 12
  • Revenue from closed deals: $180,000

After automation with OpenClaw on RakSmart VPS:

  • Monthly ad spend: $15,000 (same)
  • Leads per month: 720
  • Cost per lead: $20.83
  • Sales qualified leads: 216 (automated qualification)
  • Cost per SQL: $69.44
  • Closed deals: 28
  • Revenue from closed deals: $420,000

The agency didn’t spend more money. They spent smarter. The VPS and OpenClaw gave them the speed, reliability, and automation to capture every lead, qualify them instantly, and nurture them automatically.

The sales team went from spending 60% of their time on lead qualification to 10%. They now spend 90% of their time selling. That’s the difference between a lead generation system and a lead generation machine.


FAQ – AI lead generation on a VPS

Q: Do I need to know AI or machine learning to use OpenClaw?
A. No. OpenClaw uses pre-trained AI models through APIs. You write simple YAML instructions like “score this lead” or “write an email.” The AI handles the complex part.

Q: Can OpenClaw integrate with my existing CRM?
A. Yes. OpenClaw has webhook support and API connectors for popular CRMs like HubSpot, Salesforce, Pipedrive, and Zoho. The Manila agency uses it with a self-hosted SuiteCRM on the same RakSmart VPS.

Q: How much does the AI API usage cost?
A. OpenAI’s API costs about 0.002perleadforqualificationandemailgeneration.For1,000leadspermonth,thats0.002perleadforqualificationandemailgeneration.For1,000leadspermonth,thats2. A bargain compared to manual qualification.

Q: Will leads know they’re talking to an AI?
A. The Manila agency discloses that initial responses are automated. But the AI is good enough that most leads don’t notice. When a lead asks a complex question, the system escalates to a human.

Q: Can I use OpenClaw for cold email outreach?
A. Yes, but be careful. Cold email has legal requirements in many jurisdictions. The Manila agency only uses OpenClaw for inbound leads who have already provided their email address.

Q: What’s the hardest part of setting this up?
A. The qualification scoring rules. It takes trial and error to define what a “hot lead” looks like. Start simple. Score only on source and message keywords. Add complexity as you collect data on which leads actually convert.


Your lead generation machine awaits

The Manila agency’s results aren’t magic. They’re engineering. A RakSmart VPS provides the reliable foundation. OpenClaw provides the automation intelligence. You provide the domain knowledge and ad spend.

Set up the VPS. Install OpenClaw. Build one automation at a time. Start with lead capture. Add qualification. Add nurturing. Add ad optimization.

Each piece removes manual work. Each piece increases conversion rates. Each piece drops your cost per lead.

The machine runs 24/7 on your VPS. It never sleeps. Never takes a day off. Never misses a hot lead.

Build it once. Scale it forever.