Skip to content
Start here

Zaraz

Update Zaraz workflow
zaraz.update(ZarazUpdateParams**kwargs) -> Workflow
PUT/zones/{zone_id}/settings/zaraz/workflow
ModelsExpand Collapse
class ButtonTextTranslation:
accept_all: Dict[str, str]

Object where keys are language codes.

confirm_my_choices: Dict[str, str]

Object where keys are language codes.

reject_all: Dict[str, str]

Object where keys are language codes.

class NeoEvent:
action_type: str

Tool event type.

blocking_triggers: List[str]

List of blocking triggers IDs.

data: object

Event payload.

firing_triggers: List[str]

List of firing triggers IDs.

ZarazConfig

Get Zaraz configuration
zaraz.config.get(ConfigGetParams**kwargs) -> Configuration
GET/zones/{zone_id}/settings/zaraz/config
Update Zaraz configuration
zaraz.config.update(ConfigUpdateParams**kwargs) -> Configuration
PUT/zones/{zone_id}/settings/zaraz/config
ModelsExpand Collapse
class Configuration:

Zaraz configuration.

data_layer: bool

Data layer compatibility mode enabled.

debug_key: str

The key for Zaraz debug mode.

settings: Settings

General Zaraz settings.

auto_inject_script: bool

Automatic injection of Zaraz scripts enabled.

context_enricher: Optional[SettingsContextEnricher]

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

escaped_worker_name: str
worker_tag: str
cookie_domain: Optional[str]

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

ecommerce: Optional[bool]

Ecommerce API enabled.

events_api_path: Optional[str]

Custom endpoint for server-side track events.

hide_external_referer: Optional[bool]

Hiding external referrer URL enabled.

hide_ip_address: Optional[bool]

Trimming IP address enabled.

hide_query_params: Optional[bool]

Removing URL query params enabled.

hide_user_agent: Optional[bool]

Removing sensitive data from User Agent string enabled.

init_path: Optional[str]

Custom endpoint for Zaraz init script.

inject_iframes: Optional[bool]

Injection of Zaraz scripts into iframes enabled.

mc_root_path: Optional[str]

Custom path for Managed Components server functionalities.

script_path: Optional[str]

Custom endpoint for Zaraz main script.

track_path: Optional[str]

Custom endpoint for Zaraz tracking requests.

tools: Dict[str, Tools]

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:
class ToolsZarazManagedComponent:
blocking_triggers: List[str]

List of blocking trigger IDs.

component: str

Tool's internal name.

default_fields: Dict[str, Union[str, bool]]

Default fields for tool's actions.

One of the following:
str
bool
enabled: bool

Whether tool is enabled.

name: str

Tool's name defined by the user.

permissions: List[str]

List of permissions granted to the component.

settings: Dict[str, Union[str, bool]]

Tool's settings.

One of the following:
str
bool
type: Literal["component"]
actions: Optional[Dict[str, NeoEvent]]

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

action_type: str

Tool event type.

blocking_triggers: List[str]

List of blocking triggers IDs.

data: object

Event payload.

firing_triggers: List[str]

List of firing triggers IDs.

default_purpose: Optional[str]

Default consent purpose ID.

neo_events: Optional[List[NeoEvent]]

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

action_type: str

Tool event type.

blocking_triggers: List[str]

List of blocking triggers IDs.

data: object

Event payload.

firing_triggers: List[str]

List of firing triggers IDs.

vendor_name: Optional[str]

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

vendor_policy_url: Optional[str]

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

class ToolsWorker:
blocking_triggers: List[str]

List of blocking trigger IDs.

component: str

Tool's internal name.

default_fields: Dict[str, Union[str, bool]]

Default fields for tool's actions.

One of the following:
str
bool
enabled: bool

Whether tool is enabled.

name: str

Tool's name defined by the user.

permissions: List[str]

List of permissions granted to the component.

settings: Dict[str, Union[str, bool]]

Tool's settings.

One of the following:
str
bool
type: Literal["custom-mc"]
worker: ToolsWorkerWorker

Cloudflare worker that acts as a managed component.

escaped_worker_name: str
worker_tag: str
actions: Optional[Dict[str, NeoEvent]]

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

action_type: str

Tool event type.

blocking_triggers: List[str]

List of blocking triggers IDs.

data: object

Event payload.

firing_triggers: List[str]

List of firing triggers IDs.

default_purpose: Optional[str]

Default consent purpose ID.

neo_events: Optional[List[NeoEvent]]

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

action_type: str

Tool event type.

blocking_triggers: List[str]

List of blocking triggers IDs.

data: object

Event payload.

firing_triggers: List[str]

List of firing triggers IDs.

vendor_name: Optional[str]

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

vendor_policy_url: Optional[str]

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

triggers: Dict[str, Triggers]

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

exclude_rules: List[TriggersExcludeRule]

Rules defining when the trigger is not fired.

