Record events and goals from a browser with a tracking token, using track.js or a direct call to /public/events.
POST /public/events takes the same payload and follows the same rules as POST /v1/events. The difference is that it also accepts a tracking token, so a web page can call it. Unlike /v1/events, email and contactId are optional here. Because a tracking token is public, contactId is always ignored and email is a claim: it identifies the contact only when the workspace has turned on Settings → Tracking tokens → Trust identity declared by your site code, and only for an existing contact. Otherwise the event is stored anonymously, unless the visit is already known from a tracked email link or a form submission (track.js sends the visit id with every event).
Credential
Header
Notes
Tracking token
Authorization: Bearer ict_…
Created under Settings → Tracking tokens. It can only record events, so it is safe to embed.
Workspace API key
Authorization: Bearer ic_…
For server-side callers. Needs events:write.
CORS is open (Access-Control-Allow-Origin: *).
If a token has allowed domains, a browser request from any other Origin answers 403. Subdomains of an allowed domain pass. A request with no Origin header, such as one from a server, is accepted.
The limit is 100 requests/minute per workspace, and bodies are capped at 64 KB.
The response is { id, status }, where status is "recorded" (201) or "duplicate" (200).
After identify(), track.js adds email to every event and goal it sends from that page. A goal can name its own contact with { email }, and ICTrack.reset() stops sending the email. Nothing is stored between pages, so call identify() on each page load. The email takes effect only with the trust setting above turned on.
track.js also sends anonymous pageview and time-on-page beacons for web analytics. The endpoint behind those beacons is part of the script’s own protocol and is not a public API. Use track.js for page analytics, and use this endpoint for events.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"InstantCampaign","colors":{"primary":"#C21858","light":"#E25E92","dark":"#A81049"},"logo":{"light":"https://mintcdn.com/cloudfirst/1fZVgGXmDmFaSTGB/logo/light.svg?fit=max\u0026auto=format\u0026n=1fZVgGXmDmFaSTGB\u0026q=85\u0026s=a2f64b237aae1e56f542e529f411a0e1","dark":"https://mintcdn.com/cloudfirst/1fZVgGXmDmFaSTGB/logo/dark.svg?fit=max\u0026auto=format\u0026n=1fZVgGXmDmFaSTGB\u0026q=85\u0026s=d313c782b72312ee9fa89292a4432e06","href":"https://instantcampaign.ai"},"favicon":"https://mintcdn.com/cloudfirst/kEODTZekPllgGvfl/favicon.svg?fit=max\u0026auto=format\u0026n=kEODTZekPllgGvfl\u0026q=85\u0026s=91dc81e427c4033bc51b03eae2b7fe24","styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cloudfirst","hasAudioNarration":false,"actualSubdomain":"cloudfirst","customDomains":["docs.instantcampaign.ai"],"gitSource":{"type":"github","owner":"tanmaykarkare","repo":"instantcampaign","deployBranch":"main","contentDirectory":"mintlify-docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af1cf192126ef8f8130b02b","clientVersion":"0.0.4142","searchFilterCounts":[{"language":"default","tag":"Documentation","count":94},{"language":"default","tag":"Email builder \u0026 templates","count":26},{"language":"default","tag":"Integrations","count":22},{"language":"default","tag":"Campaigns","count":13},{"language":"default","tag":"Workspace \u0026 account","count":12},{"language":"default","tag":"Ad Studio","count":9},{"language":"default","tag":"Automations, forms \u0026 pages","count":9},{"language":"default","tag":"API Reference","count":8},{"language":"default","tag":"Developers","count":8},{"language":"default","tag":"Developer guides","count":8}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".callout[data-callout-type=\"tip\"]{border-color:#F8C9DB!important;background-color:#FDF2F6!important}.callout[data-callout-type=\"tip\"] [data-component-part=\"callout-icon\"] svg,.callout[data-callout-type=\"tip\"] [data-component-part=\"callout-content\"]{color:#870D3B!important}.dark .callout[data-callout-type=\"tip\"]{border-color:#5F0A2A!important;background-color:rgba(194, 24, 88, 0.18)!important}.dark .callout[data-callout-type=\"tip\"] [data-component-part=\"callout-icon\"] svg,.dark .callout[data-callout-type=\"tip\"] [data-component-part=\"callout-content\"]{color:#F09CBC!important}.callout[data-callout-type=\"note\"]{border-color:#E6E3E9!important;background-color:#F8F7F9!important}.callout[data-callout-type=\"note\"] [data-component-part=\"callout-content\"]{color:#322F37!important}.callout[data-callout-type=\"note\"] [data-component-part=\"callout-icon\"] svg{color:#C21858!important}.dark .callout[data-callout-type=\"note\"]{border-color:#322F37!important;background-color:rgba(255, 255, 255, 0.06)!important}.dark .callout[data-callout-type=\"note\"] [data-component-part=\"callout-content\"]{color:#E6E3E9!important}.dark .callout[data-callout-type=\"note\"] [data-component-part=\"callout-icon\"] svg{color:#E25E92!important}"}],"page":{"pagePath":"api-reference/website-tracking","slug":"/api-reference/website-tracking","pageMetadata":{"title":"Website tracking","description":"Record events and goals from a browser with a tracking token, using track.js or a direct call to /public/events.","href":"/api-reference/website-tracking"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Record events and goals from a browser with a tracking token, using track.js or a direct call to /public/events.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /public/events`}),` takes the same payload and follows the same rules as `,_jsx(_components.a,{href:`/api-reference/events`,children:_jsx(_components.code,{children:`POST /v1/events`})}),`. The difference is that it also accepts a `,_jsx(_components.strong,{children:`tracking token`}),`, so a web page can call it. Unlike `,_jsx(_components.code,{children:`/v1/events`}),`, `,_jsx(_components.code,{children:`email`}),` and `,_jsx(_components.code,{children:`contactId`}),` are optional here. Because a tracking token is public, `,_jsx(_components.code,{children:`contactId`}),` is always ignored and `,_jsx(_components.code,{children:`email`}),` is a claim: it identifies the contact only when the workspace has turned on `,_jsx(_components.strong,{children:`Settings → Tracking tokens → Trust identity declared by your site code`}),`, and only for an existing contact. Otherwise the event is stored anonymously, unless the visit is already known from a tracked email link or a form submission (`,_jsx(_components.code,{children:`track.js`}),` sends the visit id with every event).`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Credential`}),_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Tracking token`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Authorization: Bearer ict_…`})}),_jsxs(_components.td,{children:[`Created under `,_jsx(_components.strong,{children:`Settings → Tracking tokens`}),`. It can only record events, so it is safe to embed.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Workspace API key`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Authorization: Bearer ic_…`})}),_jsxs(_components.td,{children:[`For server-side callers. Needs `,_jsx(_components.code,{children:`events:write`}),`.`]})]})]})]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`CORS is open (`,_jsx(_components.code,{children:`Access-Control-Allow-Origin: *`}),`).`]}),`\n`,_jsxs(_components.li,{children:[`If a token has allowed domains, a browser request from any other `,_jsx(_components.code,{children:`Origin`}),` answers `,_jsx(_components.code,{children:`403`}),`. Subdomains of an allowed domain pass. A request with no `,_jsx(_components.code,{children:`Origin`}),` header, such as one from a server, is accepted.`]}),`\n`,_jsx(_components.li,{children:`The limit is 100 requests/minute per workspace, and bodies are capped at 64 KB.`}),`\n`,_jsxs(_components.li,{children:[`The response is `,_jsx(_components.code,{children:`{ id, status }`}),`, where `,_jsx(_components.code,{children:`status`}),` is `,_jsx(_components.code,{children:`\"recorded\"`}),` (`,_jsx(_components.code,{children:`201`}),`) or `,_jsx(_components.code,{children:`\"duplicate\"`}),` (`,_jsx(_components.code,{children:`200`}),`).`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`with-track-js`,children:`With track.js`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` src`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://instantcampaign.ai/track.js\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` data-site-id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ict_YOUR_TOKEN\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ICTrack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`identify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"jane@example.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ICTrack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`goal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"purchase\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 42.5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`currency:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"GBP\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`externalId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"order-10422\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`After `,_jsx(_components.code,{children:`identify()`}),`, `,_jsx(_components.code,{children:`track.js`}),` adds `,_jsx(_components.code,{children:`email`}),` to every event and goal it sends from that page. A goal can name its own contact with `,_jsx(_components.code,{children:`{ email }`}),`, and `,_jsx(_components.code,{children:`ICTrack.reset()`}),` stops sending the email. Nothing is stored between pages, so call `,_jsx(_components.code,{children:`identify()`}),` on each page load. The email takes effect only with the trust setting above turned on.`]}),`\n`,_jsx(Heading,{level:`2`,id:`direct-call`,children:`Direct call`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://instantcampaign.ai/api/public/events`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer ict_YOUR_TOKEN\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{ \"event\": \"signup.completed\", \"email\": \"jane@example.com\", \"goalType\": \"signup\" }'`})]}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`track.js`}),` also sends anonymous pageview and time-on-page beacons for web analytics. The endpoint behind those beacons is part of the script’s own protocol and is not a public API. Use `,_jsx(_components.code,{children:`track.js`}),` for page analytics, and use this endpoint for events.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Website tracking","description":"Record events and goals from a browser with a tracking token, using track.js or a direct call to /public/events.","href":"/api-reference/website-tracking"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"With track.js","slug":"with-track-js","depth":2,"children":[]},{"title":"Direct call","slug":"direct-call","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"cloudfirst","siteName":"InstantCampaign","title":"Website tracking - InstantCampaign","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-25T21:32:51.656Z","originalFileLocation":"api-reference/website-tracking.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Record events and goals from a browser with a tracking token, using track.js or a direct call to /public/events.\">\u003cmeta data-mint-head name=\"application-name\" content=\"InstantCampaign\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Website tracking - InstantCampaign\">\u003cmeta data-mint-head property=\"og:description\" content=\"Record events and goals from a browser with a tracking token, using track.js or a direct call to /public/events.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"InstantCampaign\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.instantcampaign.ai/api-reference/website-tracking\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cloudfirst.mintlify.site/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=Website+tracking\u0026amp;description=Record+events+and+goals+from+a+browser+with+a+tracking+token%2C+using+track.js+or+a+direct+call+to+%2Fpublic%2Fevents.\u0026amp;theme=b0507e1223d7bfaaeb14c445\u0026amp;signature=0e85a7a946298fa3ca107c429f021538c07aa813f026c0186a1901db5e772668\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Website tracking - InstantCampaign\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Record events and goals from a browser with a tracking token, using track.js or a direct call to /public/events.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cloudfirst.mintlify.site/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=Website+tracking\u0026amp;description=Record+events+and+goals+from+a+browser+with+a+tracking+token%2C+using+track.js+or+a+direct+call+to+%2Fpublic%2Fevents.\u0026amp;theme=b0507e1223d7bfaaeb14c445\u0026amp;signature=0e85a7a946298fa3ca107c429f021538c07aa813f026c0186a1901db5e772668\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/cloudfirst/5Wsgmf95oRjSES1_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"InstantCampaign\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#C21858\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.instantcampaign.ai/api-reference/website-tracking\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/website-tracking.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.instantcampaign.ai/#organization\",\"name\":\"InstantCampaign\",\"url\":\"https://docs.instantcampaign.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cloudfirst/1fZVgGXmDmFaSTGB/logo/light.svg?fit=max\u0026auto=format\u0026n=1fZVgGXmDmFaSTGB\u0026q=85\u0026s=a2f64b237aae1e56f542e529f411a0e1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.instantcampaign.ai#website\",\"name\":\"InstantCampaign\",\"url\":\"https://docs.instantcampaign.ai\",\"publisher\":{\"@id\":\"https://docs.instantcampaign.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.instantcampaign.ai/api-reference/website-tracking#webpage\",\"url\":\"https://docs.instantcampaign.ai/api-reference/website-tracking\",\"name\":\"Website tracking\",\"description\":\"Record events and goals from a browser with a tracking token, using track.js or a direct call to /public/events.\",\"dateModified\":\"2026-10-25T21:32:51.656Z\",\"isPartOf\":{\"@id\":\"https://docs.instantcampaign.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.instantcampaign.ai/api-reference/website-tracking#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.instantcampaign.ai/api-reference/website-tracking#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.instantcampaign.ai/api-reference/contacts-and-lists\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Website tracking\",\"item\":\"https://docs.instantcampaign.ai/api-reference/website-tracking\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.instantcampaign.ai/api-reference/website-tracking#article\",\"headline\":\"Website tracking\",\"name\":\"Website tracking\",\"description\":\"Record events and goals from a browser with a tracking token, using track.js or a direct call to /public/events.\",\"url\":\"https://docs.instantcampaign.ai/api-reference/website-tracking\",\"mainEntityOfPage\":{\"@id\":\"https://docs.instantcampaign.ai/api-reference/website-tracking#webpage\"},\"dateModified\":\"2026-10-25T21:32:51.656Z\",\"publisher\":{\"@id\":\"https://docs.instantcampaign.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.instantcampaign.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"InstantCampaign\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"InstantCampaign\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/website-tracking.md","siteName":"InstantCampaign","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/overview"}]},{"tab":"Developers","pages":[{"title":"Developers","href":"/guides/developers/overview"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API introduction","href":"/api-reference/introduction"}]},{"group":"Endpoints","pages":[{"title":"Contacts \u0026 lists","href":"/api-reference/contacts-and-lists"},{"title":"Events \u0026 goals","href":"/api-reference/events"},{"title":"Transactional email API","href":"/api-reference/transactional"},{"title":"Webhooks API","description":"Get workspace events POSTed to your endpoint — signed and retried when registered in Settings, or as simple REST hooks for Zapier and Make.","href":"/api-reference/webhooks"},{"title":"Website tracking","href":"/api-reference/website-tracking"},{"title":"Journeys","description":"Start contacts on automation journeys from your own systems — by recording a named event, or by calling one journey's trigger endpoint.","href":"/api-reference/journeys"},{"title":"MCP server","href":"/api-reference/mcp"}]}]}]},"basePath":"","title":"Website tracking - InstantCampaign","buildId":"dpl_G2Qd45vZZ7MkBiGF9yYx8ZsbbKXX","deploymentId":"dpl_G2Qd45vZZ7MkBiGF9yYx8ZsbbKXX","dynamics":[],"chunks":[]}