Step 6: Update the CRM and marketing systems
Once the policy engine accepts the submission as a valid sales lead, it can create the downstream signals.
CRM
The CRM record can store fields such as:
lead_classification: sales_lead
classification_method: ai_realtime
classification_model_version: [internal version]
classification_reason: explicit_service_interest
classification_timestamp: [timestamp]
review_status: not_required
These fields provide operational context and make later quality analysis possible. A sales representative can still correct the status. That correction becomes valuable evaluation data for the classifier.
GA4
The server can send a validated event such as generate_lead or a carefully named custom event using GA4 Measurement Protocol. For a web stream, the request uses the measurement ID and API secret, while the payload uses the website’s client_id. Parameters such as session_id and engagement_time_msec affect how the activity appears in reporting. Google also recommends that events intended to join client-side activity arrive within 48 hours of the original event. See the current GA4 Measurement Protocol sending guide and protocol reference.
Only analytics-safe fields should be included. A useful payload may contain the classification method, form type and lead category. It should exclude the person’s name, email, phone number and message.
Advertising platforms
Each advertising platform has its own conversion requirements. A validated GA4 event can be imported into Google Ads, or the implementation can use a platform’s server-side conversion mechanism where appropriate.
Sending the event is one part of the setup. The conversion action must also be configured as the campaign’s optimization goal before automated bidding uses it as a primary signal.
The original form submission may still be recorded internally as a separate operational event. The validated lead event should represent the outcome the advertising system is expected to optimize toward.
Step 7: Design the failure paths
A production architecture needs explicit outcomes for every dependency.
|
Failure
|
Recommended response
|
| AI request times out |
Keep submission, mark classification as pending, retry through a queue |
| Provider returns an error |
Log the error, retry with limits, send to review if retries fail |
| Output does not pass schema validation |
Reject the classification result and retry or review |
Result is uncertain |
Queue for human review and withhold the validated conversion |
| CRM update fails |
Retain the classification and retry the CRM operation |
| GA4 request fails |
Retry according to the integration policy and preserve an idempotency record |
| Duplicate form request arrives |
Use the submission ID to prevent duplicate leads and conversion events |
Idempotency is especially important. A retry should complete the missing operation without creating a second CRM record or a second conversion.
The system should therefore store the state of each destination separately:
submission_saved: true
classification_complete: true
crm_synced: true
ga4_event_sent: false
ads_event_sent: false
This is more reliable than a single status such as complete, because it shows exactly where the workflow stopped.
Step 8: Test the classifier before it controls conversions
Begin with a labelled set of historical submissions. Each example should have a business-approved category.
Test the architecture on:
- clear sales enquiries;
- vague messages;
- existing-customer support requests;
- job applications;
- agency and vendor pitches;
- guest-post requests;
- multilingual submissions;
- obvious and subtle spam;
- messages containing prompt-injection instructions;
- messages that combine two intents.
Measure the results by class, because overall accuracy can hide the error that matters most. A classifier can appear accurate when spam represents most of the sample while still rejecting valuable sales enquiries.
For conversion tracking, two measures are especially useful:
- Sales-lead precision: Of all submissions classified as
sales_lead, how many were genuine sales enquiries?
- Sales-lead recall: Of all genuine sales enquiries, how many did the classifier identify?
A false positive pollutes campaign optimization. A false negative can hide a real lead from measurement or routing. The business should decide which risk deserves stricter controls.
A sensible rollout can run the classifier in observation mode first. Record what it would have decided, compare those decisions with human outcomes and activate automated routing only after the results meet agreed thresholds.
0 Comments