Define a conversion goal
POST
https://seolyticize.com /api/v1/tools/create_goal Defines a goal for the cookieless analytics: reaching a page (kind pageview, match a path such as /thanks or /signup/*) or sending a custom event (kind event, match its name). Optionally worth a fixed value in minor units (2500 = 25.00); without one, an event's own 'value' property is summed. Counts every visit since the tag went in, not only from now. Answers 'count sign-ups as reaching /welcome'. Free.
Parameters
Idempotency-KeystringheaderAny unique string, up to 200 characters. A retry with the same key and body is answered from the first answer (Idempotent-Replayed: true) for a day, so it never buys or writes twice; the same key with another body is refused.
Request body
application/json
clientIdstringrequirednamestringrequiredkindstringrequiredmatchstringrequiredA path for a pageview ("/thanks", "/signup/*"; * matches anything) or an event name.
valueMinorintegerupsertBystringWith "name": a goal of that name already defined the same way is returned as it is (created: false), and one defined differently is replaced, so a provisioning script can run this every time.
dryRunbooleanTrue to do nothing and get back exactly what the call would do: the rows it would write, the addresses it would submit, the emails it would send.
{
"clientId": "string",
"name": "string",
"kind": "pageview",
"match": "string",
"valueMinor": null,
"upsertBy": "name",
"dryRun": false
}Code samples
cURL
curl -X POST "https://seolyticize.com/api/v1/tools/create_goal" \
-H "Authorization: Bearer $SEOLYTICIZE_API_KEY" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"clientId":"string","name":"string","kind":"pageview","match":"string","valueMinor":null,"upsertBy":"name","dryRun":false}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 The tool's result under
data, and its meta.Example
{
"data": {},
"meta": {
"requestId": "string",
"costMicros": 0,
"cached": true,
"cachedFrom": "string",
"dataAsOf": "string",
"sources": [
"string"
],
"partial": true,
"next": [
{
"tool": "string",
"args": {},
"why": "string"
}
],
"nextCursor": "string",
"dryRun": true
}
}Schema
datarequiredmetaobjectrequiredBeside every answer: what it cost, whether it came from cache, how fresh it is, whether it is complete, and what to call next.
Show child parameters
requestIdstringrequiredcostMicrosintegerrequiredCharged by this call, micro-USD (1,000,000 = $1).
cachedbooleanrequiredTrue when nothing was bought.
cachedFromstringWhen the oldest cached answer used was bought.
dataAsOfstringsourcesstring[]partialbooleanrequiredTrue when the data is incomplete: a running crawl, unfinished days, unread pages.
nextobject[]requiredShow child parameters
toolstringargsobjectwhystringnextCursorstringPass as cursor for the next page.
dryRunbooleanHeaders
X-RateLimit-LimitintegerRequests this key may make per window.
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window resets.
X-Request-IdstringThe id to quote about this request.
400 The body was not JSON or did not match the tool's input schema.
Example
{
"error": "string",
"code": "string",
"next": "string",
"requestId": "string"
}Schema
errorstringrequiredA sentence written for the caller. Internal failures are reduced to 'The request could not be completed.' and never carry detail.
codestringA stable snake_case reason to branch on; GET /api/v1/errors lists them all.
nextstringThe call or step that fixes it, when there is one.
requestIdstringQuote it when asking about a failure.
Headers
X-RateLimit-LimitintegerRequests this key may make per window.
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window resets.
401 No key, or a key that is unknown or revoked.
Same as 400 · POST /api/v1/tools/create_goal
Headers
WWW-Authenticatestring403 The key's role does not permit the tool, or the key may not reach the named client.
Same as 400 · POST /api/v1/tools/create_goal
Headers
X-RateLimit-LimitintegerRequests this key may make per window.
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window resets.
404 No tool by that name.
Same as 400 · POST /api/v1/tools/create_goal
Headers
X-RateLimit-LimitintegerRequests this key may make per window.
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window resets.
409 A request with this Idempotency-Key is still running.
Same as 400 · POST /api/v1/tools/create_goal
Headers
X-RateLimit-LimitintegerRequests this key may make per window.
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window resets.
422 A well-formed request the product declined, with the reason — a duplicate name, a plan limit, nothing configured to run.
Same as 400 · POST /api/v1/tools/create_goal
Headers
X-RateLimit-LimitintegerRequests this key may make per window.
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window resets.
429 This key has used its window.
Same as 400 · POST /api/v1/tools/create_goal
Headers
X-RateLimit-LimitintegerRequests this key may make per window.
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window resets.
Retry-AfterintegerSeconds to wait before retrying.
500 The request could not be completed.
Same as 400 · POST /api/v1/tools/create_goal
Headers
X-RateLimit-LimitintegerRequests this key may make per window.
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the current window resets.
Updated