Goals

GET https://analytics.odexxai.com/api/goals/
curl --request GET \
--url 'https://analytics.odexxai.com/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
Parameters Details Description
website_id Optional Integer
type Optional String Allowed values: pageview, custom, scroll, scroll_element, click_element, webhook
search Optional String The search string.
search_by Optional String What field are you searching by. Allowed values are: name, path, key.
datetime_field Optional String Allowed values: datetime, last_datetime
datetime_start Optional String Filter results starting from this datetime. Y-m-d H:i:s format.
datetime_end Optional String Filter results up to this datetime. Y-m-d H:i:s format.
order_by Optional String What field to order the results by. Allowed values are: goal_id, last_datetime, datetime, name, path, key, scroll_percentage.
order_type Optional String The ordering of the results. Allowed values are: ASC for ascending ordering, and DESC for descending ordering.
page Optional Integer The page number that you want results from. Defaults to 1.
results_per_page Optional Integer How many results you want per page. Allowed values are: 10, 25, 50, 100, 250, 500, 1000. Defaults to 25.
{
    "data": [
        {
            "id": 1,
            "website_id": 1,
            "user_id": 1,
            "key": "123456789",
            "type": "custom",
            "path": null,
            "scroll_percentage": null,
            "scroll_selector": null,
            "click_selector": null,
            "value": null,
            "webhook_url": null,
            "name": "Example",
            "last_datetime": null,
            "datetime": "2026-10-15 04:38:51"
        }
    ],
    "meta": {
        "page": 1,
        "total_pages": 1,
        "results_per_page": 25,
        "total_results": 1
    },
    "links": {
        "first": "https://analytics.odexxai.com/api/goals?page=1",
        "last": "https://analytics.odexxai.com/api/goals?page=1",
        "next": null,
        "prev": null,
        "self": "https://analytics.odexxai.com/api/goals?page=1"
    }
}
GET https://analytics.odexxai.com/api/goals/{goal_id}
curl --request GET \
--url 'https://analytics.odexxai.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
{
    "data": {
        "id": 1,
        "website_id": 1,
        "user_id": 1,
        "key": "123456789",
        "type": "custom",
        "path": null,
        "scroll_percentage": null,
        "scroll_selector": null,
        "click_selector": null,
        "value": null,
        "webhook_url": null,
        "name": "Example",
        "last_datetime": null,
        "datetime": "2026-10-15 04:38:51"
    }
}
POST https://analytics.odexxai.com/api/goals
Parameters Details Description
website_id Required Integer -
type Required String Allowed values: pageview, custom, scroll, scroll_element, click_element, webhook
name Required String -
path Optional String Available when: type = pageview, scroll, scroll_element, click_element
scroll_percentage Optional Integer Available when: type = scroll
scroll_selector Required String Available when: type = scroll_element. The goal converts when the first matching element enters the viewport, including when already in view on page load. Enter a valid CSS selector with up to 1024 characters.
click_selector Required String Available when: type = click_element. The goal converts when a visitor clicks any matching element, including an icon or text inside it. Enter a valid CSS selector with up to 1024 characters.
value Optional Float Optional amount saved with each new conversion. Leave empty to track conversions without a value. Use the same unit or currency across this website. Enter a nonnegative value below 10000000000000 with up to 2 decimal places.
key Optional String -
curl --request POST \
--url 'https://analytics.odexxai.com/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'website_id=1' \
--form 'name=Example' \
--form 'type=click_element' \
--form 'path=blog/*' \
--form 'click_selector=.buy-button' \
{
    "data": {
        "id": 1,
        "website_id": 1,
        "user_id": 1,
        "key": "123456789",
        "type": "click_element",
        "path": "/blog/*",
        "scroll_percentage": null,
        "scroll_selector": null,
        "click_selector": ".buy-button",
        "value": null,
        "webhook_url": null,
        "name": "Example",
        "last_datetime": null,
        "datetime": "2026-10-15 04:38:51"
    }
}
POST https://analytics.odexxai.com/api/goals/{goal_id}
Parameters Details Description
website_id Optional Integer -
type Optional String Allowed values: pageview, custom, scroll, scroll_element, click_element, webhook
name Optional String -
path Optional String Available when: type = pageview, scroll, scroll_element, click_element
scroll_percentage Optional Integer Available when: type = scroll
scroll_selector Optional String Available when: type = scroll_element. The goal converts when the first matching element enters the viewport, including when already in view on page load. Enter a valid CSS selector with up to 1024 characters.
click_selector Optional String Available when: type = click_element. The goal converts when a visitor clicks any matching element, including an icon or text inside it. Enter a valid CSS selector with up to 1024 characters.
value Optional Float Optional amount saved with each new conversion. Leave empty to track conversions without a value. Use the same unit or currency across this website. Enter a nonnegative value below 10000000000000 with up to 2 decimal places.
key Optional String -
curl --request POST \
--url 'https://analytics.odexxai.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'type=scroll' \
--form 'path=blog/*' \
--form 'scroll_percentage=75' \
{
    "data": {
        "id": 1,
        "website_id": 1,
        "user_id": 1,
        "key": "123456789",
        "type": "scroll",
        "path": "/blog/*",
        "scroll_percentage": 75,
        "scroll_selector": null,
        "click_selector": null,
        "value": null,
        "webhook_url": null,
        "name": "Example",
        "last_datetime": "2026-10-15 04:38:51",
        "datetime": "2026-10-15 04:38:51"
    }
}

Send a POST request to the private webhook URL shown when editing your goal. JSON and form data are supported. An empty POST also records a conversion.

Webhook goals return a private webhook_url in the response. Use this URL to submit conversions without an API key.

Submit a value to record an actual amount, or omit it to use the configured conversion value. Only the conversion time and value are stored. Each accepted POST counts separately, including repeated requests. Webhook conversions are not linked to visitors, sessions, or page events.

POST https://analytics.odexxai.com/pixel-webhook/{webhook_key}
curl --request POST \
--url 'https://analytics.odexxai.com/pixel-webhook/{webhook_key}' \
--header 'Content-Type: application/json' \
--data '{"value":49.90}'
{"message":"","status":"success","details":[]}
DELETE https://analytics.odexxai.com/api/goals/{goal_id}
curl --request DELETE \
--url 'https://analytics.odexxai.com/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \