B2B SaaS SEO: Connect Rankings to Pipeline
Map organic rankings to pipeline revenue using Claude Code. Combine GSC data with GA4 conversions and CRM exports to prove SEO's business impact.
Key Takeaways
- Attribution is the core problem. Organic search touches most B2B buying journeys at some point, but last-touch attribution models rarely credit it accurately
- GSC + GA4 + CRM is the minimum data stack needed to connect a keyword ranking to a closed deal
- Paid-organic overlap is where the fastest budget wins sit: many SaaS teams find they're bidding on terms they already rank organically in the top 5, and this analysis surfaces that wasted spend
- Content gap analysis against competitors reveals high-intent keywords that send pipeline to a competitor while you have no page to capture it
- Monthly SEO-to-pipeline reports can be produced in a single Claude Code session once the data fetchers are in place
- Learn the data fetching setup first if you haven't connected your Google APIs yet
The average B2B SEO cycle is 6-12 months before organic gains show up in pipeline numbers. That timeline creates a credibility problem. Ranking reports don't hold up in a budget meeting against a demand gen team showing cost-per-lead by channel.
Most B2B marketing leaders say they struggle to accurately attribute pipeline to individual channels. SEO teams are typically at the bottom of that credibility ranking, behind paid, email, and events. The tools exist to fix this. Most teams just haven't connected them yet.
This guide shows how to use Claude Code to pull GSC, GA4, and CRM export data into a unified analysis, then automate the report that ties keyword rankings to trial signups, demo requests, and closed revenue.
SEO's Attribution Problem in B2B SaaS
In B2B SaaS, organic search attribution fails for a structural reason: the person who finds a blog post via Google is rarely the same person who fills out a demo request six weeks later. B2B buying journeys involve multiple touchpoints across weeks or months, and most analytics stacks can only see the last one.
This means GA4 assigns "organic" as a conversion source only when the organic session was the final touch before the conversion event. Everything organic did earlier in the journey disappears into direct or gets credited to a retargeting ad.
The result: organic search looks underperforming in last-touch reports even when it touched a significant portion of pipeline. CFOs and CMOs see last-touch reports. They cut SEO budgets.
Fixing attribution requires three data sources working together:
| Data Source | What It Tells You |
|---|---|
| Google Search Console | Which queries send traffic, at what position, to which pages |
| GA4 with conversion events | Which pages convert trial signups and demo requests |
| CRM export (HubSpot/Salesforce) | Which leads became pipeline, and which pipeline closed |
None of these talks to the others natively. Claude Code connects them.
Connecting GSC Rankings to GA4 Conversion Events
Mapping GSC query data to GA4 conversion events is the foundational step for any B2B SEO attribution model. This analysis identifies which organic keywords drive trial signups, demo requests, and free account creations, not which keywords drive impressions.
Set up GA4 to fire a conversion event for every action that matters: demo_request, trial_signup, pricing_page_view, contact_form_submit. If these aren't already tracked as conversions in GA4, that's step zero before any attribution analysis works.
Export Your GA4 Conversion Data
Use the GA4 Data API to pull conversion events by landing page:
from google.analytics.data_v1beta import BetaAnalyticsDataClient
from google.analytics.data_v1beta.types import (
RunReportRequest, DateRange, Metric, Dimension, FilterExpression,
Filter, MetricAggregation
)
def fetch_organic_conversions(property_id: str, start_date: str, end_date: str):
client = BetaAnalyticsDataClient()
request = RunReportRequest(
property=f"properties/{property_id}",
date_ranges=[DateRange(start_date=start_date, end_date=end_date)],
dimensions=[
Dimension(name="landingPage"),
Dimension(name="sessionDefaultChannelGroup"),
],
metrics=[
Metric(name="sessions"),
Metric(name="conversions"),
Metric(name="totalUsers"),
],
dimension_filter=FilterExpression(
filter=Filter(
field_name="sessionDefaultChannelGroup",
string_filter=Filter.StringFilter(value="Organic Search"),
)
),
metric_aggregations=[MetricAggregation.TOTAL],
)
return client.run_report(request)
Save the output to data/ga4/organic_conversions.json.
Match GSC Queries to Converting Pages
Once you have both datasets, ask Claude Code to cross-reference them:
I have two files:
- data/gsc/queries_last_90_days.json (query, clicks, impressions, position, page)
- data/ga4/organic_conversions.json (landing page, sessions, conversions)
Match queries to pages using the page URL field. For each converting page:
1. List all queries that drove clicks to that page
2. Show average position for those queries
3. Calculate estimated conversions attributable to each query
(query clicks / total page clicks * page conversions)
Sort by estimated conversions, highest first. Output as a markdown table.
The output shows which keywords are your actual pipeline drivers, not just traffic drivers. A query ranking #14 for "saas contract management software" might send fewer clicks than a #3 ranking for "what is contract management," but if the #14 query converts at 8% and the #3 converts at 0.2%, the ranking priority is obvious.
CC for SEO Command Center
Pre-built Claude Code skills for technical audits, keyword clustering, and GSC/GA4 analysis.
Join the WaitlistBe the first to get access
Paid-Organic Overlap Analysis
Paid-organic overlap analysis identifies SaaS keywords where a company is spending budget on Google Ads while already holding strong organic positions. This wasted spend can be redirected to coverage gaps or keywords where organic performance is weak.
This is where the fastest ROI case for SEO lives. If you can show a CFO a spreadsheet of ad spend that's redundant with organic rankings you already hold, you've made an economic case for SEO investment that doesn't depend on explaining search algorithms.
Export Your Google Ads Search Terms
Pull search terms with spend, clicks, and conversions from your Google Ads account:
from google.ads.googleads.client import GoogleAdsClient
client = GoogleAdsClient.load_from_storage("google-ads.yaml")
ga_service = client.get_service("GoogleAdsService")
query = """
SELECT
search_term_view.search_term,
metrics.impressions,
metrics.clicks,
metrics.cost_micros,
metrics.conversions,
metrics.average_cpc
FROM search_term_view
WHERE segments.date DURING LAST_90_DAYS
AND metrics.impressions > 10
ORDER BY metrics.cost_micros DESC
LIMIT 5000
"""
response = ga_service.search(customer_id="YOUR_CUSTOMER_ID", query=query)
Save to data/ads/search_terms_90d.json. Then run the overlap analysis:
Compare data/ads/search_terms_90d.json against data/gsc/queries_last_90_days.json.
Find:
1. Keywords we're paying for where GSC shows average position 1-5
(we rank organically, paid spend is redundant)
2. Keywords we're paying for where GSC shows no impressions
(content gap: paid-only presence, no organic page exists)
3. Keywords with high paid conversions but no organic ranking
(build content here to reduce long-term CAC)
For category 1, calculate: monthly_spend_wasted = clicks * average_cpc
Sort by monthly_spend_wasted, highest first.
The category 1 output is your budget recovery case. Aggregate three months of wasted spend and present it as "organic rankings we already hold are covering $X in monthly ad spend. Here's where to redirect it."
For SaaS sites with active paid search programs, this analysis often surfaces a meaningful list of redundant keywords. The exact number varies by account size and how long the paid program has run without being cross-referenced against organic rankings.
Content Gap Analysis Against Competitors
Content gap analysis identifies keywords where competitors rank in organic search but the target site has no content addressing that topic. For B2B SaaS, this maps directly to commercial intent keywords that are sending evaluation-stage traffic to a competitor's comparison pages, feature pages, or case studies.
Most keyword gap tools show you the gap. Claude Code lets you prioritize it against your conversion data, so you build content for gaps that actually send pipeline, not just traffic.
Get Competitor Ranking Data
Export competitor keyword rankings from your SEO data provider. Most export as CSV:
# Semrush: export via UI or API
# Ahrefs: Site Explorer > Organic keywords > Export
# Save to: data/competitors/
ls data/competitors/
# competitor-a-keywords.csv
# competitor-b-keywords.csv
# competitor-c-keywords.csv
Then ask Claude Code to find the gaps:
I have:
- data/gsc/queries_last_90_days.json (our organic queries)
- data/competitors/ (CSV exports of competitor keyword rankings)
- data/ga4/organic_conversions.json (our converting pages + queries)
Find keywords that:
1. Appear in competitor data with position 1-20
2. Do NOT appear in our GSC data (we have no organic presence)
3. Appear to have commercial intent (contain words like: pricing, vs,
alternative, review, software, platform, tool, demo, trial, best)
For each gap keyword, show:
- Competitor ranking for it
- Estimated monthly volume (from competitor export if available)
- Intent classification (navigational / informational / commercial / transactional)
Sort by estimated volume, filter to commercial + transactional only.
The output is a prioritized content brief backlog. Every keyword on the commercial-intent list is pipeline that currently lands on a competitor's page.
Map Gaps to Your Conversion Funnel Stage
Once you have the gap list, map each keyword to a funnel stage:
| Funnel Stage | Keyword Signals | Content Type |
|---|---|---|
| Awareness | "what is X", "how does X work" | Blog post, guide |
| Consideration | "X vs Y", "best X software", "X alternatives" | Comparison page, feature page |
| Decision | "X pricing", "X demo", "X trial" | Pricing page, landing page |
Decision-stage keywords produce the shortest path to pipeline. Build these pages first.
Get Weekly Claude Code SEO Tips
Workflows, skills, and tactics for SEO professionals using Claude Code.
No spam. Unsubscribe anytime.
Building the Monthly SEO-to-Pipeline Report
A monthly SEO-to-pipeline report connects organic keyword rankings to business outcomes in a single document. For B2B SaaS companies, this report replaces the standard "here are our top ranking pages" update with a document that answers the question a CMO or CFO would ask: did SEO contribute to revenue this month?
The report has four sections: ranking movement, conversion attribution, paid-organic overlap, and pipeline contribution estimate.
Create a Master Fetch Script
Run all data pulls in one command:
#!/bin/bash
# scripts/monthly_fetch.sh
echo "Fetching GSC data..."
python3 fetchers/fetch_gsc.py --days 30 --output data/gsc/current_month.json
echo "Fetching GA4 organic conversions..."
python3 fetchers/fetch_ga4.py --segment organic --events demo_request,trial_signup \
--output data/ga4/organic_conversions_current.json
echo "Fetching Google Ads search terms..."
python3 fetchers/fetch_ads.py --days 30 --output data/ads/search_terms_current.json
echo "Done. Run Claude Code analysis."
Run it on the first of each month:
chmod +x scripts/monthly_fetch.sh
./scripts/monthly_fetch.sh
Prompt Claude Code for the Full Report
With data files refreshed, open Claude Code in the project directory and run:
Generate the monthly SEO-to-pipeline report using all files in:
- data/gsc/current_month.json
- data/ga4/organic_conversions_current.json
- data/ads/search_terms_current.json
- data/crm/leads_this_month.csv (HubSpot/Salesforce export)
Structure the report as:
## 1. Ranking Movement
- Top 10 queries by clicks this month vs. last month
- Queries that moved from position 11-20 to 1-10
- Pages that lost >20% of organic clicks
## 2. Conversion Attribution
- Pages that drove the most demo_request and trial_signup events
- Queries associated with those converting pages
- Conversion rate by landing page (organic sessions only)
## 3. Paid-Organic Overlap
- Updated list of top 10 redundant paid keywords (organic position 1-5)
- Estimated monthly spend on redundant terms
## 4. Pipeline Contribution Estimate
- Total organic-attributed conversion events this month
- Cross-reference with CRM export: leads where first_touch_source = organic
- If CRM data shows average deal size, calculate organic pipeline contribution
Format as markdown. Include a one-paragraph executive summary at the top.
Claude Code generates the report in a single pass. Pipe the output to a Google Doc via Claude Code's file tools, or save as a markdown file and push to your reporting repo.
The CRM Integration Step
The CRM connection is optional but transforms the report from marketing metrics to revenue metrics. Export a CSV from HubSpot or Salesforce with these fields:
contact_id, first_touch_source, first_touch_medium, first_touch_campaign,
lead_created_date, deal_stage, deal_amount, close_date
Filter to first_touch_source = organic or first_touch_medium = organic. This gives you the leads where organic search was the first recorded touchpoint. Match lead creation dates to the month's conversion events, cross-reference with pipeline stage, and you have an organic pipeline dollar figure.
It won't capture every assisted organic touch, but it gives you a defensible floor number: "organic search initiated at minimum $X in pipeline this month based on first-touch attribution."
That number lands differently in a budget conversation than any ranking report.
FAQ
How do I connect GA4 conversion events to actual CRM leads?
The cleanest method uses UTM parameters and user IDs. When a trial signup or demo request fires, capture the GA4 client ID and pass it to your CRM as a contact property. This lets you match GA4 session data to CRM records. HubSpot supports this natively via its GA4 integration. Salesforce requires a custom field and a middleware tool like Segment or Census. Without user ID matching, you rely on first-touch source attribution from your CRM's own tracking, which is less precise but still useful.
What if our B2B sales cycle is 6-12 months? How do I report on pipeline before deals close?
Report on pipeline stage progression, not closed revenue. Track organic-attributed leads as they move from MQL to SQL to opportunity. Calculate pipeline value at each stage using your average deal size and historical close rates. This gives finance and leadership a forward-looking organic pipeline number that doesn't require waiting for closed-won data. Update the cohort monthly so stakeholders can see organic leads progressing through the funnel over time.
Can Claude Code directly access our CRM, or does it need a CSV export?
Claude Code can connect to HubSpot and Salesforce via API using MCP servers. The HubSpot MCP server allows Claude Code to query contacts, deals, and pipeline data directly without exporting CSV files. Salesforce integration requires a REST API wrapper or a community MCP server. For most teams, a monthly CSV export is simpler and avoids granting Claude Code write access to production CRM data.
How do I handle B2B keywords with very low search volume?
Low-volume B2B keywords often carry the highest commercial intent. A query like "enterprise contract lifecycle management software pricing" might have 50 monthly searches but convert at 15%. Don't filter by volume when building the pipeline attribution model. Filter by conversion rate and deal size instead. Small volumes with high conversion rates are where B2B SaaS SEO wins happen, and they're the easiest case to make to a finance team because the per-conversion economics are obvious.
What's the minimum viable version of this for a small SaaS team?
Start with two data sources: GSC queries for the last 90 days and GA4 conversion events by landing page. Run the page-level match manually in Claude Code using the prompts in this post. You don't need the CRM integration or the paid-overlap analysis on day one. The first report that shows "these five pages drove 73% of our demo requests, and here are the queries that sent people to them" is enough to change the conversation internally. Add the CRM layer once leadership starts asking follow-up questions about pipeline value.
How accurate is the query-to-conversion attribution estimate?
It's an estimate, not an exact number. The method (query clicks / total page clicks Ă— page conversions) distributes page-level conversions proportionally across queries. It assumes uniform conversion behavior across all queries landing on a page, which isn't always true. Treat the output as directional intelligence: it tells you which keyword clusters are worth investing in, not the exact revenue contribution of each keyword. For board-level reporting, label it "organic pipeline contribution estimate" and explain the methodology.

Founder, CC for SEO
Martech PM & SEO automation builder. Bridges marketing, product, and engineering teams. Builds CC for SEO to help SEO professionals automate workflows with Claude Code.
Lire ensuite
How to Get Your Brand Cited in AI Search Results
AI search engines cite 18% of optimized brands vs 3% of everyone else. Here's how to structure content, build authority, and automate AEO workflows with Claude Code.
AI VisibilityAI Search Visibility for SEOs: How to Get Cited by ChatGPT, Perplexity, and Google AI
A practical guide for SEO professionals on getting content cited in AI search results. Covers AEO fundamentals, content structuring for citations, and Claude Code workflows for monitoring AI visibility.
AI VisibilityAI Visibility Tools for SEO: SaaS Platforms vs Claude Code Workflows
Compare 9 AI visibility platforms (Peec AI, Scrunch, Semrush) against building your own monitoring with Claude Code. Honest breakdown of when to buy vs build.
Automatisez vos workflows SEO
Skills Claude Code pour les audits techniques, le clustering de mots-clés, l'optimisation de contenu et l'analyse GSC/GA4.
Join the Waitlist