One of the following:
class TriggersExcludeRuleZarazLoadRule:
id: str
match: str
op: Literal["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: str
class TriggersExcludeRuleZarazClickListenerRule:
id: str
action: Literal["clickListener"]
settings: TriggersExcludeRuleZarazClickListenerRuleSettings
selector: str
type: Literal["xpath", "css"]
One of the following:
"xpath"
"css"
wait_for_tags: int
minimum0
class TriggersExcludeRuleZarazTimerRule:
id: str
action: Literal["timer"]
settings: TriggersExcludeRuleZarazTimerRuleSettings
interval: int
minimum50
limit: int
minimum0
class TriggersExcludeRuleZarazFormSubmissionRule:
id: str
action: Literal["formSubmission"]
settings: TriggersExcludeRuleZarazFormSubmissionRuleSettings
selector: str
validate: bool
class TriggersExcludeRuleZarazVariableMatchRule:
id: str
action: Literal["variableMatch"]
settings: TriggersExcludeRuleZarazVariableMatchRuleSettings
match: str
variable: str
class TriggersExcludeRuleZarazScrollDepthRule:
id: str
action: Literal["scrollDepth"]
settings: TriggersExcludeRuleZarazScrollDepthRuleSettings
positions: str
class TriggersExcludeRuleZarazElementVisibilityRule:
id: str
action: Literal["elementVisibility"]
settings: TriggersExcludeRuleZarazElementVisibilityRuleSettings
selector: str
load_rules: List[TriggersLoadRule]

Rules defining when the trigger is fired.

One of the following:
class TriggersLoadRuleZarazLoadRule:
id: str
match: str
op: Literal["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: str
class TriggersLoadRuleZarazClickListenerRule:
id: str
action: Literal["clickListener"]
settings: TriggersLoadRuleZarazClickListenerRuleSettings
selector: str
type: Literal["xpath", "css"]
One of the following:
"xpath"
"css"
wait_for_tags: int
minimum0
class TriggersLoadRuleZarazTimerRule:
id: str
action: Literal["timer"]
settings: TriggersLoadRuleZarazTimerRuleSettings
interval: int
minimum50
limit: int
minimum0
class TriggersLoadRuleZarazFormSubmissionRule:
id: str
action: Literal["formSubmission"]
settings: TriggersLoadRuleZarazFormSubmissionRuleSettings
selector: str
validate: bool
class TriggersLoadRuleZarazVariableMatchRule:
id: str
action: Literal["variableMatch"]
settings: TriggersLoadRuleZarazVariableMatchRuleSettings
match: str
variable: str
class TriggersLoadRuleZarazScrollDepthRule:
id: str
action: Literal["scrollDepth"]
settings: TriggersLoadRuleZarazScrollDepthRuleSettings
positions: str
class TriggersLoadRuleZarazElementVisibilityRule:
id: str
action: Literal["elementVisibility"]
settings: TriggersLoadRuleZarazElementVisibilityRuleSettings
selector: str
name: str

Trigger name.

description: Optional[str]

Trigger description.

system: Optional[Literal["pageload"]]
variables: Dict[str, Variables]

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:
class VariablesZarazStringVariable:
name: str
type: Literal["string"]
value: str
class VariablesZarazSecretVariable:
name: str
type: Literal["secret"]
value: str
class VariablesZarazWorkerVariable:
name: str
type: Literal["worker"]
value: VariablesZarazWorkerVariableValue
escaped_worker_name: str
worker_tag: str
zaraz_version: int

Zaraz internal version of the config.

analytics: Optional[Analytics]

Cloudflare Monitoring settings.

default_purpose: Optional[str]

Consent purpose assigned to Monitoring.

enabled: Optional[bool]

Whether Advanced Monitoring reports are enabled.

session_exp_time: Optional[int]

Session expiration time (seconds).

maximum86400
minimum60
history_change: Optional[bool]

Single Page Application support enabled.

ZarazDefault

Get default Zaraz configuration
zaraz.default.get(DefaultGetParams**kwargs) -> Configuration
GET/zones/{zone_id}/settings/zaraz/default

ZarazExport

Export Zaraz configuration
zaraz.export.get(ExportGetParams**kwargs) -> Configuration
GET/zones/{zone_id}/settings/zaraz/export

ZarazHistory

List Zaraz historical configuration records
zaraz.history.list(HistoryListParams**kwargs) -> SyncSinglePage[HistoryListResponse]
GET/zones/{zone_id}/settings/zaraz/history
Restore Zaraz historical configuration by ID
zaraz.history.update(HistoryUpdateParams**kwargs) -> Configuration
PUT/zones/{zone_id}/settings/zaraz/history
ModelsExpand Collapse
class HistoryListResponse:
id: int

ID of the configuration.

created_at: datetime

Date and time the configuration was created.

formatdate-time
description: str

Configuration description provided by the user who published this configuration.

updated_at: datetime

Date and time the configuration was last updated.

formatdate-time
user_id: str

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

ZarazHistoryConfigs

Get Zaraz historical configurations by ID(s)
zaraz.history.configs.get(ConfigGetParams**kwargs) -> ConfigGetResponse
GET/zones/{zone_id}/settings/zaraz/history/configs
ModelsExpand Collapse
Dict[str, ConfigGetResponseItem]

Object where keys are numeric configuration IDs.

id: int

ID of the configuration.

Zaraz configuration.

created_at: datetime

Date and time the configuration was created.

formatdate-time
updated_at: datetime

Date and time the configuration was last updated.

formatdate-time
user_id: str

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

ZarazPublish

Publish Zaraz preview configuration
zaraz.publish.create(PublishCreateParams**kwargs) -> PublishCreateResponse
POST/zones/{zone_id}/settings/zaraz/publish
ModelsExpand Collapse
str

ZarazWorkflow

Get Zaraz workflow
zaraz.workflow.get(WorkflowGetParams**kwargs) -> Workflow
GET/zones/{zone_id}/settings/zaraz/workflow
ModelsExpand Collapse
Literal["realtime", "preview"]

Zaraz workflow.

One of the following:
"realtime"
"preview"