Send your first event
Now that tracking is installed, let's send a product view event - the most common tracking event.
Understanding events
Events tell edrone what users are doing on your store. Each event has:
action_type- what happened (e.g.,product_view,add_to_cart,order)- Data fields - details about the action (product info, user info, etc.)
Product View event
Add this code to your product pages:
- JavaScript
- cURL (Backend)
- Python
- PHP
window._edrone = window._edrone || {};
_edrone.action_type = 'product_view';
_edrone.product_ids = '12345';
_edrone.product_titles = 'Nike Air Max 90';
_edrone.product_images = 'https://yourstore.com/images/nike-air-max.jpg';
_edrone.product_urls = 'https://yourstore.com/products/nike-air-max-90';
_edrone.product_category_ids = '1~2~3';
_edrone.product_category_names = 'Shoes~Sneakers~Nike';
curl -X POST https://api.edrone.me/trace \
-d "app_id=YOUR_APP_ID" \
-d "action_type=product_view" \
-d "product_ids=12345" \
-d "product_titles=Nike Air Max 90" \
-d "product_images=https://yourstore.com/images/nike-air-max.jpg" \
-d "product_urls=https://yourstore.com/products/nike-air-max-90" \
-d "product_category_ids=1~2~3" \
-d "product_category_names=Shoes~Sneakers~Nike" \
-d "sender_type=server"
import requests
response = requests.post('https://api.edrone.me/trace', data={
'app_id': 'YOUR_APP_ID',
'action_type': 'product_view',
'product_ids': '12345',
'product_titles': 'Nike Air Max 90',
'product_images': 'https://yourstore.com/images/nike-air-max.jpg',
'product_urls': 'https://yourstore.com/products/nike-air-max-90',
'product_category_ids': '1~2~3',
'product_category_names': 'Shoes~Sneakers~Nike',
'sender_type': 'server'
})
<?php
$data = http_build_query([
'app_id' => 'YOUR_APP_ID',
'action_type' => 'product_view',
'product_ids' => '12345',
'product_titles' => 'Nike Air Max 90',
'product_images' => 'https://yourstore.com/images/nike-air-max.jpg',
'product_urls' => 'https://yourstore.com/products/nike-air-max-90',
'product_category_ids' => '1~2~3',
'product_category_names' => 'Shoes~Sneakers~Nike',
'sender_type' => 'server'
]);
$ch = curl_init('https://api.edrone.me/trace');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
URL Encoding
If your product titles, URLs, or category names contain special characters (spaces, quotes, etc.), use encodeURIComponent() in JavaScript:
_edrone.product_titles = encodeURIComponent("Women's Summer Dress");
See URL Encoding for details.
Required fields
| Field | Description | Example |
|---|---|---|
product_ids | Unique product identifier | 12345 |
product_titles | Product name | Nike Air Max 90 |
product_images | Full URL to product image | https://... |
product_urls | Full URL to product page | https://... |
product_category_ids | Category IDs (use ~ separator) | 1~2~3 |
product_category_names | Category names (use ~ separator) | Shoes~Sneakers~Nike |
Separators explained
edrone uses special characters to separate multiple values:
| Separator | Use case | Example |
|---|---|---|
~ | Category hierarchy | Shoes~Sneakers~Nike |
| | Multiple products | 12345|67890 |
Verify your event
- Open your product page
- Open Developer Tools → Network tab
- Look for a request to
api.edrone.me/trace - Check that the response status is
200 OK
Common events
| Event | When to send | Page |
|---|---|---|
homepage_view | User visits homepage | Homepage |
product_view | User views a product | Product page |
category_view | User browses a category | Category page |
add_to_cart | User adds product to cart | Product/Cart page |
order | User completes purchase | Thank you page |
subscribe | User subscribes to newsletter | Any page with form |
Next steps
- Frontend Integration Guide - Implement all tracking events
- API Reference - Complete list of fields and events
- Backend Integration - Server-side tracking