Skip to main content
Pick this if you sell through a form and a sales team, and the deal closes weeks after the click. When you finish, you can see which campaign produced a lead, which produced a qualified lead, and which produced revenue.

Before you start

  • Decide the stages you will report. Four is a good default.
  • Decide the durable ID your CRM uses for a lead.
  • Have server access for the downstream stages.

Name the stages first

Never fire lead_submitted on the submit-button click. A click fires on validation errors, double-clicks, and abandoned forms. Your ad platform then optimizes toward people who fail your form.

The path

Carry the ID downstream

Stage 1 runs in the browser. Stages 3 and 4 run on your server, hours or weeks later, so the join only works if the same ID reaches both places.
  1. Store the visitor_id on the CRM record at stage 1.
  2. Read datalyr.getVisitorId() in the browser and send it with the form.
  3. Pass that visitor_id on every later server event.
Send a stable order_id or event ID on stage 4, so a retry does not create a second won deal.

Choose the optimization event

Start with the stage that has enough weekly volume for the ad platform to learn from, and move deeper down the funnel as your downstream data proves out.

Verify

  1. Open the landing page in a private window with ?utm_source=leadtest.
  2. Submit the form with a test email address.
  3. Open Events and confirm lead_submitted with utm_source=leadtest.
  4. Advance the record to qualified in your CRM.
  5. Send lead_qualified from your server with the same visitor_id.
  6. Open Users and confirm both events sit on one profile.

When it doesn’t work

Next

  • Custom events: the properties a conversion rule reads.
  • Node SDK: send the downstream stages from your server.
  • Identity: join the browser and the server events.