Home › Guides › Fix Google Data Manager API (events:ingest) Batch Rejection Errors
Fix Google Data Manager API (events:ingest) Batch Rejection Errors
Why a single malformed CRM row can reject an entire events:ingest batch of up to 2,000 events, the exact fix for all 6 validation traps, and the pre-flight quarantine pattern that stops silent conversion loss.
partialFailure: true to skip bad rows. Google Data Manager API v1 (POST /v1/events:ingest) enforces strict batch-level validation: one malformed event can reject the entire payload (up to 2,000 events). You must validate, normalize, and quarantine bad rows before hashing and POSTing.
Still migrating off UploadClickConversions after hitting CUSTOMER_NOT_ALLOWLISTED? Start with our CUSTOMER_NOT_ALLOWLISTED 2026 migration guide.
1. Quick reference: the 6 batch-rejection traps
| Trap | Strict rule | Failure mode |
|---|---|---|
| 1. Non-E.164 phone | ^\+[1-9]\d{7,14}$ before SHA-256 HEX | Validation error or non-matching hash |
| 2. Un-trimmed / uppercase email | LOWER(TRIM(email)) + Gmail dot strip before SHA-256 HEX | Silent Enhanced Conversions match drop |
| 3. Naive timestamp | RFC 3339 / ISO-8601 with Z or ±HH:MM | Whole-batch schema rejection |
| 4. Bad value or currency | Clean float conversionValue + ^[A-Z]{3}$ currency | Schema error or broken Target ROAS |
5. Duplicate transactionId | Deterministic unique key per (record, action) | Duplicate conflicts or inflated counts |
| 6. >90-day GCLID expiry | DATE_DIFF(event, click, DAY) <= 90 | Dropped click-ID attribution |
2. Exact fix for each rejection trap
Non-E.164 phone numbers before SHA-256 HEX
What breaks: Spaces, dashes, parentheses, or missing country codes (like (415) 555-0142 or 44 20 7946 0114) fail validation or hash to values Google can never match.
- Strict rule: Normalize to
^\+[1-9]\d{7,14}$before SHA-256 hashing and hex encoding. - Fix: Strip non-digits, prepend
+and the verified country calling code (never guess country codes on international leads), and verify length is 8–15 digits. If invalid, dropphoneNumberfromuserIdentifiers(keep validemailAddressorgclid) and log the row to quarantine.
Un-trimmed or uppercase email before SHA-256 HEX
What breaks: " Elena.Vance@NorthPeak.io " produces a completely different SHA-256 digest than "elena.vance@northpeak.io", silently zeroing out Enhanced Conversions matching.
- Strict rule: Trim whitespace, lowercase all characters, validate syntax (
^[^\s@]+@[^\s@]+\.[^\s@]{2,}$), and remove dots before@for@gmail.com/@googlemail.comaddresses before hashing. - Fix: Run
LOWER(TRIM(email))in SQL or Python before hashing. Reject malformed strings (e.g.ops@) and quarantine rows that have neither a valid click ID nor a valid normalized email or phone.
Missing ISO-8601 / RFC 3339 timezone offset
What breaks: CRM exports often output naive timestamps like 2026-10-14 09:22:00 without an offset. events:ingest requires explicit RFC 3339 eventTimestamp.
- Strict rule: Must match
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,6})?(Z|[+-]\d{2}:\d{2})$. - Fix: Convert all CRM stage transition timestamps to UTC (
Z) in the warehouse. AsserteventTimestampis not in the future and not earlier thanclickTimestamp. Quarantine any null or unparseable timestamp.
Missing or non-numeric conversionValue or invalid ISO-4217 currency
What breaks: Formatted strings like "$12,000", null values, or lowercase/blank currency codes (usd) trigger schema rejections or distort value-based bidding.
- Strict rule:
conversionValuemust be a numeric float (> 0for valued stages) andcurrencymust match^[A-Z]{3}$(USD,GBP,EUR). - Fix: Strip currency symbols and commas, cast to
FLOAT64, and uppercase/validatecurrencyagainst an allowed ISO-4217 list. For early qualified stages (likeSQL) without a deal amount yet, assign your agreed static stage proxy value in the warehouse rather than sendingnull.
Duplicate transactionId
What breaks: Retrying a failed job or running overlapping incremental syncs with the same CRM ID causes duplicate conversion conflicts or inflated Smart Bidding counts.
- Strict rule: Every event needs a deterministic, unique
transactionIdper(record, conversion_action). - Fix: Build
transactionIdasCONCAT(crm_record_id, '_', stage_slug)(e.g.LD-1001_sql). Deduplicate withQUALIFY ROW_NUMBER() OVER (PARTITION BY transaction_id ORDER BY event_timestamp DESC) = 1, and anti-join against asent_events_logtable before building each batch.
>90-day GCLID window expiry
What breaks: B2B sales cycles often close 95–180 days after the ad click. Google Ads drops click-ID attribution past the 90-day GCLID window.
- Strict rule: Verify
DATE_DIFF(qualified_at, created_at, DAY) <= 90before attachingadIdentifiers.gclid. - Fix: Route rows with
lag_days > 90to a review table instead of polluting your primary GCLID batch. Optimize primary bidding on an earlier qualified milestone (SQLorBooked Demo) that happens well inside 90 days. Never fake or shift timestamps.
3. Pre-flight quarantine architecture
Separate validation from transmission. Never let raw CRM exports go straight into POST /v1/events:ingest:
CRM Qualified Stage View (HubSpot / Salesforce / Pipedrive)
│
▼
[1. Pre-Flight Validator View] ──► Failed rows ──► dm_api_quarantine (alert if >5% of batch)
│
▼ (Clean rows only, deduplicated by transactionId, chunked <= 2,000 events)
[2. Dry Run: POST /v1/events:ingest with validateOnly: true]
│
▼ (0 schema errors)
[3. Live Upload: POST /v1/events:ingest with validateOnly: false]
│
▼
[4. Log accepted transactionIds + Weekly CRM-vs-Ads reconciliation]
Warehouse pre-flight split pattern (BigQuery SQL)
Tag every candidate row with a quarantine_reason before hashing. Only rows where quarantine_reason IS NULL move to the uploader:
WITH normalized AS (
SELECT
CONCAT(crm_record_id, '_', stage_slug) AS transaction_id,
FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%SZ', qualified_at) AS event_timestamp,
LOWER(TRIM(email)) AS clean_email,
REGEXP_REPLACE(phone, r'[^0-9+]', '') AS clean_phone,
SAFE_CAST(conversion_value AS FLOAT64) AS conversion_value,
UPPER(TRIM(currency)) AS currency,
gclid,
DATE_DIFF(DATE(qualified_at), DATE(created_at), DAY) AS lag_days
FROM `project.dataset.crm_qualified_stages`
QUALIFY ROW_NUMBER() OVER (
PARTITION BY CONCAT(crm_record_id, '_', stage_slug)
ORDER BY qualified_at DESC
) = 1
),
validated AS (
SELECT
*,
CASE
WHEN event_timestamp IS NULL THEN 'MISSING_TIMESTAMP'
WHEN conversion_value IS NULL OR conversion_value <= 0 THEN 'INVALID_VALUE'
WHEN NOT REGEXP_CONTAINS(currency, r'^[A-Z]{3}$') THEN 'INVALID_CURRENCY'
WHEN gclid IS NOT NULL AND lag_days > 90 THEN 'GCLID_EXPIRED_GT_90D'
WHEN gclid IS NULL
AND NOT REGEXP_CONTAINS(IFNULL(clean_email, ''), r'^[^\s@]+@[^\s@]+\.[^\s@]{2,}$')
AND NOT REGEXP_CONTAINS(IFNULL(clean_phone, ''), r'^\+[1-9]\d{7,14}$')
THEN 'NO_VALID_IDENTIFIER'
ELSE NULL
END AS quarantine_reason
FROM normalized
)
SELECT * FROM validated
WHERE quarantine_reason IS NULL
AND transaction_id NOT IN (SELECT transaction_id FROM `project.dataset.sent_events_log`);
Want to test a CRM export before writing SQL? Test your CRM CSV in your browser — zero rows uploaded, or run our open-source Python pre-flight validator on GitHub (MIT license) in CI/CD.
4. Frequently asked questions
Does Google Data Manager API events:ingest support partialFailure like the legacy Google Ads API?
No. events:ingest enforces strict request-level schema and format validation. One malformed event in a request of up to 2,000 events can reject the entire batch, which is why you must quarantine invalid rows before building the JSON payload.
What happens if a CRM lead has a valid email but a malformed phone number?
Do not hash and send the malformed phone number. Strip the invalid phoneNumber entry from userData.userIdentifiers, keep the valid normalized SHA-256 emailAddress (and gclid if within 90 days), and log the phone formatting issue to your quarantine table.
Should I send HEX or BASE64 for SHA-256 hashes in events:ingest?
Either HEX or BASE64 works as long as every hash in the request matches the top-level encoding field. Lowercase 64-character HEX is easier to inspect and debug in BigQuery and Python pipelines.
How should B2B teams handle deals that close more than 90 days after the ad click?
Google Ads drops click-ID attribution past the 90-day GCLID window. Split rows where lag_days exceeds 90 out of your primary GCLID batch, and optimize bidding on an earlier qualified CRM milestone such as SQL or Booked Demo that happens inside 90 days. Never alter timestamps to fake a shorter window.
Engineering tools & related guides
- Signal Check — Test your CRM CSV in your browser — zero rows uploaded.
- Data Manager API Migration Kit — Full migration kit + BigQuery reconciliation SQL.
- google-data-manager-api-validator — Open-source Python pre-flight validator on GitHub, MIT license.
- Fix CUSTOMER_NOT_ALLOWLISTED on UploadClickConversions — Complete 2026 migration guide and copy-paste JSON payload.
- Security & Data Architecture — How we handle read-only access, BigQuery isolation, and SHA-256 hashing.
Stop losing batches silently in Google Data Manager API
Want us to audit your CRM export, wire up pre-flight quarantine in your BigQuery project, and reconcile uploaded conversions weekly?