A 5-minute guide to getting started with the Measurely API.
This guide will help you:
Navigate to the Metrics section in the Measurely dashboard.
Here, you'll have the option to select between a Basic Metric or a Dual Metric. Choose Basic Metric.
Provide a name for your metric (e.g., "Sales Count").
To send data to this metric, integrate your Measurely API KEY into your project.
To update a metric value:
Make a POST request to the endpoint:
POST https://api.measurely.dev/event/{API_KEY}/{METRIC_ID}
Include a JSON body with the value you want to add or remove:
{
"value": 100
}
export const updateMetric = async (API_KEY, METRIC_ID, value) => {
const response = await fetch(
`https://api.measurely.dev/event/${API_KEY}/${METRIC_ID}`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ value: value }),
},
);
return response.status;
};