_czc compatibility
The native namespace is window.openstatx. The SDK only takes over window._czc when the script tag has data-czc-compat="true"; once "_czc compatibility" is enabled in site settings, the standard snippet generated on the install page includes this attribute automatically.
| Command | Behavior |
|---|---|
_czc.push(["_trackPageview", content_url, referer_url]) | Records one PV; content_url is a site-relative path, referer_url is optional |
_czc.push(["_trackEvent", category, action, label, value, nodeid]) | Records a custom event; category and action are required, value is an integer |
_czc.push(["_setCustomVar", name, value, time]) | Sets a custom variable (must be on the attribute allowlist); time=1 stores it in this site's localStorage (long-term, until _deleteCustomVar); any other value, or omitting it, keeps it only for the current page lifetime (preserved across SPA route changes). This differs from the legacy analytics service's default: omitting time does not store it long-term |
_czc.push(["_deleteCustomVar", name]) | Deletes a custom variable |
_czc.push(["_setAccount", account_id]) | Can only switch to a site already mapped in this workspace; cannot write to other sites |
_czc.push(["_setAutoPageview", false]) | Turns off automatic PVs so you call _trackPageview manually |
If a legacy _czc analytics SDK has already taken over _czc, the SDK will not overwrite it and will not send duplicate data; it prints migration instructions in the console instead.