Add a Tag to a container
https://api.ocamba.com/v1/hood/containers/{container_id}/tags
https://api.ocamba.com/v1/hood/containers/{container_id}/tags
Add a Tag to a container
Rate limits:
Burst: 10/s
Steady: 150/m
Name
Descriptioncontainer_idstringrequired
Unique Container identifier.Example: 12345
Name
Descriptionfilters[ tag-filter ]
Tag filter
Name
Descriptionfilters[ object ]
Array of filter objects. This object is the same as the tag filter object(including this field).opstring
Filter operator.Possible values: eq | neq | lt | lte | gt | gte | is-set | is-not-set | is-empty | is-not-empty | is-true | is-false | contains | not-contains | starts-with | not-starts-with | ends-with | not-ends-with | match-css | not-match-css | match-regex | not-match-regex | match-regex-no-case | not-match-regex-no-case
valuestring
Filter value. Minimum 1, maximum 1000 characters.Example: Some-value
variablestring
Variable to filter. You can add either system or user-defined variables, and each variable must have a valid id.Example: campaign
google_tag_idstring
Google tag id, only available for google-analytics type tags. Required if type of tag is google-analytics.Example: GT-1NJSO23B
js_codestringrequired
Js code for custom-code or google-analytics type tag. Maximum length 102400 characters. For google-analytics type tags, it is the google tag snippet code and not settable by user.Example: var modal = document.createElement('div'); modal.style.position = 'fixed'; modal.style.top = '50%'; modal.style.left = '50%'; modal.style.transform = 'translate(-50%, -50%)'; modal.style.width = '300px'; modal.style.height = '150px'; modal.style.backgroundColor = 'white'; modal.style.border = '2px solid #000'; modal.style.zIndex = '9999'; modal.style.padding = '24px'; modal.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.1)'; modal.style.textAlign = 'center'; modal.style.display = 'none'; // Hidden by default var modalMessage = document.createElement('p'); modalMessage.innerText = 'This is a modal created via Tag Manager!'; modal.appendChild(modalMessage); var closeButton = document.createElement('button'); closeButton.innerText = 'Close'; closeButton.style.marginTop = '10px'; closeButton.onclick = function() { modal.style.display = 'none'; modal.appendChild(closeButton);
namestringrequired
Name of the Container Tag. Must be unique per container.Example: Container Tag Example
targetstringrequired
Describes the element into which the tag will be inserted. Can be head, body, before-body-end, before-head-end or a custom css selector. Maximum 100 charactersExample: head
triggersobjectrequired
Name
Descriptionconsent_initiationboolean
Describes if consent initiation trigger is turned on.element_visibility[ tag-element-visibility ]
Allows to set tag to fire when certain elements of a page are visible.element-visibility
Name
Descriptionmin_on_screen_timenumber (integer)
Minimum on screen time of the element for trigger to fire in milliseconds. Minimum value 100, maximum value 30000.Example: 200
min_percent_visiblenumber (decimal)
Minimum percentage of element visible to fire the trigger. Minimum value 1, maximum value 100.Example: 2.22
observe_dom_changesboolean
Example: true
selectorstring
Identifies the correct element to select. Accepts both css selector name and element id. Maximum length 50 characters.Example: .class
when_to_firestring
Describes when the tag is fired.Example: once-per-page
Possible values: once-per-page | once-per-element | every-time
form_submissionobject
Name
Descriptioncheck_validationboolean
Describes if trigger should check if the form meets validation rules before firing.wait_for_tagsnumber (integer)
Describes how long the trigger will wait for additional tags before firing in milliseconds. Minimum value 100, maximum 30000.Example: 1200
page_viewboolean
Describes if page view trigger is turned on.scroll_depthobject
Name
Descriptionenable_onstring
Describes when the trigger will be loaded.Example: window-load
Possible values: container-load | window-load | dom-ready
horizontalscroll-options
Allows the user to finely tune the conditions for firing a tag based on user horizontal scroll behaviour.Scroll options
Name
Descriptionpercentagenumber (integer)
Describes how far a user needs to scroll for tag to fire in pixels. Minimum 1, maximum 100.Example: 75
pixelsnumber (integer)
Describes how far a user needs to scroll for tag to fire in pixels. Minimum 1, maximum 3840.Example: 1223
verticalscroll-options
Allows the user to finely tune the conditions for firing a tag based on user horizontal scroll behaviour.typestringrequired
Describes the type of tag.Example: custom-code
Possible values: custom-code | google-analytics
201 - Created
Name
Descriptionfilters[ tag-filter ]
Tag filter
Name
Descriptionfilters[ object ]
Array of filter objects. This object is the same as the tag filter object(including this field).opstring
Filter operator.Possible values: eq | neq | lt | lte | gt | gte | is-set | is-not-set | is-empty | is-not-empty | is-true | is-false | contains | not-contains | starts-with | not-starts-with | ends-with | not-ends-with | match-css | not-match-css | match-regex | not-match-regex | match-regex-no-case | not-match-regex-no-case
valuestring
Filter value. Minimum 1, maximum 1000 characters.Example: Some-value
variablestring
Variable to filter. You can add either system or user-defined variables, and each variable must have a valid id.Example: campaign
google_tag_idstring
Google tag id, only available for google-analytics type tags. Required if type of tag is google-analytics.Example: GT-1NJSO23B
js_codestringrequired
Js code for custom-code or google-analytics type tag. Maximum length 102400 characters. For google-analytics type tags, it is the google tag snippet code and not settable by user.Example: var modal = document.createElement('div'); modal.style.position = 'fixed'; modal.style.top = '50%'; modal.style.left = '50%'; modal.style.transform = 'translate(-50%, -50%)'; modal.style.width = '300px'; modal.style.height = '150px'; modal.style.backgroundColor = 'white'; modal.style.border = '2px solid #000'; modal.style.zIndex = '9999'; modal.style.padding = '24px'; modal.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.1)'; modal.style.textAlign = 'center'; modal.style.display = 'none'; // Hidden by default var modalMessage = document.createElement('p'); modalMessage.innerText = 'This is a modal created via Tag Manager!'; modal.appendChild(modalMessage); var closeButton = document.createElement('button'); closeButton.innerText = 'Close'; closeButton.style.marginTop = '10px'; closeButton.onclick = function() { modal.style.display = 'none'; modal.appendChild(closeButton);
namestringrequired
Name of the Container Tag. Must be unique per container.Example: Container Tag Example
targetstringrequired
Describes the element into which the tag will be inserted. Can be head, body, before-body-end, before-head-end or a custom css selector. Maximum 100 charactersExample: head
triggersobjectrequired
Name
Descriptionconsent_initiationboolean
Describes if consent initiation trigger is turned on.element_visibility[ tag-element-visibility ]
Allows to set tag to fire when certain elements of a page are visible.element-visibility
Name
Descriptionmin_on_screen_timenumber (integer)
Minimum on screen time of the element for trigger to fire in milliseconds. Minimum value 100, maximum value 30000.Example: 200
min_percent_visiblenumber (decimal)
Minimum percentage of element visible to fire the trigger. Minimum value 1, maximum value 100.Example: 2.22
observe_dom_changesboolean
Example: true
selectorstring
Identifies the correct element to select. Accepts both css selector name and element id. Maximum length 50 characters.Example: .class
when_to_firestring
Describes when the tag is fired.Example: once-per-page
Possible values: once-per-page | once-per-element | every-time
form_submissionobject
Name
Descriptioncheck_validationboolean
Describes if trigger should check if the form meets validation rules before firing.wait_for_tagsnumber (integer)
Describes how long the trigger will wait for additional tags before firing in milliseconds. Minimum value 100, maximum 30000.Example: 1200
page_viewboolean
Describes if page view trigger is turned on.scroll_depthobject
Name
Descriptionenable_onstring
Describes when the trigger will be loaded.Example: window-load
Possible values: container-load | window-load | dom-ready
horizontalscroll-options
Allows the user to finely tune the conditions for firing a tag based on user horizontal scroll behaviour.Scroll options
Name
Descriptionpercentagenumber (integer)
Describes how far a user needs to scroll for tag to fire in pixels. Minimum 1, maximum 100.Example: 75
pixelsnumber (integer)
Describes how far a user needs to scroll for tag to fire in pixels. Minimum 1, maximum 3840.Example: 1223
verticalscroll-options
Allows the user to finely tune the conditions for firing a tag based on user horizontal scroll behaviour.typestringrequired
Describes the type of tag.Example: custom-code
Possible values: custom-code | google-analytics
400 - Bad Request
Name
Descriptioncodeinteger
Http response status code.Example: 400
messagestring
The human readable message that describes how to deal with error.Example: The request body is not valid.
titlestring
The error title.Example: Bad request.
trace_idstring
Error trace id.Example: 99a84211-f73d-4ff8-acdf-eb3e06bb9d62
500 - Internal Server Error
Name
Descriptioncodeinteger
Http response status code.Example: 500
titlestring
The error title.Example: Internal server error.
trace_idstring
Error trace id.Example: 99a84211-f73d-4ff8-acdf-eb3e06bb9d62