跳到正文
DEV Community· Mohamed Kadi·· 5 小時前AI 評分50

如何將 CRM 潛在客戶階段作為離線轉換回傳至 Google Ads,避免只按表單提交優化

Stop Optimizing Google Ads for Form Fills: Send CRM Lead Stages Back as Offline Conversions

AI 導讀

這篇實作指南説明如何把 CRM 中潛在客戶的銷售階段作為離線轉換回傳至 Google Ads,讓出價優化目標由表單提交轉向合資格潛在客戶。做法是保存 gclid、gbraid 或 wbraid,並在 CRM 狀態變更時連同轉換時間等資料上傳。待合資格潛在客戶的轉換穩定回傳後,再把它設為主要轉換,並先在一個廣告系列調整。

正文

If you build lead forms for B2B companies, you've probably wired a conversion tag to the "thank you" page and moved on. Smart Bidding then does exactly what it's told: it finds people who like filling in forms. Whether they ever become customers is invisible to it.

The fix is not a better form tag. It's sending what happens after the form, in the CRM, back to Google Ads. Here's how I set that up as a developer, step by step.

The idea in one paragraph

Store the click ID that brought each lead to the site. When the sales team moves that lead to "qualified", "proposal sent" or "won" in the CRM, send that event back to Google Ads as an offline conversion with the original click ID and the time it happened. Then make the later stages your primary conversions and demote the form submit to secondary.

1. Capture the click ID on landing

Google Ads appends gclid (and on iOS traffic sometimes gbraid / wbraid) to the landing URL when auto-tagging is on. Grab it on the first page view and keep it for the session, because the visitor often submits the form on a different page.

// on every page load
const params = new URLSearchParams(location.search);
for (const key of ["gclid", "gbraid", "wbraid"]) {
  const v = params.get(key);
  if (v) {
    // first-party storage; keep it ~90 days, matching the click window you use
    localStorage.setItem(key, JSON.stringify({ v, t: Date.now() }));
  }
}

Respect consent: only store it if your consent setup allows ad storage for that visitor.

2. Send it with the form

Add hidden fields and fill them just before submit:

form.addEventListener("submit", () => {
  for (const key of ["gclid", "gbraid", "wbraid"]) {
    const raw = localStorage.getItem(key);
    if (raw) form.elements[key].value = JSON.parse(raw).v;
  }
});

On the server, save these values on the lead record in the CRM, next to the email and phone number. If the click ID never reaches the CRM, nothing else in this guide works, so test this first.

3. Define stages the sales team actually uses

Agree with sales on a short, fixed list of statuses, for example:

CRM status Google Ads conversion action
New (form submitted) Lead – form (secondary)
Qualified Lead – qualified (primary)
Proposal sent Lead – proposal (primary or secondary)
Won Customer – won (primary, with value)

The key requirement: the status must be updated consistently, by people, in the CRM. If half the team never touches the status field, the data you send back is wrong and bidding learns from noise.

4. Create the conversion actions

In Google Ads, create one conversion action per stage with the source set to import from clicks. Set the counting to "one" for lead stages. For "won", pass a value if you can, even an estimate per deal type, so value-based bidding has something to work with.

Also turn on enhanced conversions for leads. It lets Google match conversions using hashed email or phone when the click ID is missing, which happens more often than you'd think.

5. Push status changes back

Whenever a lead's status changes in the CRM, queue an upload with:

  • the click ID (gclid / gbraid / wbraid),
  • the conversion action for the new stage,
  • the time of the status change, with timezone,
  • the value and currency, if any,
  • hashed email/phone for enhanced conversions.

You can upload a scheduled CSV, use a CRM's built-in Google Ads integration, or call the Google Ads API's offline conversion upload from a small job. The API route is the most flexible: a webhook from the CRM on status change, a queue, and a worker that uploads in batches and logs every result.

CRM status change  ->  webhook  ->  queue  ->  upload worker  ->  Google Ads
                                                   |
                                                   +-> log: lead id, click id, action, status

Log every upload response. Rejected rows (expired click, unknown click ID, wrong time format) are the most common silent failure.

6. Switch the optimisation goal

Once the qualified-lead conversions are flowing steadily, make "Lead – qualified" the primary conversion and set the form submit to secondary. Bidding now optimises for leads your sales team considers real, not for form fills.

Don't switch on day one. Let the new conversions accumulate first, and change one campaign before all of them.

Common mistakes I see

  • Click ID lost between pages. Stored only on the landing page, gone by the time the visitor reaches the contact page.
  • Status changes with the wrong time. Uploading "now" instead of the moment the status actually changed, or forgetting the timezone.
  • Too many stages. Six primary conversions confuse bidding. Two or three are enough.
  • No one owns the CRM statuses. The pipeline only works if sales keeps them up to date.
  • No monitoring. Compare the number of qualified leads in the CRM with the conversions Google Ads reports every week. A gap means uploads are failing.

Wrapping up

The tracking code is the easy part: a few lines of JavaScript and a hidden field. The real work is agreeing on CRM stages and making sure the data flows back reliably. When it does, your campaigns stop chasing form fills and start chasing customers.

If you'd rather not build this yourself, it's the kind of setup we handle as a Google Ads agency that also builds the CRM side. Either way, start by checking whether the click ID actually reaches your CRM today. In my experience, that's where most setups break.

來源:DEV Community · dev.to