Skip to content
Start here

Zaraz

Update Zaraz workflow
client.zaraz.update(ZarazUpdateParams { zone_id, workflow } params, RequestOptionsoptions?): Workflow
PUT/zones/{zone_id}/settings/zaraz/workflow
ModelsExpand Collapse
ButtonTextTranslation { accept_all, confirm_my_choices, reject_all }
accept_all: Record<string, string>

Object where keys are language codes.

confirm_my_choices: Record<string, string>

Object where keys are language codes.

reject_all: Record<string, string>

Object where keys are language codes.

NeoEvent { actionType, blockingTriggers, data, firingTriggers }
actionType: string

Tool event type.

blockingTriggers: Array<string>

List of blocking triggers IDs.

data: unknown

Event payload.

firingTriggers: Array<string>

List of firing triggers IDs.

ZarazConfig

Get Zaraz configuration
client.zaraz.config.get(ConfigGetParams { zone_id } params, RequestOptionsoptions?): Configuration { dataLayer, debugKey, settings, 7 more }
GET/zones/{zone_id}/settings/zaraz/config
Update Zaraz configuration
client.zaraz.config.update(ConfigUpdateParams { zone_id, dataLayer, debugKey, 8 more } params, RequestOptionsoptions?): Configuration { dataLayer, debugKey, settings, 7 more }
PUT/zones/{zone_id}/settings/zaraz/config
ModelsExpand Collapse
Configuration { dataLayer, debugKey, settings, 7 more }

Zaraz configuration.

dataLayer: boolean

Data layer compatibility mode enabled.

debugKey: string

The key for Zaraz debug mode.

settings: Settings { autoInjectScript, contextEnricher, cookieDomain, 11 more }

General Zaraz settings.

autoInjectScript: boolean

Automatic injection of Zaraz scripts enabled.

contextEnricher?: ContextEnricher { escapedWorkerName, workerTag }

Details of the worker that receives and edits Zaraz Context object.

escapedWorkerName: string
workerTag: string
cookieDomain?: string

The domain Zaraz will use for writing and reading its cookies.

ecommerce?: boolean

Ecommerce API enabled.

eventsApiPath?: string

Custom endpoint for server-side track events.

hideExternalReferer?: boolean

Hiding external referrer URL enabled.

hideIPAddress?: boolean

Trimming IP address enabled.

hideQueryParams?: boolean

Removing URL query params enabled.

hideUserAgent?: boolean

Removing sensitive data from User Agent string enabled.

initPath?: string

Custom endpoint for Zaraz init script.

injectIframes?: boolean

Injection of Zaraz scripts into iframes enabled.

mcRootPath?: string

Custom path for Managed Components server functionalities.

scriptPath?: string

Custom endpoint for Zaraz main script.

trackPath?: string

Custom endpoint for Zaraz tracking requests.

tools: Record<string, ZarazManagedComponent { blockingTriggers, component, defaultFields, 10 more } | Worker { blockingTriggers, component, defaultFields, 11 more } >

Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object.

One of the following:
ZarazManagedComponent { blockingTriggers, component, defaultFields, 10 more }
blockingTriggers: Array<string>

List of blocking trigger IDs.

component: string

Tool's internal name.

defaultFields: Record<string, string | boolean>

Default fields for tool's actions.

One of the following:
string
boolean
enabled: boolean

Whether tool is enabled.

name: string

Tool's name defined by the user.

permissions: Array<string>

List of permissions granted to the component.

settings: Record<string, string | boolean>

Tool's settings.

One of the following:
string
boolean
type: "component"
actions?: Record<string, NeoEvent { actionType, blockingTriggers, data, firingTriggers } >

Actions configured on a tool. Either this or neoEvents field is required.

actionType: string

Tool event type.

blockingTriggers: Array<string>

List of blocking triggers IDs.

data: unknown

Event payload.

firingTriggers: Array<string>

List of firing triggers IDs.

defaultPurpose?: string

Default consent purpose ID.

neoEvents?: Array<NeoEvent { actionType, blockingTriggers, data, firingTriggers } >

DEPRECATED - List of actions configured on a tool. Either this or actions field is required. If both are present, actions field will take precedence.

actionType: string

Tool event type.

blockingTriggers: Array<string>

List of blocking triggers IDs.

data: unknown

Event payload.

firingTriggers: Array<string>

List of firing triggers IDs.

vendorName?: string

Vendor name for TCF compliant consent modal, required for Custom Managed Components and Custom HTML tool with a defaultPurpose assigned.

vendorPolicyUrl?: string

Vendor's Privacy Policy URL for TCF compliant consent modal, required for Custom Managed Components and Custom HTML tool with a defaultPurpose assigned.

