Why track WooCommerce profile updates?
When a customer updates their profile on your WooCommerce store, you might want to know right away.
Real-time alerts help you monitor user activity and improve support.
Tracking events with Operational
Operational is an open-source event tracking tool for any tech product. You can send events when users change their data and get instant notifications.
Setting up Operational
- Sign up at app.operational.co.
- Create a new project for your WooCommerce store.
- Copy your API key from the project settings.
- Keep your API key handy for your PHP code.
Code example: Sending profile update events in PHP
<?php
$apiKey = 'YOUR_API_KEY';
$payload = [
'name' => 'User profile updated',
'avatar' => '🔔',
'content' => 'Customer Jane Doe updated her address',
'properties' => [
'user_id' => 456,
'email' => 'jane.doe@example.com'
]
];
$ch = curl_init('https://api.operational.co/v1/events');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
This PHP snippet sends a profile update event to Operational with user details.
Conclusion
Operational saves you time by handling event tracking and notifications. You can learn more at https://operational.co Try the playground for ready-made snippets: https://operational.co/playground