Run the example
Save the sample exports and report script in the same folder and run with Node.js 20 or later. Compare the output with the expected report.
node lead-booking-report.mjs lead-booking-exports.jsonSteps
Agree what counts as a job
Write down the CRM states you count. A simple policy is booked and completed, with cancellations and open enquiries omitted. Determine whether the report follows the original lead date or the booking date. For a lead cohort, apply the same time allowed for conversion to both periods. Keep booked amounts separate from collected revenue and profit.
Join using an existing reference
Use an opaque lead reference captured by the form or phone system and carried into the CRM. Keep the join in your approved workspace, outside Google Analytics. Several calls or a call and a form can share one reference. Use the CRM job ID as the counting unit and resolve duplicate CRM rows before reporting. Ask the owner for evidence on matches the files can’t resolve.
Give unknown sources their own row
Keep confirmed website Google organic, Business Profile, and paid outcomes distinct when the captured source supports those labels. A Business Profile call-button tap or website phone-link click only records an interaction. Use phone records to confirm calls and the CRM to confirm jobs. Leave missing, conflicting, and unjoinable sources unknown.
Send a short report someone can check
Show confirmed jobs and known booked amount by source and period. Record the IDs of unresolved matches in your working copy. If the owner asks about return and has both figures, subtract SEO spend from the gross profit on attributable completed jobs and divide by that spend. Show the figures, period, and gaps in attribution. Recommend one follow-up with an owner and date.
A form and a call produce one heating job
The same request arrives twice. The owner counts jobs from the CRM and checks the source from intake.
| Evidence | CRM result | Report as |
|---|---|---|
| Form and call share L01 and agree on source | J01 booked | One website organic job |
| A booked job has no intake match | J06 booked | One unknown-source job |
| Two sources disagree for L13 | J13 booked | One unknown-source job |
Prompt for your agent
Use these approved intake and CRM exports to report confirmed jobs for [cohorts and conversion window]. State the date and status policy. Join only on the shared opaque lead reference and count each distinct CRM job ID once. Preserve unknown sources and missing values. Report by source and period, and show the distinction between booked amount and cash collected. Return one check for data the owner can verify.