Worker { blockingTriggers, component, defaultFields, 11 more }
blockingTriggers: Array<string>

List of blocking trigger IDs.

component: string

Tool's internal name.

defaultFields: Record<string, string | boolean>

Default fields for tool's actions.

One of the following:
string
boolean
enabled: boolean

Whether tool is enabled.

name: string

Tool's name defined by the user.

permissions: Array<string>

List of permissions granted to the component.

settings: Record<string, string | boolean>

Tool's settings.

One of the following:
string
boolean
type: "custom-mc"
worker: Worker { escapedWorkerName, workerTag }

Cloudflare worker that acts as a managed component.

escapedWorkerName: string
workerTag: string
actions?: Record<string, NeoEvent { actionType, blockingTriggers, data, firingTriggers } >

Actions configured on a tool. Either this or neoEvents field is required.

actionType: string

Tool event type.

blockingTriggers: Array<string>

List of blocking triggers IDs.

data: unknown

Event payload.

firingTriggers: Array<string>

List of firing triggers IDs.

defaultPurpose?: string

Default consent purpose ID.

neoEvents?: Array<NeoEvent { actionType, blockingTriggers, data, firingTriggers } >

DEPRECATED - List of actions configured on a tool. Either this or actions field is required. If both are present, actions field will take precedence.

actionType: string

Tool event type.

blockingTriggers: Array<string>

List of blocking triggers IDs.

data: unknown

Event payload.

firingTriggers: Array<string>

List of firing triggers IDs.

vendorName?: string

Vendor name for TCF compliant consent modal, required for Custom Managed Components and Custom HTML tool with a defaultPurpose assigned.

vendorPolicyUrl?: string

Vendor's Privacy Policy URL for TCF compliant consent modal, required for Custom Managed Components and Custom HTML tool with a defaultPurpose assigned.

triggers: Record<string, Triggers>

Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration.

excludeRules: Array<ZarazLoadRule { id, match, op, value } | ZarazClickListenerRule { id, action, settings } | ZarazTimerRule { id, action, settings } | 4 more>

Rules defining when the trigger is not fired.

One of the following:
ZarazLoadRule { id, match, op, value }
id: string
match: string
op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more
One of the following:
"CONTAINS"
"EQUALS"
"STARTS_WITH"
"ENDS_WITH"
"MATCH_REGEX"
"NOT_MATCH_REGEX"
"GREATER_THAN"
"GREATER_THAN_OR_EQUAL"
"LESS_THAN"
"LESS_THAN_OR_EQUAL"
value: string
ZarazClickListenerRule { id, action, settings }
id: string
action: "clickListener"
settings: Settings { selector, type, waitForTags }
selector: string
type: "xpath" | "css"
One of the following:
"xpath"
"css"
waitForTags: number
minimum0
ZarazTimerRule { id, action, settings }
id: string
action: "timer"
settings: Settings { interval, limit }
interval: number
minimum50
limit: number
minimum0
ZarazFormSubmissionRule { id, action, settings }
id: string
action: "formSubmission"
settings: Settings { selector, validate }
selector: string
validate: boolean
ZarazVariableMatchRule { id, action, settings }
id: string
action: "variableMatch"
settings: Settings { match, variable }
match: string
variable: string
ZarazScrollDepthRule { id, action, settings }
id: string
action: "scrollDepth"
settings: Settings { positions }
positions: string
ZarazElementVisibilityRule { id, action, settings }
id: string
action: "elementVisibility"
settings: Settings { selector }
selector: string
loadRules: Array<ZarazLoadRule { id, match, op, value } | ZarazClickListenerRule { id, action, settings } | ZarazTimerRule { id, action, settings } | 4 more>

Rules defining when the trigger is fired.

One of the following:
ZarazLoadRule { id, match, op, value }
id: string
match: string
op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more
One of the following:
"CONTAINS"
"EQUALS"
"STARTS_WITH"
"ENDS_WITH"
"MATCH_REGEX"
"NOT_MATCH_REGEX"
"GREATER_THAN"
"GREATER_THAN_OR_EQUAL"
"LESS_THAN"
"LESS_THAN_OR_EQUAL"
value: string
ZarazClickListenerRule { id, action, settings }
id: string
action: "clickListener"
settings: Settings { selector, type, waitForTags }
selector: string
type: "xpath" | "css"
One of the following:
"xpath"
"css"
waitForTags: number
minimum0
ZarazTimerRule { id, action, settings }
id: string
action: "timer"
settings: Settings { interval, limit }
interval: number
minimum50
limit: number
minimum0
ZarazFormSubmissionRule { id, action, settings }
id: string
action: "formSubmission"
settings: Settings { selector, validate }
selector: string
validate: boolean
ZarazVariableMatchRule { id, action, settings }
id: string
action: "variableMatch"
settings: Settings { match, variable }
match: string
variable: string
ZarazScrollDepthRule { id, action, settings }
id: string
action: "scrollDepth"
settings: Settings { positions }
positions: string
ZarazElementVisibilityRule { id, action, settings }
id: string
action: "elementVisibility"
settings: Settings { selector }
selector: string
name: string

