Create a script

post
https://api.clakta.com/v1/projects/{idOrSlug}/scripts

Create a tracking script for a project. Requires an API key with `projects.write`. Only `name` is required. By default, the script accepts events from any domain and enables all four automatic tracking options.

Authentication

Send your API key as a bearer token in the Authorization header.

See Authentication for how to create and scope an API key.

Path parameters

idOrSlugstringrequired

The project ID (with the proj_ prefix) or slug.

Bodyapplication/json

namestringrequired
domainsstring[]optional
trackPageViewsbooleanoptionaldefault: true
trackClicksbooleanoptionaldefault: true
trackScrollsbooleanoptionaldefault: true
trackFormSubmissionsbooleanoptionaldefault: true

Response

The created script

idstringrequired

The script's data-clakta-id.

namestringrequired
domainsstring[]required
typeenum<string>required

Allowed values:webiosandroid

trackPageViewsbooleanrequired
trackClicksbooleanrequired
trackScrollsbooleanrequired
trackFormSubmissionsbooleanrequired
lastEventAtdate-time | nullrequired
createdAtdate-timerequired
updatedAtdate-timerequired