# Zaraz ## Update Zaraz workflow `client.zaraz.update(ZarazUpdateParamsparams, RequestOptionsoptions?): Workflow` **put** `/zones/{zone_id}/settings/zaraz/workflow` Updates Zaraz workflow for a zone. ### Parameters - `params: ZarazUpdateParams` - `zone_id: string` Path param: Identifier. - `workflow: Workflow` Body param: Zaraz workflow. - `"realtime"` - `"preview"` ### Returns - `Workflow = "realtime" | "preview"` Zaraz workflow. - `"realtime"` - `"preview"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const workflow = await client.zaraz.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', workflow: 'realtime', }); console.log(workflow); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": "realtime", "success": true } ``` ## Domain Types ### Button Text Translation - `ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. ### Neo Event - `NeoEvent` - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. # Config ## Get Zaraz configuration `client.zaraz.config.get(ConfigGetParamsparams, RequestOptionsoptions?): Configuration` **get** `/zones/{zone_id}/settings/zaraz/config` Gets latest Zaraz configuration for a zone. It can be preview or published configuration, whichever was the last updated. Secret variables values will not be included. ### Parameters - `params: ConfigGetParams` - `zone_id: string` Identifier. ### Returns - `Configuration` Zaraz configuration. - `dataLayer: boolean` Data layer compatibility mode enabled. - `debugKey: string` The key for Zaraz debug mode. - `settings: Settings` General Zaraz settings. - `autoInjectScript: boolean` Automatic injection of Zaraz scripts enabled. - `contextEnricher?: ContextEnricher` 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` Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `ZarazManagedComponent` - `blockingTriggers: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "component"` - `"component"` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "custom-mc"` - `"custom-mc"` - `worker: Worker` Cloudflare worker that acts as a managed component. - `escapedWorkerName: string` - `workerTag: string` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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` Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `excludeRules: Array` Rules defining when the trigger is not fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `loadRules: Array` Rules defining when the trigger is fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `name: string` Trigger name. - `description?: string` Trigger description. - `system?: "pageload"` - `"pageload"` - `variables: Record` 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. - `ZarazStringVariable` - `name: string` - `type: "string"` - `"string"` - `value: string` - `ZarazSecretVariable` - `name: string` - `type: "secret"` - `"secret"` - `value: string` - `ZarazWorkerVariable` - `name: string` - `type: "worker"` - `"worker"` - `value: Value` - `escapedWorkerName: string` - `workerTag: string` - `zarazVersion: number` Zaraz internal version of the config. - `analytics?: Analytics` Cloudflare Monitoring settings. - `defaultPurpose?: string` Consent purpose assigned to Monitoring. - `enabled?: boolean` Whether Advanced Monitoring reports are enabled. - `sessionExpTime?: number` Session expiration time (seconds). - `consent?: Consent` Consent management configuration. - `enabled: boolean` - `buttonTextTranslations?: ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. - `companyEmail?: string` - `companyName?: string` - `companyStreetAddress?: string` - `consentModalIntroHTML?: string` - `consentModalIntroHTMLWithTranslations?: Record` Object where keys are language codes. - `cookieName?: string` - `customCSS?: string` - `customIntroDisclaimerDismissed?: boolean` - `defaultLanguage?: string` - `hideModal?: boolean` - `purposes?: Record` Object where keys are purpose alpha-numeric IDs. - `description: string` - `name: string` - `purposesWithTranslations?: Record` Object where keys are purpose alpha-numeric IDs. - `description: Record` Object where keys are language codes. - `name: Record` Object where keys are language codes. - `order: number` - `tcfCompliant?: boolean` - `historyChange?: boolean` Single Page Application support enabled. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const configuration = await client.zaraz.config.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(configuration.dataLayer); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "dataLayer": true, "debugKey": "debugKey", "settings": { "autoInjectScript": true, "contextEnricher": { "escapedWorkerName": "escapedWorkerName", "workerTag": "workerTag" }, "cookieDomain": "cookieDomain", "ecommerce": true, "eventsApiPath": "eventsApiPath", "hideExternalReferer": true, "hideIPAddress": true, "hideQueryParams": true, "hideUserAgent": true, "initPath": "initPath", "injectIframes": true, "mcRootPath": "mcRootPath", "scriptPath": "scriptPath", "trackPath": "trackPath" }, "tools": { "foo": { "blockingTriggers": [ "string" ], "component": "component", "defaultFields": { "foo": "string" }, "enabled": true, "name": "name", "permissions": [ "string" ], "settings": { "foo": "string" }, "type": "component", "actions": { "foo": { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } }, "defaultPurpose": "defaultPurpose", "neoEvents": [ { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } ], "vendorName": "vendorName", "vendorPolicyUrl": "vendorPolicyUrl" } }, "triggers": { "foo": { "excludeRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "loadRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "name": "name", "description": "description", "system": "pageload" } }, "variables": { "foo": { "name": "name", "type": "string", "value": "value" } }, "zarazVersion": 0, "analytics": { "defaultPurpose": "defaultPurpose", "enabled": true, "sessionExpTime": 60 }, "consent": { "enabled": true, "buttonTextTranslations": { "accept_all": { "foo": "string" }, "confirm_my_choices": { "foo": "string" }, "reject_all": { "foo": "string" } }, "companyEmail": "companyEmail", "companyName": "companyName", "companyStreetAddress": "companyStreetAddress", "consentModalIntroHTML": "consentModalIntroHTML", "consentModalIntroHTMLWithTranslations": { "foo": "string" }, "cookieName": "cookieName", "customCSS": "customCSS", "customIntroDisclaimerDismissed": true, "defaultLanguage": "defaultLanguage", "hideModal": true, "purposes": { "foo": { "description": "description", "name": "name" } }, "purposesWithTranslations": { "foo": { "description": { "foo": "string" }, "name": { "foo": "string" }, "order": 0 } }, "tcfCompliant": true }, "historyChange": true }, "success": true } ``` ## Update Zaraz configuration `client.zaraz.config.update(ConfigUpdateParamsparams, RequestOptionsoptions?): Configuration` **put** `/zones/{zone_id}/settings/zaraz/config` Updates Zaraz configuration for a zone. ### Parameters - `params: ConfigUpdateParams` - `zone_id: string` Path param: Identifier. - `dataLayer: boolean` Body param: Data layer compatibility mode enabled. - `debugKey: string` Body param: The key for Zaraz debug mode. - `settings: Settings` Body param: General Zaraz settings. - `autoInjectScript: boolean` Automatic injection of Zaraz scripts enabled. - `contextEnricher?: ContextEnricher` 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` Body param: Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `ZarazManagedComponent` - `blockingTriggers: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "component"` - `"component"` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "custom-mc"` - `"custom-mc"` - `worker: Worker` Cloudflare worker that acts as a managed component. - `escapedWorkerName: string` - `workerTag: string` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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` Body param: Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `excludeRules: Array` Rules defining when the trigger is not fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `loadRules: Array` Rules defining when the trigger is fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `name: string` Trigger name. - `description?: string` Trigger description. - `system?: "pageload"` - `"pageload"` - `variables: Record` Body param: 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. - `ZarazStringVariable` - `name: string` - `type: "string"` - `"string"` - `value: string` - `ZarazSecretVariable` - `name: string` - `type: "secret"` - `"secret"` - `value: string` - `ZarazWorkerVariable` - `name: string` - `type: "worker"` - `"worker"` - `value: Value` - `escapedWorkerName: string` - `workerTag: string` - `zarazVersion: number` Body param: Zaraz internal version of the config. - `analytics?: Analytics` Body param: Cloudflare Monitoring settings. - `defaultPurpose?: string` Consent purpose assigned to Monitoring. - `enabled?: boolean` Whether Advanced Monitoring reports are enabled. - `sessionExpTime?: number` Session expiration time (seconds). - `consent?: Consent` Body param: Consent management configuration. - `enabled: boolean` - `buttonTextTranslations?: ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. - `companyEmail?: string` - `companyName?: string` - `companyStreetAddress?: string` - `consentModalIntroHTML?: string` - `consentModalIntroHTMLWithTranslations?: Record` Object where keys are language codes. - `cookieName?: string` - `customCSS?: string` - `customIntroDisclaimerDismissed?: boolean` - `defaultLanguage?: string` - `hideModal?: boolean` - `purposes?: Record` Object where keys are purpose alpha-numeric IDs. - `description: string` - `name: string` - `purposesWithTranslations?: Record` Object where keys are purpose alpha-numeric IDs. - `description: Record` Object where keys are language codes. - `name: Record` Object where keys are language codes. - `order: number` - `tcfCompliant?: boolean` - `historyChange?: boolean` Body param: Single Page Application support enabled. ### Returns - `Configuration` Zaraz configuration. - `dataLayer: boolean` Data layer compatibility mode enabled. - `debugKey: string` The key for Zaraz debug mode. - `settings: Settings` General Zaraz settings. - `autoInjectScript: boolean` Automatic injection of Zaraz scripts enabled. - `contextEnricher?: ContextEnricher` 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` Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `ZarazManagedComponent` - `blockingTriggers: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "component"` - `"component"` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "custom-mc"` - `"custom-mc"` - `worker: Worker` Cloudflare worker that acts as a managed component. - `escapedWorkerName: string` - `workerTag: string` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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` Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `excludeRules: Array` Rules defining when the trigger is not fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `loadRules: Array` Rules defining when the trigger is fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `name: string` Trigger name. - `description?: string` Trigger description. - `system?: "pageload"` - `"pageload"` - `variables: Record` 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. - `ZarazStringVariable` - `name: string` - `type: "string"` - `"string"` - `value: string` - `ZarazSecretVariable` - `name: string` - `type: "secret"` - `"secret"` - `value: string` - `ZarazWorkerVariable` - `name: string` - `type: "worker"` - `"worker"` - `value: Value` - `escapedWorkerName: string` - `workerTag: string` - `zarazVersion: number` Zaraz internal version of the config. - `analytics?: Analytics` Cloudflare Monitoring settings. - `defaultPurpose?: string` Consent purpose assigned to Monitoring. - `enabled?: boolean` Whether Advanced Monitoring reports are enabled. - `sessionExpTime?: number` Session expiration time (seconds). - `consent?: Consent` Consent management configuration. - `enabled: boolean` - `buttonTextTranslations?: ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. - `companyEmail?: string` - `companyName?: string` - `companyStreetAddress?: string` - `consentModalIntroHTML?: string` - `consentModalIntroHTMLWithTranslations?: Record` Object where keys are language codes. - `cookieName?: string` - `customCSS?: string` - `customIntroDisclaimerDismissed?: boolean` - `defaultLanguage?: string` - `hideModal?: boolean` - `purposes?: Record` Object where keys are purpose alpha-numeric IDs. - `description: string` - `name: string` - `purposesWithTranslations?: Record` Object where keys are purpose alpha-numeric IDs. - `description: Record` Object where keys are language codes. - `name: Record` Object where keys are language codes. - `order: number` - `tcfCompliant?: boolean` - `historyChange?: boolean` Single Page Application support enabled. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const configuration = await client.zaraz.config.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', dataLayer: true, debugKey: 'debugKey', settings: { autoInjectScript: true }, tools: { foo: { blockingTriggers: ['string'], component: 'component', defaultFields: { foo: 'string' }, enabled: true, name: 'name', permissions: ['string'], settings: { foo: 'string' }, type: 'component', }, }, triggers: { foo: { excludeRules: [ { id: 'id', match: 'match', op: 'CONTAINS', value: 'value', }, ], loadRules: [ { id: 'id', match: 'match', op: 'CONTAINS', value: 'value', }, ], name: 'name', }, }, variables: { foo: { name: 'name', type: 'string', value: 'value', }, }, zarazVersion: 0, }); console.log(configuration.dataLayer); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "dataLayer": true, "debugKey": "debugKey", "settings": { "autoInjectScript": true, "contextEnricher": { "escapedWorkerName": "escapedWorkerName", "workerTag": "workerTag" }, "cookieDomain": "cookieDomain", "ecommerce": true, "eventsApiPath": "eventsApiPath", "hideExternalReferer": true, "hideIPAddress": true, "hideQueryParams": true, "hideUserAgent": true, "initPath": "initPath", "injectIframes": true, "mcRootPath": "mcRootPath", "scriptPath": "scriptPath", "trackPath": "trackPath" }, "tools": { "foo": { "blockingTriggers": [ "string" ], "component": "component", "defaultFields": { "foo": "string" }, "enabled": true, "name": "name", "permissions": [ "string" ], "settings": { "foo": "string" }, "type": "component", "actions": { "foo": { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } }, "defaultPurpose": "defaultPurpose", "neoEvents": [ { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } ], "vendorName": "vendorName", "vendorPolicyUrl": "vendorPolicyUrl" } }, "triggers": { "foo": { "excludeRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "loadRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "name": "name", "description": "description", "system": "pageload" } }, "variables": { "foo": { "name": "name", "type": "string", "value": "value" } }, "zarazVersion": 0, "analytics": { "defaultPurpose": "defaultPurpose", "enabled": true, "sessionExpTime": 60 }, "consent": { "enabled": true, "buttonTextTranslations": { "accept_all": { "foo": "string" }, "confirm_my_choices": { "foo": "string" }, "reject_all": { "foo": "string" } }, "companyEmail": "companyEmail", "companyName": "companyName", "companyStreetAddress": "companyStreetAddress", "consentModalIntroHTML": "consentModalIntroHTML", "consentModalIntroHTMLWithTranslations": { "foo": "string" }, "cookieName": "cookieName", "customCSS": "customCSS", "customIntroDisclaimerDismissed": true, "defaultLanguage": "defaultLanguage", "hideModal": true, "purposes": { "foo": { "description": "description", "name": "name" } }, "purposesWithTranslations": { "foo": { "description": { "foo": "string" }, "name": { "foo": "string" }, "order": 0 } }, "tcfCompliant": true }, "historyChange": true }, "success": true } ``` ## Domain Types ### Configuration - `Configuration` Zaraz configuration. - `dataLayer: boolean` Data layer compatibility mode enabled. - `debugKey: string` The key for Zaraz debug mode. - `settings: Settings` General Zaraz settings. - `autoInjectScript: boolean` Automatic injection of Zaraz scripts enabled. - `contextEnricher?: ContextEnricher` 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` Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `ZarazManagedComponent` - `blockingTriggers: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "component"` - `"component"` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "custom-mc"` - `"custom-mc"` - `worker: Worker` Cloudflare worker that acts as a managed component. - `escapedWorkerName: string` - `workerTag: string` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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` Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `excludeRules: Array` Rules defining when the trigger is not fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `loadRules: Array` Rules defining when the trigger is fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `name: string` Trigger name. - `description?: string` Trigger description. - `system?: "pageload"` - `"pageload"` - `variables: Record` 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. - `ZarazStringVariable` - `name: string` - `type: "string"` - `"string"` - `value: string` - `ZarazSecretVariable` - `name: string` - `type: "secret"` - `"secret"` - `value: string` - `ZarazWorkerVariable` - `name: string` - `type: "worker"` - `"worker"` - `value: Value` - `escapedWorkerName: string` - `workerTag: string` - `zarazVersion: number` Zaraz internal version of the config. - `analytics?: Analytics` Cloudflare Monitoring settings. - `defaultPurpose?: string` Consent purpose assigned to Monitoring. - `enabled?: boolean` Whether Advanced Monitoring reports are enabled. - `sessionExpTime?: number` Session expiration time (seconds). - `consent?: Consent` Consent management configuration. - `enabled: boolean` - `buttonTextTranslations?: ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. - `companyEmail?: string` - `companyName?: string` - `companyStreetAddress?: string` - `consentModalIntroHTML?: string` - `consentModalIntroHTMLWithTranslations?: Record` Object where keys are language codes. - `cookieName?: string` - `customCSS?: string` - `customIntroDisclaimerDismissed?: boolean` - `defaultLanguage?: string` - `hideModal?: boolean` - `purposes?: Record` Object where keys are purpose alpha-numeric IDs. - `description: string` - `name: string` - `purposesWithTranslations?: Record` Object where keys are purpose alpha-numeric IDs. - `description: Record` Object where keys are language codes. - `name: Record` Object where keys are language codes. - `order: number` - `tcfCompliant?: boolean` - `historyChange?: boolean` Single Page Application support enabled. # Default ## Get default Zaraz configuration `client.zaraz.default.get(DefaultGetParamsparams, RequestOptionsoptions?): Configuration` **get** `/zones/{zone_id}/settings/zaraz/default` Gets default Zaraz configuration for a zone. ### Parameters - `params: DefaultGetParams` - `zone_id: string` Identifier. ### Returns - `Configuration` Zaraz configuration. - `dataLayer: boolean` Data layer compatibility mode enabled. - `debugKey: string` The key for Zaraz debug mode. - `settings: Settings` General Zaraz settings. - `autoInjectScript: boolean` Automatic injection of Zaraz scripts enabled. - `contextEnricher?: ContextEnricher` 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` Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `ZarazManagedComponent` - `blockingTriggers: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "component"` - `"component"` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "custom-mc"` - `"custom-mc"` - `worker: Worker` Cloudflare worker that acts as a managed component. - `escapedWorkerName: string` - `workerTag: string` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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` Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `excludeRules: Array` Rules defining when the trigger is not fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `loadRules: Array` Rules defining when the trigger is fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `name: string` Trigger name. - `description?: string` Trigger description. - `system?: "pageload"` - `"pageload"` - `variables: Record` 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. - `ZarazStringVariable` - `name: string` - `type: "string"` - `"string"` - `value: string` - `ZarazSecretVariable` - `name: string` - `type: "secret"` - `"secret"` - `value: string` - `ZarazWorkerVariable` - `name: string` - `type: "worker"` - `"worker"` - `value: Value` - `escapedWorkerName: string` - `workerTag: string` - `zarazVersion: number` Zaraz internal version of the config. - `analytics?: Analytics` Cloudflare Monitoring settings. - `defaultPurpose?: string` Consent purpose assigned to Monitoring. - `enabled?: boolean` Whether Advanced Monitoring reports are enabled. - `sessionExpTime?: number` Session expiration time (seconds). - `consent?: Consent` Consent management configuration. - `enabled: boolean` - `buttonTextTranslations?: ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. - `companyEmail?: string` - `companyName?: string` - `companyStreetAddress?: string` - `consentModalIntroHTML?: string` - `consentModalIntroHTMLWithTranslations?: Record` Object where keys are language codes. - `cookieName?: string` - `customCSS?: string` - `customIntroDisclaimerDismissed?: boolean` - `defaultLanguage?: string` - `hideModal?: boolean` - `purposes?: Record` Object where keys are purpose alpha-numeric IDs. - `description: string` - `name: string` - `purposesWithTranslations?: Record` Object where keys are purpose alpha-numeric IDs. - `description: Record` Object where keys are language codes. - `name: Record` Object where keys are language codes. - `order: number` - `tcfCompliant?: boolean` - `historyChange?: boolean` Single Page Application support enabled. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const configuration = await client.zaraz.default.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(configuration.dataLayer); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "dataLayer": true, "debugKey": "debugKey", "settings": { "autoInjectScript": true, "contextEnricher": { "escapedWorkerName": "escapedWorkerName", "workerTag": "workerTag" }, "cookieDomain": "cookieDomain", "ecommerce": true, "eventsApiPath": "eventsApiPath", "hideExternalReferer": true, "hideIPAddress": true, "hideQueryParams": true, "hideUserAgent": true, "initPath": "initPath", "injectIframes": true, "mcRootPath": "mcRootPath", "scriptPath": "scriptPath", "trackPath": "trackPath" }, "tools": { "foo": { "blockingTriggers": [ "string" ], "component": "component", "defaultFields": { "foo": "string" }, "enabled": true, "name": "name", "permissions": [ "string" ], "settings": { "foo": "string" }, "type": "component", "actions": { "foo": { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } }, "defaultPurpose": "defaultPurpose", "neoEvents": [ { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } ], "vendorName": "vendorName", "vendorPolicyUrl": "vendorPolicyUrl" } }, "triggers": { "foo": { "excludeRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "loadRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "name": "name", "description": "description", "system": "pageload" } }, "variables": { "foo": { "name": "name", "type": "string", "value": "value" } }, "zarazVersion": 0, "analytics": { "defaultPurpose": "defaultPurpose", "enabled": true, "sessionExpTime": 60 }, "consent": { "enabled": true, "buttonTextTranslations": { "accept_all": { "foo": "string" }, "confirm_my_choices": { "foo": "string" }, "reject_all": { "foo": "string" } }, "companyEmail": "companyEmail", "companyName": "companyName", "companyStreetAddress": "companyStreetAddress", "consentModalIntroHTML": "consentModalIntroHTML", "consentModalIntroHTMLWithTranslations": { "foo": "string" }, "cookieName": "cookieName", "customCSS": "customCSS", "customIntroDisclaimerDismissed": true, "defaultLanguage": "defaultLanguage", "hideModal": true, "purposes": { "foo": { "description": "description", "name": "name" } }, "purposesWithTranslations": { "foo": { "description": { "foo": "string" }, "name": { "foo": "string" }, "order": 0 } }, "tcfCompliant": true }, "historyChange": true }, "success": true } ``` # Export ## Export Zaraz configuration `client.zaraz.export.get(ExportGetParamsparams, RequestOptionsoptions?): Configuration` **get** `/zones/{zone_id}/settings/zaraz/export` Exports full current published Zaraz configuration for a zone, secret variables included. ### Parameters - `params: ExportGetParams` - `zone_id: string` Identifier. ### Returns - `Configuration` Zaraz configuration. - `dataLayer: boolean` Data layer compatibility mode enabled. - `debugKey: string` The key for Zaraz debug mode. - `settings: Settings` General Zaraz settings. - `autoInjectScript: boolean` Automatic injection of Zaraz scripts enabled. - `contextEnricher?: ContextEnricher` 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` Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `ZarazManagedComponent` - `blockingTriggers: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "component"` - `"component"` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "custom-mc"` - `"custom-mc"` - `worker: Worker` Cloudflare worker that acts as a managed component. - `escapedWorkerName: string` - `workerTag: string` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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` Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `excludeRules: Array` Rules defining when the trigger is not fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `loadRules: Array` Rules defining when the trigger is fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `name: string` Trigger name. - `description?: string` Trigger description. - `system?: "pageload"` - `"pageload"` - `variables: Record` 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. - `ZarazStringVariable` - `name: string` - `type: "string"` - `"string"` - `value: string` - `ZarazSecretVariable` - `name: string` - `type: "secret"` - `"secret"` - `value: string` - `ZarazWorkerVariable` - `name: string` - `type: "worker"` - `"worker"` - `value: Value` - `escapedWorkerName: string` - `workerTag: string` - `zarazVersion: number` Zaraz internal version of the config. - `analytics?: Analytics` Cloudflare Monitoring settings. - `defaultPurpose?: string` Consent purpose assigned to Monitoring. - `enabled?: boolean` Whether Advanced Monitoring reports are enabled. - `sessionExpTime?: number` Session expiration time (seconds). - `consent?: Consent` Consent management configuration. - `enabled: boolean` - `buttonTextTranslations?: ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. - `companyEmail?: string` - `companyName?: string` - `companyStreetAddress?: string` - `consentModalIntroHTML?: string` - `consentModalIntroHTMLWithTranslations?: Record` Object where keys are language codes. - `cookieName?: string` - `customCSS?: string` - `customIntroDisclaimerDismissed?: boolean` - `defaultLanguage?: string` - `hideModal?: boolean` - `purposes?: Record` Object where keys are purpose alpha-numeric IDs. - `description: string` - `name: string` - `purposesWithTranslations?: Record` Object where keys are purpose alpha-numeric IDs. - `description: Record` Object where keys are language codes. - `name: Record` Object where keys are language codes. - `order: number` - `tcfCompliant?: boolean` - `historyChange?: boolean` Single Page Application support enabled. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const configuration = await client.zaraz.export.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(configuration.dataLayer); ``` #### Response ```json { "dataLayer": true, "debugKey": "debugKey", "settings": { "autoInjectScript": true, "contextEnricher": { "escapedWorkerName": "escapedWorkerName", "workerTag": "workerTag" }, "cookieDomain": "cookieDomain", "ecommerce": true, "eventsApiPath": "eventsApiPath", "hideExternalReferer": true, "hideIPAddress": true, "hideQueryParams": true, "hideUserAgent": true, "initPath": "initPath", "injectIframes": true, "mcRootPath": "mcRootPath", "scriptPath": "scriptPath", "trackPath": "trackPath" }, "tools": { "foo": { "blockingTriggers": [ "string" ], "component": "component", "defaultFields": { "foo": "string" }, "enabled": true, "name": "name", "permissions": [ "string" ], "settings": { "foo": "string" }, "type": "component", "actions": { "foo": { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } }, "defaultPurpose": "defaultPurpose", "neoEvents": [ { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } ], "vendorName": "vendorName", "vendorPolicyUrl": "vendorPolicyUrl" } }, "triggers": { "foo": { "excludeRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "loadRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "name": "name", "description": "description", "system": "pageload" } }, "variables": { "foo": { "name": "name", "type": "string", "value": "value" } }, "zarazVersion": 0, "analytics": { "defaultPurpose": "defaultPurpose", "enabled": true, "sessionExpTime": 60 }, "consent": { "enabled": true, "buttonTextTranslations": { "accept_all": { "foo": "string" }, "confirm_my_choices": { "foo": "string" }, "reject_all": { "foo": "string" } }, "companyEmail": "companyEmail", "companyName": "companyName", "companyStreetAddress": "companyStreetAddress", "consentModalIntroHTML": "consentModalIntroHTML", "consentModalIntroHTMLWithTranslations": { "foo": "string" }, "cookieName": "cookieName", "customCSS": "customCSS", "customIntroDisclaimerDismissed": true, "defaultLanguage": "defaultLanguage", "hideModal": true, "purposes": { "foo": { "description": "description", "name": "name" } }, "purposesWithTranslations": { "foo": { "description": { "foo": "string" }, "name": { "foo": "string" }, "order": 0 } }, "tcfCompliant": true }, "historyChange": true } ``` # History ## List Zaraz historical configuration records `client.zaraz.history.list(HistoryListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/zones/{zone_id}/settings/zaraz/history` Lists a history of published Zaraz configuration records for a zone. ### Parameters - `params: HistoryListParams` - `zone_id: string` Path param: Identifier. - `limit?: number` Query param: Maximum amount of results to list. Default value is 10. - `offset?: number` Query param: Ordinal number to start listing the results with. Default value is 0. - `sortField?: "id" | "user_id" | "description" | 2 more` Query param: The field to sort by. Default is updated_at. - `"id"` - `"user_id"` - `"description"` - `"created_at"` - `"updated_at"` - `sortOrder?: "DESC" | "ASC"` Query param: Sorting order. Default is DESC. - `"DESC"` - `"ASC"` ### Returns - `HistoryListResponse` - `id: number` ID of the configuration. - `createdAt: string` Date and time the configuration was created. - `description: string` Configuration description provided by the user who published this configuration. - `updatedAt: string` Date and time the configuration was last updated. - `userId: string` Alpha-numeric ID of the account user who published the configuration. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const historyListResponse of client.zaraz.history.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(historyListResponse.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": 0, "createdAt": "2019-12-27T18:11:19.117Z", "description": "description", "updatedAt": "2019-12-27T18:11:19.117Z", "userId": "userId" } ], "success": true } ``` ## Restore Zaraz historical configuration by ID `client.zaraz.history.update(HistoryUpdateParamsparams, RequestOptionsoptions?): Configuration` **put** `/zones/{zone_id}/settings/zaraz/history` Restores a historical published Zaraz configuration by ID for a zone. ### Parameters - `params: HistoryUpdateParams` - `zone_id: string` Path param: Identifier. - `body: number` Body param: ID of the Zaraz configuration to restore. ### Returns - `Configuration` Zaraz configuration. - `dataLayer: boolean` Data layer compatibility mode enabled. - `debugKey: string` The key for Zaraz debug mode. - `settings: Settings` General Zaraz settings. - `autoInjectScript: boolean` Automatic injection of Zaraz scripts enabled. - `contextEnricher?: ContextEnricher` 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` Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `ZarazManagedComponent` - `blockingTriggers: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "component"` - `"component"` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "custom-mc"` - `"custom-mc"` - `worker: Worker` Cloudflare worker that acts as a managed component. - `escapedWorkerName: string` - `workerTag: string` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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` Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `excludeRules: Array` Rules defining when the trigger is not fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `loadRules: Array` Rules defining when the trigger is fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `name: string` Trigger name. - `description?: string` Trigger description. - `system?: "pageload"` - `"pageload"` - `variables: Record` 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. - `ZarazStringVariable` - `name: string` - `type: "string"` - `"string"` - `value: string` - `ZarazSecretVariable` - `name: string` - `type: "secret"` - `"secret"` - `value: string` - `ZarazWorkerVariable` - `name: string` - `type: "worker"` - `"worker"` - `value: Value` - `escapedWorkerName: string` - `workerTag: string` - `zarazVersion: number` Zaraz internal version of the config. - `analytics?: Analytics` Cloudflare Monitoring settings. - `defaultPurpose?: string` Consent purpose assigned to Monitoring. - `enabled?: boolean` Whether Advanced Monitoring reports are enabled. - `sessionExpTime?: number` Session expiration time (seconds). - `consent?: Consent` Consent management configuration. - `enabled: boolean` - `buttonTextTranslations?: ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. - `companyEmail?: string` - `companyName?: string` - `companyStreetAddress?: string` - `consentModalIntroHTML?: string` - `consentModalIntroHTMLWithTranslations?: Record` Object where keys are language codes. - `cookieName?: string` - `customCSS?: string` - `customIntroDisclaimerDismissed?: boolean` - `defaultLanguage?: string` - `hideModal?: boolean` - `purposes?: Record` Object where keys are purpose alpha-numeric IDs. - `description: string` - `name: string` - `purposesWithTranslations?: Record` Object where keys are purpose alpha-numeric IDs. - `description: Record` Object where keys are language codes. - `name: Record` Object where keys are language codes. - `order: number` - `tcfCompliant?: boolean` - `historyChange?: boolean` Single Page Application support enabled. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const configuration = await client.zaraz.history.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', body: 12345, }); console.log(configuration.dataLayer); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "dataLayer": true, "debugKey": "debugKey", "settings": { "autoInjectScript": true, "contextEnricher": { "escapedWorkerName": "escapedWorkerName", "workerTag": "workerTag" }, "cookieDomain": "cookieDomain", "ecommerce": true, "eventsApiPath": "eventsApiPath", "hideExternalReferer": true, "hideIPAddress": true, "hideQueryParams": true, "hideUserAgent": true, "initPath": "initPath", "injectIframes": true, "mcRootPath": "mcRootPath", "scriptPath": "scriptPath", "trackPath": "trackPath" }, "tools": { "foo": { "blockingTriggers": [ "string" ], "component": "component", "defaultFields": { "foo": "string" }, "enabled": true, "name": "name", "permissions": [ "string" ], "settings": { "foo": "string" }, "type": "component", "actions": { "foo": { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } }, "defaultPurpose": "defaultPurpose", "neoEvents": [ { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } ], "vendorName": "vendorName", "vendorPolicyUrl": "vendorPolicyUrl" } }, "triggers": { "foo": { "excludeRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "loadRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "name": "name", "description": "description", "system": "pageload" } }, "variables": { "foo": { "name": "name", "type": "string", "value": "value" } }, "zarazVersion": 0, "analytics": { "defaultPurpose": "defaultPurpose", "enabled": true, "sessionExpTime": 60 }, "consent": { "enabled": true, "buttonTextTranslations": { "accept_all": { "foo": "string" }, "confirm_my_choices": { "foo": "string" }, "reject_all": { "foo": "string" } }, "companyEmail": "companyEmail", "companyName": "companyName", "companyStreetAddress": "companyStreetAddress", "consentModalIntroHTML": "consentModalIntroHTML", "consentModalIntroHTMLWithTranslations": { "foo": "string" }, "cookieName": "cookieName", "customCSS": "customCSS", "customIntroDisclaimerDismissed": true, "defaultLanguage": "defaultLanguage", "hideModal": true, "purposes": { "foo": { "description": "description", "name": "name" } }, "purposesWithTranslations": { "foo": { "description": { "foo": "string" }, "name": { "foo": "string" }, "order": 0 } }, "tcfCompliant": true }, "historyChange": true }, "success": true } ``` ## Domain Types ### History List Response - `HistoryListResponse` - `id: number` ID of the configuration. - `createdAt: string` Date and time the configuration was created. - `description: string` Configuration description provided by the user who published this configuration. - `updatedAt: string` Date and time the configuration was last updated. - `userId: string` Alpha-numeric ID of the account user who published the configuration. # Configs ## Get Zaraz historical configurations by ID(s) `client.zaraz.history.configs.get(ConfigGetParamsparams, RequestOptionsoptions?): ConfigGetResponse` **get** `/zones/{zone_id}/settings/zaraz/history/configs` Gets a history of published Zaraz configurations by ID(s) for a zone. ### Parameters - `params: ConfigGetParams` - `zone_id: string` Path param: Identifier. - `ids: Array` Query param: Comma separated list of Zaraz configuration IDs. ### Returns - `ConfigGetResponse = Record` Object where keys are numeric configuration IDs. - `id: number` ID of the configuration. - `config: Configuration` Zaraz configuration. - `dataLayer: boolean` Data layer compatibility mode enabled. - `debugKey: string` The key for Zaraz debug mode. - `settings: Settings` General Zaraz settings. - `autoInjectScript: boolean` Automatic injection of Zaraz scripts enabled. - `contextEnricher?: ContextEnricher` 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` Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `ZarazManagedComponent` - `blockingTriggers: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "component"` - `"component"` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "custom-mc"` - `"custom-mc"` - `worker: Worker` Cloudflare worker that acts as a managed component. - `escapedWorkerName: string` - `workerTag: string` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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` Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `excludeRules: Array` Rules defining when the trigger is not fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `loadRules: Array` Rules defining when the trigger is fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `name: string` Trigger name. - `description?: string` Trigger description. - `system?: "pageload"` - `"pageload"` - `variables: Record` 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. - `ZarazStringVariable` - `name: string` - `type: "string"` - `"string"` - `value: string` - `ZarazSecretVariable` - `name: string` - `type: "secret"` - `"secret"` - `value: string` - `ZarazWorkerVariable` - `name: string` - `type: "worker"` - `"worker"` - `value: Value` - `escapedWorkerName: string` - `workerTag: string` - `zarazVersion: number` Zaraz internal version of the config. - `analytics?: Analytics` Cloudflare Monitoring settings. - `defaultPurpose?: string` Consent purpose assigned to Monitoring. - `enabled?: boolean` Whether Advanced Monitoring reports are enabled. - `sessionExpTime?: number` Session expiration time (seconds). - `consent?: Consent` Consent management configuration. - `enabled: boolean` - `buttonTextTranslations?: ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. - `companyEmail?: string` - `companyName?: string` - `companyStreetAddress?: string` - `consentModalIntroHTML?: string` - `consentModalIntroHTMLWithTranslations?: Record` Object where keys are language codes. - `cookieName?: string` - `customCSS?: string` - `customIntroDisclaimerDismissed?: boolean` - `defaultLanguage?: string` - `hideModal?: boolean` - `purposes?: Record` Object where keys are purpose alpha-numeric IDs. - `description: string` - `name: string` - `purposesWithTranslations?: Record` Object where keys are purpose alpha-numeric IDs. - `description: Record` Object where keys are language codes. - `name: Record` Object where keys are language codes. - `order: number` - `tcfCompliant?: boolean` - `historyChange?: boolean` Single Page Application support enabled. - `createdAt: string` Date and time the configuration was created. - `updatedAt: string` Date and time the configuration was last updated. - `userId: string` Alpha-numeric ID of the account user who published the configuration. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const config = await client.zaraz.history.configs.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', ids: [0], }); console.log(config); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "foo": { "id": 0, "config": { "dataLayer": true, "debugKey": "debugKey", "settings": { "autoInjectScript": true, "contextEnricher": { "escapedWorkerName": "escapedWorkerName", "workerTag": "workerTag" }, "cookieDomain": "cookieDomain", "ecommerce": true, "eventsApiPath": "eventsApiPath", "hideExternalReferer": true, "hideIPAddress": true, "hideQueryParams": true, "hideUserAgent": true, "initPath": "initPath", "injectIframes": true, "mcRootPath": "mcRootPath", "scriptPath": "scriptPath", "trackPath": "trackPath" }, "tools": { "foo": { "blockingTriggers": [ "string" ], "component": "component", "defaultFields": { "foo": "string" }, "enabled": true, "name": "name", "permissions": [ "string" ], "settings": { "foo": "string" }, "type": "component", "actions": { "foo": { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } }, "defaultPurpose": "defaultPurpose", "neoEvents": [ { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } ], "vendorName": "vendorName", "vendorPolicyUrl": "vendorPolicyUrl" } }, "triggers": { "foo": { "excludeRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "loadRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "name": "name", "description": "description", "system": "pageload" } }, "variables": { "foo": { "name": "name", "type": "string", "value": "value" } }, "zarazVersion": 0, "analytics": { "defaultPurpose": "defaultPurpose", "enabled": true, "sessionExpTime": 60 }, "consent": { "enabled": true, "buttonTextTranslations": { "accept_all": { "foo": "string" }, "confirm_my_choices": { "foo": "string" }, "reject_all": { "foo": "string" } }, "companyEmail": "companyEmail", "companyName": "companyName", "companyStreetAddress": "companyStreetAddress", "consentModalIntroHTML": "consentModalIntroHTML", "consentModalIntroHTMLWithTranslations": { "foo": "string" }, "cookieName": "cookieName", "customCSS": "customCSS", "customIntroDisclaimerDismissed": true, "defaultLanguage": "defaultLanguage", "hideModal": true, "purposes": { "foo": { "description": "description", "name": "name" } }, "purposesWithTranslations": { "foo": { "description": { "foo": "string" }, "name": { "foo": "string" }, "order": 0 } }, "tcfCompliant": true }, "historyChange": true }, "createdAt": "2019-12-27T18:11:19.117Z", "updatedAt": "2019-12-27T18:11:19.117Z", "userId": "userId" } }, "success": true } ``` ## Domain Types ### Config Get Response - `ConfigGetResponse = Record` Object where keys are numeric configuration IDs. - `id: number` ID of the configuration. - `config: Configuration` Zaraz configuration. - `dataLayer: boolean` Data layer compatibility mode enabled. - `debugKey: string` The key for Zaraz debug mode. - `settings: Settings` General Zaraz settings. - `autoInjectScript: boolean` Automatic injection of Zaraz scripts enabled. - `contextEnricher?: ContextEnricher` 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` Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `ZarazManagedComponent` - `blockingTriggers: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "component"` - `"component"` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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: Array` List of blocking trigger IDs. - `component: string` Tool's internal name. - `defaultFields: Record` Default fields for tool's actions. - `string` - `boolean` - `enabled: boolean` Whether tool is enabled. - `name: string` Tool's name defined by the user. - `permissions: Array` List of permissions granted to the component. - `settings: Record` Tool's settings. - `string` - `boolean` - `type: "custom-mc"` - `"custom-mc"` - `worker: Worker` Cloudflare worker that acts as a managed component. - `escapedWorkerName: string` - `workerTag: string` - `actions?: Record` Actions configured on a tool. Either this or neoEvents field is required. - `actionType: string` Tool event type. - `blockingTriggers: Array` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` List of firing triggers IDs. - `defaultPurpose?: string` Default consent purpose ID. - `neoEvents?: Array` 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` List of blocking triggers IDs. - `data: unknown` Event payload. - `firingTriggers: Array` 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` Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `excludeRules: Array` Rules defining when the trigger is not fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `loadRules: Array` Rules defining when the trigger is fired. - `ZarazLoadRule` - `id: string` - `match: string` - `op: "CONTAINS" | "EQUALS" | "STARTS_WITH" | 7 more` - `"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: string` - `action: "clickListener"` - `"clickListener"` - `settings: Settings` - `selector: string` - `type: "xpath" | "css"` - `"xpath"` - `"css"` - `waitForTags: number` - `ZarazTimerRule` - `id: string` - `action: "timer"` - `"timer"` - `settings: Settings` - `interval: number` - `limit: number` - `ZarazFormSubmissionRule` - `id: string` - `action: "formSubmission"` - `"formSubmission"` - `settings: Settings` - `selector: string` - `validate: boolean` - `ZarazVariableMatchRule` - `id: string` - `action: "variableMatch"` - `"variableMatch"` - `settings: Settings` - `match: string` - `variable: string` - `ZarazScrollDepthRule` - `id: string` - `action: "scrollDepth"` - `"scrollDepth"` - `settings: Settings` - `positions: string` - `ZarazElementVisibilityRule` - `id: string` - `action: "elementVisibility"` - `"elementVisibility"` - `settings: Settings` - `selector: string` - `name: string` Trigger name. - `description?: string` Trigger description. - `system?: "pageload"` - `"pageload"` - `variables: Record` 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. - `ZarazStringVariable` - `name: string` - `type: "string"` - `"string"` - `value: string` - `ZarazSecretVariable` - `name: string` - `type: "secret"` - `"secret"` - `value: string` - `ZarazWorkerVariable` - `name: string` - `type: "worker"` - `"worker"` - `value: Value` - `escapedWorkerName: string` - `workerTag: string` - `zarazVersion: number` Zaraz internal version of the config. - `analytics?: Analytics` Cloudflare Monitoring settings. - `defaultPurpose?: string` Consent purpose assigned to Monitoring. - `enabled?: boolean` Whether Advanced Monitoring reports are enabled. - `sessionExpTime?: number` Session expiration time (seconds). - `consent?: Consent` Consent management configuration. - `enabled: boolean` - `buttonTextTranslations?: ButtonTextTranslation` - `accept_all: Record` Object where keys are language codes. - `confirm_my_choices: Record` Object where keys are language codes. - `reject_all: Record` Object where keys are language codes. - `companyEmail?: string` - `companyName?: string` - `companyStreetAddress?: string` - `consentModalIntroHTML?: string` - `consentModalIntroHTMLWithTranslations?: Record` Object where keys are language codes. - `cookieName?: string` - `customCSS?: string` - `customIntroDisclaimerDismissed?: boolean` - `defaultLanguage?: string` - `hideModal?: boolean` - `purposes?: Record` Object where keys are purpose alpha-numeric IDs. - `description: string` - `name: string` - `purposesWithTranslations?: Record` Object where keys are purpose alpha-numeric IDs. - `description: Record` Object where keys are language codes. - `name: Record` Object where keys are language codes. - `order: number` - `tcfCompliant?: boolean` - `historyChange?: boolean` Single Page Application support enabled. - `createdAt: string` Date and time the configuration was created. - `updatedAt: string` Date and time the configuration was last updated. - `userId: string` Alpha-numeric ID of the account user who published the configuration. # Publish ## Publish Zaraz preview configuration `client.zaraz.publish.create(PublishCreateParamsparams, RequestOptionsoptions?): PublishCreateResponse` **post** `/zones/{zone_id}/settings/zaraz/publish` Publish current Zaraz preview configuration for a zone. ### Parameters - `params: PublishCreateParams` - `zone_id: string` Path param: Identifier. - `body?: string` Body param: Zaraz configuration description. ### Returns - `PublishCreateResponse = string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const publish = await client.zaraz.publish.create({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); console.log(publish); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": "Config has been published successfully", "success": true } ``` ## Domain Types ### Publish Create Response - `PublishCreateResponse = string` # Workflow ## Get Zaraz workflow `client.zaraz.workflow.get(WorkflowGetParamsparams, RequestOptionsoptions?): Workflow` **get** `/zones/{zone_id}/settings/zaraz/workflow` Gets Zaraz workflow for a zone. ### Parameters - `params: WorkflowGetParams` - `zone_id: string` Identifier. ### Returns - `Workflow = "realtime" | "preview"` Zaraz workflow. - `"realtime"` - `"preview"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const workflow = await client.zaraz.workflow.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); console.log(workflow); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": "realtime", "success": true } ``` ## Domain Types ### Workflow - `Workflow = "realtime" | "preview"` Zaraz workflow. - `"realtime"` - `"preview"`