Conversion Tracking
Conversion Tracking
The Google Ads integration uploads click conversions to Google Ads when Pipedrive automations fire a webhook. Each configured conversion action maps to a discrete Google Ads conversion action with a name and value.
Flow
flowchart TD
A[Webhook Received] --> B{Basic Auth valid?}
B -- No --> Z0[Return 401 Unauthorized]
B -- Yes --> C{Tracking enabled?}
C -- No --> Z1[Return success: disabled]
C -- Yes --> D{Conversion name found?}
D -- No --> Z2[Return error: unknown conversion]
D -- Yes --> E[Fetch deal from Pipedrive]
E --> F{GCLID present?}
F -- No --> Z3[Return error: GCLID not found]
F -- Yes --> G[Upload conversion to Google Ads]
G -- Success --> H[Log success, return 200]
G -- CLICK_NOT_FOUND --> I[Queue for retry]
G -- Other error --> J{Permanent or transient?}
J -- Permanent --> K[Log error, return 202]
J -- Transient --> L[Return 502 for Pipedrive retry]
Conversion Upload
When a webhook fires, the system:
- Authenticates the request via HTTP Basic Auth and identifies the company.
- Looks up the conversion action by name from the request body (
conversionfield). - Fetches the deal from Pipedrive using the automation user’s token.
- Extracts the GCLID from the configured deal field.
- Generates a unique
orderIdin the formatpd-{dealId}-{groupId}-{timestamp}for deduplication. - Uploads the conversion via the Google Ads
uploadClickConversionsendpoint to the child account. - Records the result in the conversion log.
GCLID Too New (CLICK_NOT_FOUND)
Google Ads can take several hours to process new ad clicks before they become available for conversion uploads. If the Google Ads API returns a CLICK_NOT_FOUND error:
- The conversion is automatically queued in the retry queue with type
gads_click_not_found. - The queue retries every 30 minutes.
- Retries continue until the configured Retry TTL expires (default: 12 hours).
- The webhook returns HTTP 200 with
{ success: true, queued: true }so Pipedrive does not retry.
See Retry Queue for details.
Error Handling
Upload errors are categorized as permanent or transient:
- CLICK_NOT_FOUND – The GCLID is too new. Queued for automatic retry (see above).
- Other permanent failures (e.g., invalid GCLID, partial failure from Google Ads) – The webhook returns HTTP 202 with
retryable: falseso Pipedrive does not retry. - Transient failures (e.g., authentication errors, server errors) – The webhook returns HTTP 502 so Pipedrive can retry the request.
All errors are recorded in the conversion log and, when applicable, trigger a failure notification email (category: gads_upload_failed).