Trigger name.

description?: string

Trigger description.

system?: "pageload"
variables: Record<string, ZarazStringVariable { name, type, value } | ZarazSecretVariable { name, type, value } | ZarazWorkerVariable { name, type, value } >

Variables set up under Zaraz configuration, where key is the variable alpha-numeric ID and value is the variable configuration. Values of variables of type secret are not included.

One of the following:
ZarazStringVariable { name, type, value }
name: string
type: "string"
value: string
ZarazSecretVariable { name, type, value }
name: string
type: "secret"
value: string
ZarazWorkerVariable { name, type, value }
name: string
type: "worker"
value: Value { escapedWorkerName, workerTag }
escapedWorkerName: string
workerTag: string
zarazVersion: number

Zaraz internal version of the config.

analytics?: Analytics { defaultPurpose, enabled, sessionExpTime }

Cloudflare Monitoring settings.

defaultPurpose?: string

Consent purpose assigned to Monitoring.

enabled?: boolean

Whether Advanced Monitoring reports are enabled.

sessionExpTime?: number

Session expiration time (seconds).

maximum86400
minimum60
historyChange?: boolean

Single Page Application support enabled.

ZarazDefault

Get default Zaraz configuration
client.zaraz.default.get(DefaultGetParams { zone_id } params, RequestOptionsoptions?): Configuration { dataLayer, debugKey, settings, 7 more }
GET/zones/{zone_id}/settings/zaraz/default

ZarazExport

Export Zaraz configuration
client.zaraz.export.get(ExportGetParams { zone_id } params, RequestOptionsoptions?): Configuration { dataLayer, debugKey, settings, 7 more }
GET/zones/{zone_id}/settings/zaraz/export

ZarazHistory

List Zaraz historical configuration records
client.zaraz.history.list(HistoryListParams { zone_id, limit, offset, 2 more } params, RequestOptionsoptions?): SinglePage<HistoryListResponse { id, createdAt, description, 2 more } >
GET/zones/{zone_id}/settings/zaraz/history
Restore Zaraz historical configuration by ID
client.zaraz.history.update(HistoryUpdateParams { zone_id, body } params, RequestOptionsoptions?): Configuration { dataLayer, debugKey, settings, 7 more }
PUT/zones/{zone_id}/settings/zaraz/history
ModelsExpand Collapse
HistoryListResponse { id, createdAt, description, 2 more }
id: number

ID of the configuration.

createdAt: string

Date and time the configuration was created.

formatdate-time
description: string

Configuration description provided by the user who published this configuration.

updatedAt: string

Date and time the configuration was last updated.

formatdate-time
userId: string

Alpha-numeric ID of the account user who published the configuration.

ZarazHistoryConfigs

Get Zaraz historical configurations by ID(s)
client.zaraz.history.configs.get(ConfigGetParams { zone_id, ids } params, RequestOptionsoptions?): ConfigGetResponse { id, config, createdAt, 2 more }
GET/zones/{zone_id}/settings/zaraz/history/configs
ModelsExpand Collapse
ConfigGetResponse = Record<string, item>

Object where keys are numeric configuration IDs.

id: number

ID of the configuration.

config: Configuration { dataLayer, debugKey, settings, 7 more }

Zaraz configuration.

createdAt: string

Date and time the configuration was created.

formatdate-time
updatedAt: string

Date and time the configuration was last updated.

formatdate-time
userId: string

Alpha-numeric ID of the account user who published the configuration.

ZarazPublish

Publish Zaraz preview configuration
client.zaraz.publish.create(PublishCreateParams { zone_id, body } params, RequestOptionsoptions?): PublishCreateResponse
POST/zones/{zone_id}/settings/zaraz/publish
ModelsExpand Collapse
PublishCreateResponse = string

ZarazWorkflow

Get Zaraz workflow
client.zaraz.workflow.get(WorkflowGetParams { zone_id } params, RequestOptionsoptions?): Workflow
GET/zones/{zone_id}/settings/zaraz/workflow
ModelsExpand Collapse
Workflow = "realtime" | "preview"

Zaraz workflow.

One of the following:
"realtime"
"preview"