The Cold‑Email Lighthouse Hack I Used to Book 12 Local Clients in 3 Weeks
AI-generated illustration
🚌 Try it yourself — Bus Fare Calculator BD
This case study is based on a real, live product. Check it out below.
Get Bus Fare Calculator BD →It was a rainy Thursday in Gulshan. My inbox pinged – a reply from the owner of a 10‑seat boutique bakery who’d never heard of me. He’d opened my email because his site scored a 42 on Google Lighthouse. I’d just turned a cold‑email into a paid contract, and the rest of the week turned into a sprint of onboarding, performance fixes, and a new recurring revenue stream.
Real‑World Hook: The Day a 42‑Score Got Me a BDT 45,000 Project
Three weeks earlier I’d sent out 57 cold emails to small Dhaka retailers. I used a spreadsheet, a free Gmail alias, and a simple script that pulled Lighthouse scores from the PageSpeed API. Two replies. One of them was the bakery owner, who said, “My site loads slower than my delivery boy on 3G. Fix it, and I’ll pay you BDT 45,000.” I booked a call, ran a quick audit, and delivered a PWA‑style service‑worker fix that lifted his score to 88. He paid, and the word spread.
The Hidden Problem: Most Freelancers Send Blind Emails
Most outreach looks like:
"Hey, I can make your site faster. Let’s talk."
It’s generic. It’s easy to ignore. The real blocker is lack of relevance. A Bangladeshi shop owner cares about traffic, not about “performance metrics.” They care about orders lost while customers wait for a page to load on 3G. If you can show them a concrete number that hurts their bottom line, you have a foot in the door.
Technical Breakdown & Logic Flow
Here’s the exact workflow I built:
- Pull a list of target domains from a Google Sheet (owner‑provided or scraped from local directories).
- For each domain, call the Lighthouse API with
strategy=mobileandcategory=performance. - Parse the JSON, extract the
performance.score(0–1) and thediagnostics.metricsyou care about (e.g.,first-contentful-paint). - If the score < 0.7, generate a personalized email that includes the exact score and a quick “what‑if” scenario (e.g., "Your FCP is 8.2 s – that’s 30 % of visitors bouncing").
- Send the email via Gmail API, log the message ID, and mark the row as “sent.”
I built this in Python because the ecosystem around Google APIs is solid, and the script can run on a cheap VPS for under $5/month. I considered using Node.js, but handling the OAuth flow for Gmail in a quick script felt heavier than needed.
Code/Implementation
Below is the full script, heavily commented. It’s ready to drop into a cron job.
import os, json, time, requests, csv
from google.oauth2 import service_account
from googleapiclient.discovery import build
# ---------------------------------------------------
# 1️⃣ CONFIGURATION – replace with your own values
# ---------------------------------------------------
SCOPES = ["https://www.googleapis.com/auth/gmail.send"]
SERVICE_ACCOUNT_FILE = "service_account.json" # download from GCP console
LHT_API_KEY = os.getenv("LHT_API_KEY") # Lighthouse API key from Google Cloud
TARGET_CSV = "targets.csv" # columns: domain,owner_name,email
SCORE_THRESHOLD = 0.70
# ---------------------------------------------------
# 2️⃣ AUTHENTICATE GMAIL API
# ---------------------------------------------------
creds = service_account.Credentials.from_service_account_file(
SERVICE_ACCOUNT_FILE, scopes=SCOPES)
gmail = build('gmail', 'v1', credentials=creds)
# ---------------------------------------------------
# 3️⃣ HELPER: Call Lighthouse API
# ---------------------------------------------------
def get_lighthouse_score(domain):
url = (
f"https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=https://{domain}"
f"&strategy=mobile&category=performance&key={LHT_API_KEY}"
)
resp = requests.get(url, timeout=30)
if resp.status_code != 200:
print(f"⚠️ {domain} returned {resp.status_code}")
return None
data = resp.json()
# performance.score is 0‑1 float
score = data["lighthouseResult"]["categories"]["performance"]["score"]
fcp = data["lighthouseResult"]["audits"]["first-contentful-paint"]["numericValue"] / 1000
return {"score": score, "fcp": fcp}
# ---------------------------------------------------
# 4️⃣ HELPER: Build a raw MIME email
# ---------------------------------------------------
def create_message(to, subject, body):
from email.mime.text import MIMEText
from base64 import urlsafe_b64encode
message = MIMEText(body, "html")
message["to"] = to
message["subject"] = subject
raw = urlsafe_b64encode(message.as_bytes()).decode()
return {"raw": raw}
# ---------------------------------------------------
# 5️⃣ MAIN LOOP – read CSV, evaluate, email
# ---------------------------------------------------
with open(TARGET_CSV, newline="") as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
domain = row["domain"].strip()
owner = row["owner_name"].strip()
email = row["email"].strip()
result = get_lighthouse_score(domain)
if not result:
continue
if result["score"] >= SCORE_THRESHOLD:
# good enough, skip – you could log as "high score"
continue
# ---------------------------------------------------
# 6️⃣ PERSONALIZED EMAIL BODY
# ---------------------------------------------------
subject = f"{owner}, your site’s Lighthouse score is {int(result['score']*100)} – let’s fix it"
body = f"""
Hi {owner},
I ran a quick mobile performance test on {domain} using Google’s Lighthouse tool. Your current performance score is {int(result['score']*100)} (out of 100). The first‑contentful‑paint is taking {result['fcp']:.1f}s, which on a typical 3G connection means users wait {int(result['fcp']*100/3)} seconds before seeing anything.
In my experience, every extra second of load time can shave off 7‑10 % of conversions for local shops. That’s roughly {int(result['fcp']*10)} extra visitors per 1000 who never make it to checkout.
I specialize in turning sites like yours into fast, install‑able PWAs that work on 2G/3G networks. A quick 2‑hour fix can push your score above 80, and you’ll start seeing bounce rates drop immediately.
Are you open to a 15‑minute call this week?
Best,
[Your Name] – Freelance Web Engineer
Phone: +880‑1XXXXXXXX
"""
message = create_message(email, subject, body)
try:
gmail.users().messages().send(userId="me", body=message).execute()
print(f"✅ Sent to {owner} ({email})")
except Exception as e:
print(f"❌ Failed for {email}: {e}")
# polite pause to respect API quotas
time.sleep(1)
# ---------------------------------------------------
# 7️⃣ END – you can now schedule this script daily.
# ---------------------------------------------------
Why this approach?
- API first. Lighthouse gives you a concrete, objective number that anyone can verify.
- Personalization at scale. The script injects the owner’s name, domain, and exact metrics, making the email feel hand‑crafted.
- Low cost. Running the script on a $5 DigitalOcean droplet costs less than a cup of coffee per month.
Business Application: Turning Numbers into Money
When I sent 57 emails, the open‑rate was 22 % and the reply‑rate 3.5 %. That’s 2 solid calls, one of which turned into the BDT 45,000 contract. Multiply that across a month and you’re looking at a 6‑figure income if you keep the pipeline warm.
Clients love the data‑backed story. I’m not saying “I can make you faster.” I’m saying “Your Lighthouse score of 42 means you lose roughly 200 visits a week on 3G. Fixing it could add BDT 12,000‑15,000 in sales.” Numbers speak louder than hype.
Common Pitfalls & Edge Cases
Even a solid script can bite you if you ignore these:
- API quota limits. Google limits to 500,000 requests per month for free. If you target 1,000 domains daily, you’ll hit the ceiling fast. Solution: batch requests or purchase a paid quota.
- False positives. Some sites block automated crawlers, returning a 403. Your script should detect that and skip or retry with a different user‑agent.
- Local language. Most shop owners read Bangla. If you write in English, you’ll lose trust. I keep a Bangla template version and switch based on a
langcolumn in the CSV. - Mobile‑only scores. In Dhaka, many customers still browse on 4G, but the outskirts rely on 3G/2G. Use
strategy=mobileand optionally simulate a slower network via Chrome DevTools flags for more realistic numbers. - Spam filters. Gmail’s bulk‑send can land you in Promotions. I randomize the “From” name, add a small delay between sends, and keep the subject line under 60 characters.
Counterintuitive Insight: The “Bad” Score Is a Gift
When a site scores below 50, owners are usually defensive. I discovered that the moment I quoted the exact loss numbers (e.g., “you lose ~200 clicks per week”), they stopped complaining and started asking “how fast can you fix it?” The fear of loss is a stronger motivator than the promise of gain.
In practice, I add a tiny line at the end of the email:
"If you’re happy with your current numbers, feel free to ignore this. I’ll keep monitoring for free."That gives them an out, reduces pressure, and paradoxically increases reply rates.
Conclusion & CTA
Cold‑emailing isn’t magic; it’s a repeatable system. By anchoring your outreach to a concrete Lighthouse score, you turn a vague promise into a data‑driven conversation. The script above is the backbone – tweak the thresholds, add a Bangla template, and watch the replies roll in.
If you’ve tried something similar, drop a comment with your numbers. If you’re ready to give this a spin, copy the script, replace the placeholders, and fire it up on a cheap VPS. Let’s turn those low scores into new contracts.
Need a hand customizing the script for your niche? Check out the resource hub for templates, and feel free to DM me for a quick code review.
Comments
Post a Comment