Lead Closed
When to Use
The lead_closed
event should be triggered when qualified leads successfully convert to customers through completed sales processes, enabling accurate conversion tracking and sales performance measurement.
Contract Signing
When leads complete contract negotiations and sign service agreements, licensing deals, or partnership contracts.
Purchase Completion
When leads complete purchase transactions for products or services, whether through online checkout or offline sales processes.
Subscription Activation
When leads convert to paying subscribers by completing subscription sign-ups, trial-to-paid conversions, or plan upgrades.
Proposal Acceptance
When leads formally accept project proposals, custom quotes, or service agreements after negotiation processes.
Deal Closure
When sales representatives successfully close opportunities in CRM systems, marking the end of the sales cycle and beginning of customer relationship.
Complete Reference
event object required
name string required
Use only static value lead_closed for `event.name'.
name: "lead_closed"
value number required
Event value in decimal format.
Represent the actual revenue value generated from the closed lead/converted customer.
value: 2500.00
currency string required
Currency code that specifies the currency in which all monetary values from any object associated with this event are expressed.
Note: This value can be overridden in nested objects if they contain their own value
key with a currency specified.
currency: "USD"
exchange_rate number
Custom exchange rate for multi-currency. Default has value 1.
Note: This value can be overridden in nested objects if they contain their own value key with a currency specified.
exchange_rate: 1
id string required
Event ID — required for any actions that require deduplication or uniqueness. Represents the unique identifier of an action ID used in your system.
id: "UNIQUE_CLOSED_LEAD_ID_123"
context object
Use only if exists new data. View complete Context Object documentation
url string required-if-applicable
Complete URL of the current page including all parameters
SPA Applications: context.url
is particularly valuable for Single Page Applications where URL changes don’t automatically trigger page context updates. Manual implementation ensures accurate tracking of page transitions and user navigation within SPA frameworks.
url:"https://shop.example.com/products/laptop?color=silver&storage=512gb&utm_source=google"
URL Parameter Sensitivity: Be mindful of sensitive information in URLs. Query parameters may contain personal identifiers, session tokens, or private information that should be handled according to privacy regulations.
page_type string recommended
Type of page (product, home ...)
page_type: "product"
environment string recommended
Allowed values: prod, dev
environment: "prod"
user object recommended
id string recommended
Unique customer identifier in your system.
id: "CUSTOMER_INTERNAL_ID"
email string|array recommended
Customer email address(es) provided in plaintext or as SHA-256 hashed values.
email: "[email protected]"
// or
email: ["[email protected]", "[email protected]"]
// or
email: ["3e1ufd1rdnh8l1rfz6xlreyw2yryd4zrf8zsk1pxh2x8wbsp2mw1g93rs5nx68dq"]
phone string|array recommended
Customer phone number(s) in E.164 format (plaintext) or as SHA-256 hashed values.
phone: "+40712345678"
// or
phone: ["+40712345678", "+4079876543"]
// or
phone: ["unw5r66oikql4n4tlg2c54bkd2npephsbwwhxuoxreu6ph8uv6k424y9x15opy9y"]
first_name string recommended
Customer first name
first_name: "John"
last_name string recommended
Customer last name
last_name: "Doe"
country string
Country name or ISO country code
country: "Romania"
region string recommended
State, province, or region name
region: "Bucuresti"
city string recommended
City or locality name
city: "Bucuresti"
street string
Street address including number
street: "Strada Principala 1"
postal_code string
Postal code or ZIP code
postal_code: "700000"
orders_total_number number recommended
Cumulative number of orders placed by this user
orders_total_number: 5
orders_canceled_number number recommended
Cumulative number of orders placed and canceled by this user
orders_canceled_number: 0
orders_total_value number recommended
Cumulative lifetime user orders value (decimal format: 2500.50)
orders_total_value: 1234.99
orders_refunded_value number recommended
Cumulative lifetime user orders value canceled (decimal format: 2500.50)
orders_refunded_value: 250.99
predicted_value number
Predicted lifetime value of a customer for your business
predicted_value: 100.99
created_at number recommended
Timestamp in milliseconds since Unix epoch representing the first time the user was recorded
created_at: 1754926521690
properties object recommended
Custom Customer Properties Examples
Use the properties
object to store custom user attributes, with property names defined by each business as needed, that enable advanced segmentation, personalization, and analytics across your marketing campaigns.
- E-commerce Customer
- B2B Lead/Customer
- Subscription Service
- Content Platform
properties: {
customer_type: "returning",
membership_level: "platinum",
preferred_category: ["electronics", "fashion"],
last_purchase_date: "2024-12-15",
average_order_value: "350.00",
payment_method_preference: "card",
registration_date: "2023-06-15"
}
properties: {
company_size: "enterprise",
industry: "fintech",
job_title: "marketing_director",
decision_maker: "true",
budget_range: "50000-100000",
lead_source: ["linkedin", "webinar"],
qualification_status: "qualified",
sales_stage: "proposal"
}
properties: {
subscription_tier: "premium",
billing_cycle: "annual",
feature_usage: ["analytics", "reporting", "api"],
trial_user: "false",
renewal_date: "2025-06-30",
support_level: "priority",
usage_frequency: "daily"
}
properties: {
content_preferences: ["technology", "business"],
engagement_level: "high",
newsletter_subscriber: "true",
social_media_follower: "true",
content_consumption: "premium",
device_preference: ["mobile", "desktop"],
timezone: "Europe/Bucharest"
}
properties object recommended
Custom Event Properties Examples
- Order canceled
- B2B Lead
- Subscription Service
properties: {
cancel_reason: "returning",
}
properties: {
lead_status: "converted",
sales_stage: "proposal"
}
properties: {
subscription_tier: "premium",
billing_cycle: "annual",
trial_user: "false",
renewal_date: "2025-06-30",
support_level: "priority",
usage_frequency: "daily"
}
Object Examples
These examples demonstrate the complete data object structure for the lead_closed
event. Use the complete example for detailed implementations or the minimal example for quick integrations.
- Complete Example
- Minimal Example
{
"event": {
"name": "lead_closed",
"value": 15000.00,
"currency": "USD",
"exchange_rate": 1,
"id": "CLOSED_LEAD_SUCCESS_987",
"properties": {
"closure_method": "contract_signing",
"sales_cycle_days": 45,
"total_touchpoints": 28,
"meetings_conducted": 6,
"proposals_sent": 2,
"discount_applied_percent": 10,
"payment_terms": "net_30",
"contract_duration_months": 12,
"upsell_opportunities_identified": 3,
"customer_onboarding_scheduled": true
}
},
"context": {
"environment": "prod",
"data_source": "crm_system",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36",
"overide_ip": "172.16.254.1",
"url": "https://crm.example.com/deals/closed",
"landing_url": "https://example.com/enterprise-demo",
"referring_url": "https://google.com/search"
},
"user": {
"id": "CUSTOMER_987654",
"email": ["[email protected]"],
"phone": ["+1555333444"],
"first_name": "Jennifer",
"last_name": "Martinez",
"country": "United States",
"region": "Texas",
"city": "Austin",
"street": "321 Enterprise Blvd, Suite 500",
"postal_code": "78701",
"properties": {
"job_title": "Chief Technology Officer",
"company_industry": "financial_services",
"company_size": "1000+",
"annual_revenue": "100M+",
"decision_maker": true,
"budget_authority": true,
"preferred_language": "en",
"lead_source": "referral",
"customer_status": "active",
"account_tier": "enterprise"
}
}
}
{
"event": {
"name": "lead_closed",
"value": 1200.00,
"currency": "USD",
"id": "CLOSED_MIN_321"
},
"context": {
"environment": "prod",
"data_source": "website"
},
"user": {
"email": ["[email protected]"],
"first_name": "Robert",
"last_name": "Taylor"
}
}
Implementation Methods
These examples show how to send the data objects using different implementation approaches. Choose the method that best fits your technical setup.
- JavaScript Implementation
- API Implementation
// Web tracking implementation
window.reshape = window.reshape || [];
// Send the complete data object
reshape.push({
"event": {
"name": "lead_closed",
"value": 15000.00,
"currency": "USD",
"id": "CLOSED_LEAD_SUCCESS_987"
},
"context": {
"environment": "prod",
"data_source": "crm_system"
},
"user": {
"email": "[email protected]",
"new_customer": false,
"customer_lifetime": 15000.00
}
});
# Define the JSON body as a variable
BODY_JSON='{
"event": {
"name": "lead_closed",
"value": 15000.00,
"currency": "USD",
"id": "CLOSED_LEAD_SUCCESS_987"
},
"context": {
"environment": "prod",
"data_source": "crm_system"
},
"user": {
"email": "[email protected]",
"new_customer": false,
"customer_lifetime": 15000.00
}
}'
# Send the request using curl
curl -X POST "https://dre2.yourdomain.com/reshape/standard/event?id=YOUR_SCRIPT_ID" \
-H "Content-Type: application/json" \
-H "X-Dre-Access-Token: YOUR_ACCESS_TOKEN" \
-d "$BODY_JSON"