Script tag
Wire the Seeka consent API directly into your cookie banner.
Before this works
These consent calls gate destinations only when the session's effective data control mode is implicit or explicit - from the brand's configured default or a session override. With a disabled default and no override, the calls below are recorded but block nothing.
Opt in / opt out
<script>
function optOut() {
window.Converge.privacy.setPrivacyState({
grantedIabPurposeIds: [],
deniedIabPurposeIds: [7], // IabPrivacyConsentPurposeId.MeasureAdvertisingPerformance
});
}
function optIn() {
window.Converge.privacy.setPrivacyState({
grantedIabPurposeIds: [7], // IabPrivacyConsentPurposeId.MeasureAdvertisingPerformance
deniedIabPurposeIds: [],
});
}
</script>
<button onclick="optOut()">Opt out</button>
<button onclick="optIn()">Opt in</button>Pass a TCF v2 consent string instead
If your CMP delivers a TCF v2 consent string, you can pass it through directly. Seeka decodes the string to derive granted purposes when you have not supplied an explicit grantedIabPurposeIds:
<script>
function applyConsentFromTcf(tcfString) {
window.Converge.privacy.setPrivacyState({
tcfConsentString: tcfString,
});
}
</script>If you supply both grantedIabPurposeIds and tcfConsentString, the explicit purpose list wins.
Session-scoped data control override for embedding vendors
If you embed Seeka on behalf of a brand, you can tighten the data control mode for a single browser session without changing the brand's configured mode. See the browser overview for the full semantics and the important explicit caveat. There are two equivalent ways to set it from a script-tag install.
Data layer global - set it before the Seeka script loads:
<script>
window.Seeka = window.Seeka || {};
window.Seeka.privacy = { mode: 'explicit' }; // 'disabled' | 'implicit' | 'explicit'
</script>
<!-- ...then your Seeka install script -->SeekaInstall option - if you install via SeekaInstall(...), pass privacyOverride (it writes the same global for you, before the brand script loads):
<script>
SeekaInstall({
instances: [{ org: 'org-id', id: 'instance-id', key: 'public-key' }],
privacyOverride: { mode: 'explicit' },
});
</script>Both tighten only (disabled > implicit > explicit) and persist nothing against the brand. The HTML tag example project ships both approaches ready to uncomment (commented out so the example tracks normally by default).
Remember: an
explicitoverride blocks all tracking - including Seeka's own first-party collection - until you capture consent viawindow.Converge.privacy.setPrivacyState(...). Useimplicitfor opt-out behaviour that keeps data flowing unless the visitor denies a purpose.
Multi-instance installs
If your install configures more than one converge instance per page, call setPrivacyState on the scoped SDK wrapper - it fans out to every instance:
<script>
function optIn() {
// window.SeekaSdkInstance is whatever variable your install assigns the scoped SDK to.
window.SeekaSdkInstance.privacy.setPrivacyState({
grantedIabPurposeIds: [7],
deniedIabPurposeIds: [],
});
}
</script>Verifying it works
See Privacy SDK troubleshooting for how to confirm destinations are actually being gated.