Skip to main content

Connect Pipedrive deal outcomes to GA4 & Google Ads via Measurement Protocol

Workflow preview

Workflow preview
100%
Connect Pipedrive deal outcomes to GA4 & Google Ads via Measurement Protocol preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who’s it for Problem: Your ads and GA4 often optimize to shallow web events (form fills), while the real value sits in Pipedrive (Qualified, Closed Won). That gap means bidding chases cheap leads i...

Best for

  • CRM automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.pipedrivetrigger, n8n-nodes-base.pipedrive, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.splitout

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Artur.

Original n8n.io source

1.1 Workflow description

Title
Connect Pipedrive deal outcomes to GA4 & Google Ads via Measurement Protocol
Workflow name
Connect Pipedrive deal outcomes to GA4 & Google Ads via Measurement Protocol

Who’s it for

Problem: Your ads and GA4 often optimize to shallow web events (form fills), while the real value sits in Pipedrive (Qualified, Closed Won). That gap means bidding chases cheap leads instead of revenue.

Solution: This template turns Pipedrive deal milestones into server-side GA4 events (via Measurement Protocol), matched to the original visitor by client_id—no external database. You mark them as Key events in GA4 and, when ready, import them into Google Ads.

Business value: Ads can optimize on actual CRM outcomes with value (and currency), improving CAC/ROAS and reducing lead spam. Everything stays GA4-centric, consent-aware, and deduped with deterministic event_id, so you get reliable attribution without building a custom Ads integration. If you’re serious about scaling paid spend toward high-quality, high-value deals, this is the missing link.

This is not plug-and-play. Expect ~2 hours of developer work to integrate:

What it does

On Deal Updated, the workflow checks for target stages (e.g., Qualified, Closed Won), fetches the linked Person’s client_id, builds a GA4 Measurement Protocol event (with value, currency, deterministic event_id), and posts it server-side. Success updates deal-level dedupe flags; failures are logged to a Pipedrive Note. Credentials use n8n Credentials—no hardcoded secrets.

How it works (high level)

A Pipedrive trigger listens for stage changes → an eligibility check gates sends → a payload builder composes the GA4 event → an HTTP call posts to GA4. Sticky notes in the canvas explain the whole setup and what to edit.

Requirements

GA4 installed on your site; GA4 Measurement ID + API Secret (same data stream); Pipedrive Person field for client_id, optional consent_granted; Pipedrive Deal booleans for dedupe; n8n credentials configured (no secrets in nodes).

How to customize the workflow

  • Change which stages send events and the event names.
  • Adjust value logic (e.g., margin- or probability-weighted).
  • Choose skip-on-no-consent vs. non_personalized_ads: true.
  • Add extra params (deal_id, pipeline_stage, etc.) to GA4 as custom dimensions (event-scoped).

Troubleshooting & debugging

  • If client_id is null: GA4 not initialized yet, consent denied, GTM var not firing, or adblockers—fix site capture first.
  • If GA4 shows events in DebugView but Ads import is empty: events not marked as Key events, GA4↔Ads not linked/imported, or wrong stream/secret pairing.
  • Use https://www.google-analytics.com/debug/mp/collect only for payload validation; it won’t verify your API secret. Final sends go to /mp/collect.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Pipedrive Trigger

Type / Role
n8n-nodes-base.pipedriveTrigger - pipedriveTrigger
Config choices
Version 1.1

Block 2 - Get a deal

Type / Role
n8n-nodes-base.pipedrive - pipedrive
Config choices
Version 1

Block 3 - Get a person

Type / Role
n8n-nodes-base.pipedrive - pipedrive
Config choices
Version 1

Block 4 - get personFields

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Get client_id and consent_granted

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - If client_id exists and consent is given

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 7 - Construct GA4 object

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - HTTP Request — Send GA4

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Assign Variables

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 12 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - get stages for pipeline

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 15 - Filter

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 16 - If correct stage name

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 17 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Connect Pipedrive deal outcomes to GA4 & Google Ads via Measurement Protocol
Complexity advanced
Nodes 17
Categories CRM
Author Artur
Published 03 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8215/8215.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Connect Pipedrive deal outcomes to GA4 & Google Ads via Measurement Protocol do?

Who’s it for Problem: Your ads and GA4 often optimize to shallow web events (form fills), while the real value sits in Pipedrive (Qualified, Closed Won). That gap means bidding chases cheap leads i...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your CRM use case.