Homepage View
Track when users visit your homepage.
When to use
Add this event to your homepage only.
Implementation
- JavaScript
- cURL
- Python
- PHP
<script type="text/javascript">
window._edrone = window._edrone || {};
_edrone.action_type = 'homepage_view';
</script>
curl -X POST https://api.edrone.me/trace \
-d "app_id=YOUR_APP_ID" \
-d "action_type=homepage_view" \
-d "sender_type=server"
import requests
response = requests.post('https://api.edrone.me/trace', data={
'app_id': 'YOUR_APP_ID',
'action_type': 'homepage_view',
'sender_type': 'server'
})
<?php
$data = http_build_query([
'app_id' => 'YOUR_APP_ID',
'action_type' => 'homepage_view',
'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);
curl_exec($ch);
curl_close($ch);
Required fields
| Field | Value |
|---|---|
action_type | homepage_view |
Optional fields
You can include user information if available:
_edrone.action_type = 'homepage_view';
_edrone.email = 'user@example.com'; // If user is logged in
_edrone.first_name = 'John';