The Interact SDK fetches targeting parameters from the server and stamps them on the page via four channels. All four are populated on every successful interaction fetch. Official Docs ↗
window.zeoParamsCallback(data)Called by the SDK when targeting parameters arrive. Define it before the SDK loads to avoid missing the first invocation.
window.zeoParamsCallback = function(targetingParameters) {
// targetingParameters is a key-value object, e.g.
// { segment_membership: ["seg_1", "seg_2"], interest: "sports" }
console.log("Interact data:", targetingParameters);
};
zeoParamsStoreLocalPersists across page reloads and tabs on the same origin.
var raw = localStorage.getItem("zeoParamsStoreLocal");
if (raw) {
var params = JSON.parse(raw);
console.log(params);
}
zeoParamsStoreSessionScoped to the current tab. Cleared when the tab closes.
var raw = sessionStorage.getItem("zeoParamsStoreSession");
if (raw) {
var params = JSON.parse(raw);
console.log(params);
}
window.zeoParamsGlobalSet as a property on window after each interaction fetch. Available immediately in page scripts.
if (window.zeoParamsGlobal) {
console.log(window.zeoParamsGlobal);
}
| Channel | Key / Accessor | Lifespan | Scope |
|---|---|---|---|
| Callback | window.zeoParamsCallback(data) |
Real-time | Current page |
| localStorage | zeoParamsStoreLocal |
Persistent | All tabs, same origin |
| sessionStorage | zeoParamsStoreSession |
Session | Current tab only |
| Global variable | window.zeoParamsGlobal |
Page lifetime | Current page |
pushState / replaceState / popstate), so all four channels are refreshed automatically on route changes.
Set first-party identifiers that Interact uses for profile lookups. The key must match the identifier field name configured in your API source.
window.zeoParamsCallback(data) when targeting parameters are ready. Each invocation is logged below.
Captures XHR/fetch calls to /api/interact/interactions and logs request + response.