Event Create
Overview
The /reshape/standard/event
endpoint provides a universal API for sending complete event data to DATA Reshape for tracking and analysis. This endpoint supports all approved event types with comprehensive data objects, enabling server-side tracking for e-commerce platforms, CRM systems, and enterprise applications.
Endpoint Configuration
Request Details
- URL:
/reshape/standard/event
- Method:
POST
- Content-Type:
application/json
- Authentication: Required
Authentication Requirements
Headers
Content-Type
(required) - Must beapplication/json
X-Dre-Access-Token
(required) - Your secret access token
Query Parameters
id
(required) - Your script ID provided by DATA Reshape Team
Request Structure
{
"event": { /* Event object with name, value, currency, id */ },
"context": { /* API context with environment, data source, user agent */ },
"products": [ /* Product array for e-commerce events */ ],
"shipping": [ /* Shipping methods array */ ],
"payments": [ /* Payment methods array */ ],
"coupons": [ /* Discount coupons array */ ],
"user": { /* Customer data object */ },
"cookies": [ /* Platform cookies for attribution */ ]
}
Complete Reference
event object required
Core event object containing event identification, value, and properties. View complete Event Object documentation
name string required
Name of the event to be sent.
name: "event_name"
value number required
Event value in decimal format. Represent the final total order amount, including all costs and discounts.
value: 123.99
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-if-applicable
Event ID — required for transactions or any actions that require deduplication or uniqueness. Represents the unique identifier of a transaction, order, or lead. This can be the unique order, transaction, or action ID used in your system.
id: "UNIQUE_TRANSACTION_123"
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"
}
context object required
API context object containing environment, data source, and preserved user interaction data. View complete Context API Object documentation
environment string required
Allowed values: prod, dev
environment: "prod"
data_source string required
Recommended values:
- for website events: website
- for admin manual added orders events: phone or admin
- for app events: app
- for marketplace events : marketplace. (You can replace "marketplace" word with real marketplace name.)
data_source: "website"
user_agent string recommended
User-Agent string from a browser when the event occurs
user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"
overide_ip string recommended
Ip address. Support ipv4 or ipv6. Recommended ipv6 if exists.
overide_ip: "123.123.123.99"
url string recommended
URL of the page where the order was initiated
url:"https://shop.example.com/thankyou-page"
landing_url string recommended
URL of the page where the user has start session were event was initiated.
landing_url:"https://shop.example.com/landing-page?query=abc"
referring_url string recommended
URL of the external referring site
referring_url:"https://google.com"
products array required-if-applicable
Array of product objects for e-commerce events. Required for product-related events. View complete Product Object documentation
products[0] object required
id string required
Unique product identifier in your system.
id: "PRODUCT_ID"
parent_id string required
Parent product ID for variants or child products (can be same as id if no parent concept exists).
parent_id: "PRODUCT_PARENT_ID"
name string required
Product name or title displayed to users.
name: "PRODUCT_NAME"
parent_name string
Parent product name for variants or child products
parent_name: "PRODUCT_PARENT_NAME"
price_base number required
Original or base price before discounts (decimal format: 299.99)
price_base: 120.99
price number required
Current selling price after discounts (decimal format: 249.99)
price: 100.99
tax_included boolean required
Whether the price includes taxes (true/false)
tax_included: true
tax_percent number required
Tax percentage applied to the product (0-100)
tax_percent: 21
quantity number required
Quantity of this product in the context of the event
quantity: 1
category string required
Main product category name
category: "PRODUCT_MAIN_CATEGORY_NAME"
sku string
Product SKU (Stock Keeping Unit) for inventory tracking
sku: "PRODUCT_SKU"
parent_sku string
Parent product SKU for variants or child products
parent_sku: "PRODUCT_PARENT_SKU"
gtin string
Global Trade Item Number for product identification
gtin: "PRODUCT_GTIN"
mpn string
Manufacturer Part Number assigned by the manufacturer
mpn: "PRODUCT_MPN"
ean string
European Article Number for product barcoding
ean: "PRODUCT_EAN"
brand string
Product brand or manufacturer name
brand: "PRODUCT_BRAND"
type string
Product type: "simple", "variable", "virtual", "bundle", "subscription", "external".
Default: simple.
type: "simple"
stock_status boolean recommended
Product availability status (true = in stock, false = out of stock)
stock_status: true
stock_location string
Physical location or warehouse where product is stored
stock_location: "WAREHOUSE_NAME"
created_at string recommended
Timestamp when product was added to inventory (milliseconds)
created_at: 1754926521690
url string
Direct URL to the product page
url: "https://shop.example.com/products/laptop-page"
parent_url string
URL to the parent product page (for variants)
parent_url: "https://shop.example.com/products/laptop-page"
image string
Main product image URL
image: "https://cdn.example.com/products/laptop-image.jpg"
images array
Array of additional product image URLs
images: [
"https://cdn.example.com/products/laptop-image-1.jpg",
"https://cdn.example.com/products/laptop-image-2.jpg",
]
categories array
Array of category objects with name and id properties
- name (string, required) - Category name
- id (string) - Category identifier
categories: [
{
name: "PRODUCT_FIRST_CATEGORY_NAME",
id: "1111"
},
{
name: "PRODUCT_SECOND_CATEGORY_NAME",
id: "1111"
}
]
coupons array
Array of product-level coupons applied to this product. View complete Coupon Object documentation
coupons[0] (object) - required
required
name string required
Coupon name or code.
name: "FREE SHIPPING"
value number recommended
Coupon discount value.
value: 123.99
tax_included boolean recommended
Whether coupon value includes taxes
tax_included: true
tax_precent string recommended
Tax percentage for the coupon
tax_precent: 21
id string
Coupon internal identifier.
id: "COUPON_INTERNAL_ID"
type string
Coupon type (e.g., "LOYALTY", "SEASONAL", "FIRST_ORDER")
type: "SHIPPING"
currency string required-if-applicable
Currency code. Specifies the currency code when it differs from event.currency.
currency: "USD"
exchange_rate number
Custom exchange rate for multi-currency. Default has value 1. Specifies when it differs from event.exchange_rate.
exchange_rate: 1
properties object recommended
Custom product attributes for audience segmentation. Use custom properties that match your product catalog and business needs.
- color (string|array) - Product color(s): "blue" or ["blue", "navy"]
- size (string) - Product size: "S", "M", "L", "XL"
- material (string|array) - Product material(s): "cotton" or ["cotton", "polyester"]
- connectivity (string|array) - Connection types: "wireless" or ["wifi", "bluetooth"]
- storage (string) - Storage capacity: "256GB", "512GB"
- dimensions (string) - Physical dimensions: "120x60x75cm"
Use the properties
object to store custom product attributes, with property names defined by each business as needed, that enable advanced segmentation, personalization, and analytics across your marketing campaigns.
- IT & C
- Fashion
- Deco
properties: {
color: "space_gray",
storage: "256GB",
memory: "16GB",
connectivity: ["wifi", "bluetooth"],
warranty: "2_years",
energy_rating: "A++",
brand_series: "pro_line"
}
properties: {
color: ["black", "white"],
size: "M",
material: "cotton",
fit: "regular",
season: "summer",
collection: "2024_spring",
care_instructions: "machine_wash"
}
properties: {
color: ["natural", "oak"],
dimensions: "120x80x75cm",
material: ["wood", "metal"],
style: "modern",
room_type: ["living_room", "office"],
assembly_required: "true"
}
currency string required-if-applicable
Currency code. Specifies the currency code when it differs from event.currency.
currency: "USD"
exchange_rate number
Custom exchange rate for multi-currency. Default has value 1. Specifies when it differs from event.exchange_rate.
exchange_rate: 1
shipping array required-if-applicable
Array of shipping methods for checkout and order events. View complete Shipping Object documentation
shipping[0] object required
name string recommended
Shipping method name
name: "SHIPPING_NAME"
value number required
Shipping cost value
value: 12.99
tax_included boolean recommended
Whether shipping cost includes taxes
tax_included: true
tax_percent number recommended
Tax percentage for shipping (0-100)
tax_percent: 21
id string|number
Shipping method identifier.
id: "SHIPPING_INTERNAL_ID"
type string
Shipping type (e.g., "standard", "express", "next_day")
type: "standard"
currency string required-if-applicable
Currency code. Specifies the currency code when it differs from event.currency.
currency: "USD"
exchange_rate number
Custom exchange rate for multi-currency. Default has value 1. Specifies when it differs from event.exchange_rate.
exchange_rate: 1
payments array required-if-applicable
Array of payment methods for transaction events. View complete Payment Object documentation
payments[0] object required
name string recommended
Payment method name.
name: "PAYMENT_NAME"
value number required
Amount paid with this payment method
value: 12.99
id string
Payment method internal identifier
id: "PAYMENT_INTERNAL_ID"
type string
Payment type (e.g., "card", "paypal", "bank_transfer", "gift_card")
type: "PAYMENT_TYPE"
coupons array required-if-applicable
Array of discount coupons applied to the transaction. View complete Coupon Object documentation
coupons[0] object required
name string required
Coupon name or code.
name: "FREE SHIPPING"
value number recommended
Coupon discount value.
value: 123.99
tax_included boolean recommended
Whether coupon value includes taxes
tax_included: true
tax_precent string recommended
Tax percentage for the coupon
tax_precent: 21
id string
Coupon internal identifier.
id: "COUPON_INTERNAL_ID"
type string
Coupon type (e.g., "LOYALTY", "SEASONAL", "FIRST_ORDER")
type: "SHIPPING"
currency string required-if-applicable
Currency code. Specifies the currency code when it differs from event.currency.
currency: "USD"
exchange_rate number
Custom exchange rate for multi-currency. Default has value 1. Specifies when it differs from event.exchange_rate.
exchange_rate: 1
user object recommended
Customer data object for user identification and analytics. View complete User Object documentation
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"
}
cookies array recommended
Array of platform cookies for attribution and tracking. View complete Cookie API Object documentation
cookies[0] object required
name string required
Cookie name.
name: "cookie_name"
value string required
Cookie value.
value: "cookie_value"
Event Examples
These examples demonstrate complete data object structures for key events. Each example includes both full implementation and minimal required fields.
- Complete All Fields
- Checkout Completed
- Order Canceled
- Lead Created
- Lead Qualified
- Lead Closed
Complete Example with All Possible Fields
{
"event": {
"name": "checkout_completed",
"value": 2399.96,
"currency": "USD",
"exchange_rate": 1,
"id": "ORDER_SUCCESS_789456",
"properties": {
"payment_method": "credit_card",
"shipping_method": "express",
"checkout_duration_seconds": 420,
"newsletter_subscription": true,
"gift_message_added": false
}
},
"context": {
"environment": "prod",
"data_source": "website",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"overide_ip": "185.120.45.123",
"url": "https://shop.example.com/checkout/success",
"landing_url": "https://shop.example.com/electronics/professional?utm_source=google&utm_medium=cpc&utm_campaign=pro_cameras",
"referring_url": "https://google.com/search?q=professional+cameras"
},
"products": [
{
"id": "DSLR_CAMERA_PRO_001",
"parent_id": "DSLR_CAMERA_PRO_SERIES",
"sku": "DSLR-PRO-24MP-001",
"parent_sku": "DSLR-PRO-24MP",
"gtin": "2468135790864",
"mpn": "DSLR-PRO-2024-001",
"ean": "2468135790864",
"name": "Professional DSLR Camera 24.2MP",
"parent_name": "Professional DSLR Camera Series",
"brand": "PhotoMaster",
"type": "simple",
"price_base": 1599.99,
"price": 1399.99,
"currency": "USD",
"exchange_rate": 1,
"tax_included": true,
"tax_percent": 8.25,
"quantity": 1,
"stock_status": true,
"stock_location": "Professional Equipment Warehouse",
"created_at": 1748505040077,
"url": "https://shop.example.com/dslr-camera-professional-24mp",
"parent_url": "https://shop.example.com/dslr-cameras-professional",
"image_url": "https://cdn.example.com/images/dslr-pro-001.jpg",
"category": "Electronics > Cameras > DSLR",
"description": "Professional grade DSLR camera with 24.2MP sensor",
"tags": ["professional", "photography", "dslr", "24mp"],
"properties": {
"sensor_type": "APS-C",
"megapixels": 24.2,
"video_resolution": "4K",
"warranty_years": 2,
"model_year": 2024
}
},
{
"id": "LENS_ZOOM_75_300",
"sku": "LENS-ZOOM-75-300",
"name": "Telephoto Zoom Lens 75-300mm",
"brand": "PhotoMaster",
"type": "simple",
"price_base": 499.99,
"price": 449.99,
"currency": "USD",
"tax_included": true,
"tax_percent": 8.25,
"quantity": 1,
"category": "Electronics > Camera Accessories > Lenses"
}
],
"shipping": [
{
"name": "Express Delivery",
"value": 24.99,
"currency": "USD",
"exchange_rate": 1,
"tax_included": true,
"tax_percent": 8.25,
"type": "express"
}
],
"payments": [
{
"name": "Credit Card - Visa",
"value": 2399.96,
"currency": "USD",
"exchange_rate": 1,
"type": "card"
}
],
"coupons": [
{
"name": "WELCOME25",
"value": 400.00,
"currency": "USD",
"exchange_rate": 1,
"tax_included": true,
"tax_percent": 8.25,
"type": "WELCOME",
"code": "WELCOME25"
}
],
"user": {
"id": "CUST_12345",
"external_id": "EXT_USER_67890",
"email": ["[email protected]", "[email protected]"],
"phone": ["+1555123456", "+1555987654"],
"first_name": "John",
"last_name": "Doe",
"country": "United States",
"region": "California",
"city": "San Francisco",
"street": "123 Market Street, Apt 4B",
"postal_code": "94105",
"orders_total_number": 3,
"orders_canceled_number": 0,
"orders_total_value": 3567.89,
"predicted_value": 5000.00,
"created_at": 1640995200000,
"properties": {
"customer_segment": "loyal",
"acquisition_channel": "paid_search",
"preferred_categories": "electronics",
"loyalty_tier": "gold",
"marketing_consent": true
}
},
"cookies": [
{
"name": "_ga",
"value": "GA1.2.123456789.1640995200"
},
{
"name": "_fbp",
"value": "fb.1.1640995200.123456789"
}
]
}
Complete Example
{
"event": {
"name": "checkout_completed",
"value": 1299.97,
"currency": "EUR",
"exchange_rate": 1,
"id": "ORDER_SUCCESS_789456",
"properties": {
"payment_method": "credit_card",
"shipping_method": "express",
"checkout_duration_seconds": 420,
"newsletter_subscription": true,
"gift_message_added": false
}
},
"context": {
"environment": "prod",
"data_source": "website",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"overide_ip": "185.120.45.123",
"url": "https://shop.example.com/checkout/success"
},
"products": [
{
"id": "LAPTOP_PRO_001",
"sku": "LP-PRO-15-2024",
"name": "Gaming Laptop Pro 15\"",
"brand": "TechGaming",
"type": "simple",
"price_base": 1399.99,
"price": 1199.99,
"currency": "EUR",
"tax_included": true,
"quantity": 1,
"category": "Electronics"
}
],
"shipping": [
{
"name": "Express Delivery",
"value": 24.99,
"currency": "EUR",
"tax_included": true,
"type": "express"
}
],
"payments": [
{
"name": "Credit Card - Visa",
"value": 1299.97,
"currency": "EUR",
"type": "card"
}
],
"coupons": [
{
"name": "WELCOME25",
"value": 300.00,
"currency": "EUR",
"type": "WELCOME"
}
],
"user": {
"id": "CUST_12345",
"email": ["[email protected]"],
"phone": ["+40712345678"],
"first_name": "John",
"last_name": "Doe",
"country": "Romania",
"city": "Bucuresti"
}
}
Minimal Required Example
{
"event": {
"name": "checkout_completed",
"value": 1299.97,
"currency": "EUR",
"id": "ORDER_SUCCESS_789456"
},
"context": {
"environment": "prod",
"data_source": "website"
}
}
Complete Example
{
"event": {
"name": "order_canceled",
"value": 0,
"currency": "USD",
"id": "ORDER_CANCEL_567890",
"properties": {
"cancellation_reason": "customer_request",
"refund_amount": 299.99,
"cancellation_source": "customer_portal",
"order_age_hours": 6,
"customer_service_involved": false
}
},
"context": {
"environment": "prod",
"data_source": "admin",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36",
"overide_ip": "192.168.1.100",
"url": "https://admin.example.com/orders/cancel"
},
"user": {
"id": "CUST_67890",
"email": ["[email protected]"],
"phone": ["+1555123456"],
"first_name": "Jane",
"last_name": "Smith",
"country": "United States"
}
}
Minimal Required Example
{
"event": {
"name": "order_canceled",
"id": "ORDER_CANCEL_567890"
},
"context": {
"environment": "prod"
}
}
Complete Example
{
"event": {
"name": "lead_created",
"value": 250.00,
"currency": "EUR",
"id": "LEAD_CONTACT_890",
"properties": {
"lead_source": "contact_form",
"lead_quality_score": 85,
"consultation_requested": true,
"budget_disclosed": true,
"decision_maker": true
}
},
"context": {
"environment": "prod",
"data_source": "website",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36",
"overide_ip": "185.120.45.123",
"url": "https://example.com/contact/web-development"
},
"user": {
"email": ["[email protected]"],
"phone": ["+40712345678"],
"first_name": "John",
"last_name": "Doe",
"country": "Romania",
"region": "Bucuresti",
"city": "Bucuresti",
"predicted_value": 2500.00,
"created_at": 1754926521690,
"properties": {
"job_title": "Marketing Manager",
"company_industry": "software_development",
"contact_preference": "email"
}
}
}
Minimal Required Example
{
"event": {
"name": "lead_created",
"id": "LEAD_CONTACT_890"
},
"context": {
"environment": "prod",
"data_source": "website"
}
}
Complete Example
{
"event": {
"name": "lead_qualified",
"value": 1500.00,
"currency": "USD",
"id": "LEAD_QUALIFIED_123",
"properties": {
"qualification_method": "score_threshold",
"lead_score": 95,
"qualification_criteria_met": "budget_timeline_authority",
"sales_rep_assigned": "sarah_johnson",
"follow_up_scheduled": true
}
},
"context": {
"environment": "prod",
"data_source": "crm",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"overide_ip": "203.45.67.89",
"url": "https://crm.example.com/leads/qualify"
},
"user": {
"id": "LEAD_USER_456",
"email": ["[email protected]"],
"phone": ["+1555987654"],
"first_name": "Michael",
"last_name": "Thompson",
"country": "United States",
"region": "California",
"predicted_value": 8500.00,
"properties": {
"company": "TechCorp Solutions",
"job_title": "CTO",
"company_size": "100-500",
"industry": "technology",
"budget_range": "50k-100k"
}
}
}
Minimal Required Example
{
"event": {
"name": "lead_qualified",
"id": "LEAD_QUALIFIED_123"
},
"context": {
"environment": "prod",
"data_source": "crm"
}
}
Complete Example
{
"event": {
"name": "lead_closed",
"value": 4500.00,
"currency": "USD",
"id": "LEAD_CLOSED_456",
"properties": {
"closure_reason": "won",
"sales_cycle_days": 45,
"contract_type": "annual",
"deal_size": "enterprise",
"competitor_displaced": "none"
}
},
"context": {
"environment": "prod",
"data_source": "crm",
"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/close"
},
"user": {
"id": "CUSTOMER_789",
"email": ["[email protected]"],
"phone": ["+1555246810"],
"first_name": "Robert",
"last_name": "Wilson",
"country": "United States",
"region": "New York",
"orders_total_value": 4500.00,
"created_at": 1740000000000,
"properties": {
"company": "Enterprise Corp",
"job_title": "VP of Technology",
"company_size": "1000+",
"industry": "finance",
"contract_duration": "12_months"
}
}
}
Minimal Required Example
{
"event": {
"name": "lead_closed",
"id": "LEAD_CLOSED_456"
},
"context": {
"environment": "prod",
"data_source": "crm"
}
}
Response Format
Success Response
{
"status": "success",
"message": "Event processed successfully"
}
Error Response
{
"status": "error",
"message": "Invalid event data",
"errors": [
{
"field": "event.name",
"code": "REQUIRED_FIELD_MISSING",
"message": "Event name is required"
}
]
}
Implementation Notes
Best Practices
- Event Validation: Always validate event data before sending to ensure required fields are present
- Unique IDs: Use consistent, unique identifiers for events to prevent duplicate tracking
- Value Calculation: Ensure event values accurately represent business metrics
- Properties Limit: Keep custom properties focused and limit to 5 key properties for optimal performance
- Currency Consistency: Use consistent currency codes across related events
Error Handling
Handle API responses appropriately:
fetch('/reshape/standard/event?id=YOUR_SCRIPT_ID', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Dre-Access-Token': 'YOUR_ACCESS_TOKEN'
},
body: JSON.stringify(eventData)
})
.then(response => response.json())
.then(data => {
if (data.status === 'success') {
console.log('Event tracked successfully:', data.message);
} else {
console.error('Event tracking failed:', data.errors);
}
})
.catch(error => {
console.error('Network error:', error);
});
Support
For technical support and integration assistance:
- Email: [email protected]