Appearance
Amplitude Event Forwarding Adapter
Overview
The Amplitude Event Forwarding API allows you to send events directly to Amplitude for analytics. By making a simple HTTP POST request to our endpoint, you can track user interactions and other events in your application.
API Endpoint
- Endpoint:
POST /amplitude/events/track
- URL:
https://events.shopcircle.co/amplitude/events/track
- HEADERS: -
Content Type: application/json
shopcircle-api-key: YOUR_API_KEY
( replaceYOUR_API_KEY
with a valid key)
- HEADERS: -
**NOTE To get an API key ( if you don't have one already ) reach out to either Adel or **Admir**
Request Body Example
json
{
"apiKey": "YOUR_AMPLITUDE_API_KEY",
"secret": "YOUR_AMPLITUDE_SECRET_KEY",
"event": {
"user_id": "user123",
"event_type": "Product Viewed",
"properties": {
"product_id": "product123",
"category": "Electronics"
}
}
}
DANGER
Please not that Shoplytics API key and Amplitude API key do vary, so you need both.
Example cURL request
json
curl --location 'http://events.shopcircle.co/amplitude/events/track' \
--header 'shopcircle-api-key: sc_admir_sandbox_test' \
--header 'Content-Type: application/json' \
--data '{
"apiKey": "AMPLITUDE_APIKEY",
"secret": "AMPLITUDE_APISECRET",
"event": {
"user_id": "test_shoplytics_sc",
"event_type": "button_click",
"event_properties": {
"button_name": "signup"
}
}
}'
On a successful request, you will receive a JSON response indicating the success of the event submission:
json
{
"success": true,
"message": "Event sent successfully"
}
Error Response
If there is an error while sending the event, you will receive an error response:
json
{
"success": false,
"message": "Failed to send event to Amplitude: <error message>"
}