Özgül Yavuz Kaddoura CEO & Co-founder

Updated Date:

How to Upload Google Ads Offline Conversions With the API (Python Example)

Who This API Guide Is For

This guide is for developers and agencies who send offline conversions to Google Ads from their own CRM or data warehouse through the API. The basic setup — creating an import conversion action, capturing the click ID and hashing customer data — is covered in our Google Ads offline conversions guide; this article picks up where that setup ends, with the API steps and a Python example.

Note: Since 15 June 2026, the Google Ads API no longer accepts new adopters of offline conversion imports; the Data Manager API is now the main path. Existing integrations can keep importing while they move to the Data Manager API, so the example below is mainly for teams that already upload through the Google Ads API.

API Setup: What You Need Before the First Upload

manual offline conversion settings

For teams that want to manage the infrastructure themselves, a manual offline conversion setup with the Google Ads API requires technical precision. Follow these milestones:

StepPhaseTechnical Requirement & Action
1Authentication & Developer TokenCreate a Google Cloud project, enable the Google Ads API, set up OAuth credentials and request a developer token from the API Center of your Google Ads manager account (MCC).
2Click ID CaptureCapture the GCLID, or WBRAID/GBRAID for some iOS traffic. ClickSambo links these IDs to a Stable Device ID to keep tracking consistent even if cookies are cleared.
3Data Hashing (SHA-256)If you also send user-provided data such as email addresses or phone numbers (enhanced conversions for leads), normalize it (lowercase, no extra spaces) and hash it with SHA-256, as Google requires, before uploading.
4Payload ConstructionCreate an import conversion action in Google Ads, then call UploadClickConversions with the conversion_action resource name, the click ID and a conversion_date_time that includes the correct time zone offset.

Python Example: Upload a Click Conversion

The example below uploads one click conversion with the official Google Ads API client library for Python. Replace the IDs and values with your own, and test it in a test account first.

from google.ads.googleads.client import GoogleAdsClient

client = GoogleAdsClient.load_from_storage("google-ads.yaml")
customer_id = "1234567890"
conversion_action_id = "987654321"

upload_service = client.get_service("ConversionUploadService")
action_service = client.get_service("ConversionActionService")

conversion = client.get_type("ClickConversion")
conversion.conversion_action = action_service.conversion_action_path(
    customer_id, conversion_action_id
)
conversion.gclid = "EAIaIQobChMI..."
conversion.conversion_date_time = "2026-11-05 14:30:00+03:00"
conversion.conversion_value = 250.0
conversion.currency_code = "EUR"
# EEA users: send the consent status you collected
conversion.consent.ad_user_data = client.enums.ConsentStatusEnum.GRANTED

request = client.get_type("UploadClickConversionsRequest")
request.customer_id = customer_id
request.conversions.append(conversion)
request.partial_failure = True

response = upload_service.upload_click_conversions(request=request)
if response.partial_failure_error:
    print(response.partial_failure_error.message)

Use gbraid or wbraid instead of gclid for iOS traffic where no GCLID is available. Set partial_failure to true so one bad row does not reject the whole batch.

Tips for Reliable API Uploads

Offline conversion hygiene checklist covering timing, compliance and data sync

Avoid these common mistakes to keep your offline conversion uploads healthy:

Uploading too soon: Google needs some time to process a new click before it can be matched. If you upload a conversion within a few hours of the click, it may fail with an error such as CLICK_NOT_FOUND, so schedule uploads with a short delay and retry failed ones.

Consent signals: For users in the European Economic Area (EEA), include the consent field in your uploads and set ad_user_data to GRANTED only when the user has actually given consent. This applies to every conversion action you upload, including the one used to flag fraudulent clicks.

Internal hygiene: Regularly check that your CRM stages match the conversion actions and categories in Google Ads.

Let ClickSambo Send the Conversions for You

D infographic showing Google Ads offline conversion with API dual-signal flow for primary sales and secondary fraud signals

If you'd rather not maintain an API integration, ClickSambo's Advanced Conversions add-on matches calls, WhatsApp clicks, forms and bookings to the ad click, filters out conversions that came from fake clicks and lets you send the clean ones to Google Ads from your dashboard. It works on the ClickSambo tracking code you already have, with no new code.

Automate Your Google Ads Offline Conversions

Skip the manual API setup. ClickSambo captures click IDs, uploads conversions automatically and keeps fraudulent clicks out of your Smart Bidding data.

Automate Your Google Ads Offline Conversions

Frequently Asked Questions

How does a Google Ads offline conversion with API improve my Smart Bidding?

AI models are only as smart as the data they receive. With offline conversions uploaded through the Google Ads API, you feed Smart Bidding verified human actions, such as qualified leads and sales, instead of raw form fills that may include bots. ClickSambo also flags fraudulent clicks in Google Ads, so they don't distort the data your campaigns optimize on. The result is cleaner signals for Smart Bidding, which helps lower your CPA and stabilize your ROAS.

Can I use offline conversions via the API for Performance Max campaigns?

Yes. Performance Max relies heavily on conversion signals, and low-quality placements can feed it misleading data. Uploading offline conversions through the Google Ads API helps by telling PMax which interactions came from real, high-intent customers. That way, the campaign is less likely to keep spending on traffic that never turns into business. Pairing this with click fraud protection helps keep bot clicks out of your PMax data in the first place.

How does ClickSambo handle fraudulent clicks in offline conversion tracking?

ClickSambo sends detected bots and fake clicks to Google Ads as negative signals, so Smart Bidding steers budget away from them. With the Advanced Conversions add-on, conversions that came from fake clicks are filtered out before you send the rest to Google Ads, so your reported results reflect real customers.

Why do I get a CLICK_NOT_FOUND error when uploading offline conversions?

This is usually a timing issue. Google needs some time to process a new click identifier (GCLID) before it can be matched to a conversion. If you upload a conversion within a few hours of the click, the ID may not be recognized yet. Other common causes are uploading to the wrong Google Ads account or using a click ID that has been changed or cut off. With Advanced Conversions, ClickSambo retries very new clicks automatically every 30 minutes for 24 hours.

Do I need the manual setup if I use ClickSambo?

Not for conversions that happen on your site. For calls, WhatsApp clicks, forms and bookings, the Advanced Conversions add-on matches each conversion to its ad click on the ClickSambo tracking code you already have; you review the matched conversions and send the ones you choose to Google Ads from the dashboard, with no API work. A custom integration built with the Google Ads API conversion documentation makes sense when deals close in your CRM, such as signed contracts or in-store sales.

Sources

  1. Google Ads API — Upload offline conversion (code sample)
  2. Google Ads API — Conversion management overview
Partner Program

Ready to grow with ClickSambo?

Join our partner program and turn ad-fraud protection into a scalable, recurring revenue stream.

Apply to the program

ClickSambo support is available!

Whatsapp Chat