What is CAPI (Conversion API)?
CAPI (Conversion API) allows you to send conversion data directly from your server to Google, bypassing browser-based tracking entirely. Instead of relying on JavaScript tags that can be blocked, you upload conversion events via the Google Ads API.
How It Works
When a customer completes a purchase, your server sends the conversion data (GCLID, order value, timestamp) directly to Google Ads. This happens server-to-server, so ad blockers, cookie restrictions, and browser privacy settings don't affect it.
CAPI vs Client-Side Tracking
| Feature | Client-Side (gtag.js) | Server-Side (CAPI) |
|---|---|---|
| Ad blocker impact | Blocked (15-30% loss) | Not affected |
| iOS privacy (ATT) | Limited by opt-outs | Bypassed |
| Cookie restrictions | 7-day lifespan (Safari) | Server-controlled (90+ days) |
| Cross-device tracking | Limited | Better attribution |
| Offline sales | Not possible | Fully supported |
| Data accuracy | 50-70% of actual | 85-95%+ of actual |
Conversion Types Supported
- Click conversions — Purchases, signups, or leads that happen after an ad click (requires GCLID)
- Call conversions — Phone orders tracked through call tracking systems
- Store sales — In-store purchases attributed to online ad exposure
- Enhanced conversions — Conversions enriched with first-party customer data (email, phone, address)
Why CAPI Matters for E-Commerce
For Google Shopping advertisers, conversion data directly impacts Smart Bidding performance. Missing conversions means Google can't optimise effectively.
The Impact on Your Campaigns
Without CAPI
- Smart Bidding sees incomplete data
- ROAS appears lower than reality
- Remarketing audiences are smaller
- Budget decisions based on partial truth
- iOS/Safari conversions largely invisible
With CAPI
- Complete conversion picture
- Accurate ROAS and profitability metrics
- Better audience building and targeting
- Confident budget scaling decisions
- All devices and browsers tracked
Why Accurate Data Enables Profit Optimisation
Tracking accuracy isn't just about reporting — it directly impacts bid optimisation. When 30% of conversions are invisible to Google, Smart Bidding makes decisions on incomplete data. Profit-based bidding tools like ProfitClarity include a tracking accuracy setting that compensates for this loss, ensuring your ROAS targets account for conversions Google can't see. But the foundation is accurate data: CAPI ensures you capture the full picture.
2026 API Changes
Starting February 2, 2026, new developers can no longer use session attributes or IP address data in Google Ads API conversion imports. Google is pushing advertisers toward the Data Manager API as the unified solution. Plan your implementation now to stay ahead.
Step 1: GCLID Capture & Storage
The GCLID (Google Click ID) is the critical link between ad clicks and conversions. When someone clicks your Google ad, a unique identifier is appended to the URL:
https://yourdomain.com/product?gclid=EAIaIQobChMI...
Enable Auto-Tagging
- In Google Ads, go to Settings → Account Settings
- Enable Auto-tagging
- This automatically appends
gclidto all ad click URLs
Capture GCLID on Your Site
Add this script to capture GCLIDs from URLs and store them for later use:
// GCLID Capture Script
(function() {
const CONFIG = {
GCLID_KEY: 'grow_gclid',
EXPIRY_DAYS: 90
};
// Extract GCLID from URL
function getGclidFromUrl() {
const params = new URLSearchParams(window.location.search);
return params.get('gclid') ||
params.get('wbraid') || // iOS web fallback
params.get('gbraid'); // iOS app fallback
}
// Store in localStorage + cookie
function storeGclid(gclid) {
if (!gclid) return;
// localStorage (primary)
localStorage.setItem(CONFIG.GCLID_KEY, gclid);
localStorage.setItem(CONFIG.GCLID_KEY + '_ts', Date.now());
// Cookie (backup, cross-subdomain)
const expires = new Date(
Date.now() + CONFIG.EXPIRY_DAYS * 86400000
);
document.cookie = CONFIG.GCLID_KEY + '=' + gclid +
';expires=' + expires.toUTCString() +
';path=/;SameSite=Lax;Secure';
}
// Initialize
const gclid = getGclidFromUrl();
if (gclid) storeGclid(gclid);
})();
Pass GCLID Through Checkout
Ensure the GCLID is captured with each order by adding a hidden field to your checkout form:
<!-- Add to checkout form -->
<input type="hidden" name="gclid" id="gclid_field">
<script>
// Populate hidden field with stored GCLID
document.getElementById('gclid_field').value =
localStorage.getItem('grow_gclid') || '';
</script>
Store GCLID in Your Database
Add a GCLID column to your orders table:
-- Database schema addition
ALTER TABLE orders ADD COLUMN gclid VARCHAR(255);
ALTER TABLE orders ADD COLUMN conversion_uploaded_at TIMESTAMP;
ALTER TABLE orders ADD INDEX idx_gclid (gclid);
GCLID is Case-Sensitive
Store and upload GCLIDs exactly as received. Don't modify, truncate, or change the case. The GCLID must match Google's records exactly for conversion attribution to work.
Step 2: Create Conversion Actions
Before uploading conversions, you need to set up conversion actions in Google Ads.
Create a Conversion Action
- In Google Ads, go to Goals → Conversions → Summary
- Click + New conversion action
- Select Import → Other data sources or CRMs
- Choose Track conversions from clicks
- Configure your conversion action:
| Setting | Recommendation | Notes |
|---|---|---|
| Name | "Offline Purchase" or "Server-Side Purchase" | Clear, descriptive name |
| Category | Purchase | Match your conversion type |
| Value | Use different values for each conversion | Pass actual order values |
| Count | Every (for purchases) | Use "One" for leads |
| Click-through window | 30-90 days | Match your sales cycle |
Get the Conversion Action ID
After creating the conversion action, note the Conversion Action ID — you'll need this for the API upload.
Step 3: Upload Conversions via API
With GCLIDs captured and conversion actions created, you can now upload conversions to Google Ads.
API Requirements
- Developer token — Request via Google Ads API Center
- OAuth 2.0 credentials — From Google Cloud Console
- Customer ID — Your Google Ads account ID (without dashes)
- Conversion Action ID — From the conversion action you created
Conversion Upload Payload
Each conversion requires these fields:
// Conversion data structure
{
"gclid": "EAIaIQobChMI...", // Required
"conversion_action": "customers/123/conversionActions/456",
"conversion_date_time": "2026-03-23 14:30:00+00:00",
"conversion_value": 99.99,
"currency_code": "USD",
"order_id": "ORD-12345" // Prevents duplicates
}
Upload Frequency Best Practices
| Setting | Recommendation | Why |
|---|---|---|
| Batch size | 100-500 conversions | Balance throughput vs latency |
| Frequency | Every 5-15 seconds | Near real-time without overwhelming API |
| Retry logic | Exponential backoff with jitter | Handle transient failures gracefully |
| Processing | Event-driven (on order completion) | Reduces latency from hours to seconds |
Don't Batch Daily
Hourly or daily batches are too slow for Smart Bidding algorithms. Upload conversions within minutes of completion for best campaign optimisation.
Step 4: Enhanced Conversions
Enhanced conversions add first-party customer data to your conversion uploads, dramatically improving match rates and attribution accuracy.
User Identifiers to Include
- Email address — Most important, highest match rate
- Phone number — E.164 format (+1234567890)
- First name & last name
- Street address, city, state, postal code, country
Data Normalisation & Hashing
All user data must be normalised and hashed with SHA-256 before upload:
// Data normalisation and hashing
function hashAndNormalize(value) {
// 1. Normalize: lowercase, trim whitespace
let normalized = value.trim().toLowerCase();
// 2. Special handling for Gmail addresses
if (normalized.includes('@gmail.com')) {
const [username, domain] = normalized.split('@');
// Remove periods from username
normalized = username.replace(/\./g, '') + '@' + domain;
}
// 3. Hash with SHA-256
return crypto.createHash('sha256')
.update(normalized)
.digest('hex');
}
// Example: Hash email before upload
const hashedEmail = hashAndNormalize('John.Doe@Gmail.com');
// Result: SHA-256 hash of "johndoe@gmail.com"
Multi-Layered Matching
Enhanced conversions use multiple signals to match conversions:
- Primary match — GCLID links to specific ad click
- Fallback match — Email/phone matches to signed-in Google account
- Cross-device recovery — User clicks on mobile, converts on desktop
- Cookie deletion recovery — GCLID expired but email matches
Privacy Compliance
Hashing is done before data leaves your server. Google only receives hashed, non-reversible data. For EEA/UK users, you must also pass consent signals (ad_user_data = GRANTED) per Consent Mode v2 requirements.
Best Practices
Data Quality Checklist
- Unique order IDs — Prevents duplicate conversions
- Accurate values — Use actual order totals, not placeholders
- Correct timestamps — Include timezone (e.g.,
2026-03-23 14:30:00+00:00) - GCLID case preserved — Exact match required
- Multiple identifiers — Email + phone + address for best match rate
- 90-day retention — Store GCLIDs for full attribution window
Common Pitfalls to Avoid
- Don't modify GCLIDs — Store exactly as received
- Don't batch daily — Upload within minutes, not hours
- Don't skip error handling — Implement retry logic
- Don't ignore partial failures — Check API response for rejected conversions
- Don't upload test data to production — Use separate conversion actions for testing
Combine with Tag Gateway
Tag Gateway and CAPI work together as complementary layers:
| Layer | What It Does | Coverage |
|---|---|---|
| Tag Gateway | First-party tracking, bypasses ad blockers | ~85-95% of users |
| CAPI | Server-side upload, offline sales | 100% of completed sales |
| Enhanced Conversions | First-party data matching | Improves attribution accuracy |
GROW Platform Integration
The GROW Platform includes built-in offline conversion tracking that captures GCLIDs at signup, associates them with subscriptions, and automatically uploads conversions to Google Ads. This same approach can be adapted for any e-commerce platform.
Profit-Based Conversion Values
Most brands upload order revenue as the conversion value. But Smart Bidding then optimises for revenue, not profit — treating a 10% margin sale the same as a 60% margin sale.
MarginStack enables profit-based conversion values. Instead of uploading £99.99 (order total), upload £35.00 (actual profit based on COGS, fees, and return costs). Now Google's algorithms optimise for what actually matters: profit.
| Approach | Conversion Value | What Google Optimises For |
|---|---|---|
| Revenue-based | £99.99 (order total) | Maximum revenue, regardless of margin |
| Profit-based (MarginStack) | £35.00 (actual profit) | Maximum profit, prioritises high-margin products |
ProfitClarity provides a validation layer that reconciles uploaded conversions with backend order data and MarginStack costs — ensuring your conversion values accurately reflect real profit margins, not estimates.
Monitoring & Diagnostics
Key Metrics to Track
| Metric | Target | Action if Failing |
|---|---|---|
| Match rate | 80%+ | Add more user identifiers |
| Upload success rate | 95%+ | Check GCLID validity, timestamps |
| Data freshness | <15 minutes | Move to event-driven uploads |
| GCLID capture rate | Track % of orders with GCLID | Audit capture script placement |
| Enhanced conversions coverage | 70%+ | Capture more customer data fields |
Google Ads Diagnostics
- Go to Goals → Conversions → Summary
- Click your conversion action
- Check the Diagnostics tab for:
- Upload status and errors
- Match rate for enhanced conversions
- Data freshness indicators
- Recommended improvements
Implementation Roadmap
A practical timeline for implementing CAPI tracking:
- Enable auto-tagging in Google Ads
- Implement GCLID capture and storage
- Test GCLID persistence through checkout
- Add database schema for GCLID storage
- Request developer token (if needed)
- Set up OAuth 2.0 authentication
- Build conversion upload service
- Test with small batch (10-20 conversions)
- Capture first-party data at checkout
- Implement normalisation and hashing
- Add user identifiers to uploads
- Monitor match rate in diagnostics
- Move to real-time (event-driven) uploads
- Set up monitoring and alerting
- Compare Google Ads conversions vs CRM data
- Enable Smart Bidding with improved data
Expected Results
- 15-25% increase in tracked conversions
- 5-17% improvement in Smart Bidding performance
- 80%+ match rate for GCLID + user identifier combinations
- Recovery of iOS/ad-blocker lost conversions
GROW Your |
Deliver on your commitment to cut costs, improve profit margins & grow sales, with smart automation tools.
GROW is a profit-first automation layer for global e-commerce brands — turning real-time COGS and CAC data into fully automated, SKU-level advertising that can launch, rebuild, and update millions of products in minutes.