Angular

Public Preview

Angular is currently in public preview.

Wire the Seeka consent API into your cookie banner component.

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

import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { IabPrivacyConsentPurposeId, IabPrivacyConsentPurposeIdMap } from '@seeka-labs/converge';
import { SeekaService } from '@seeka-labs/converge-angular-lib';

@Component({
  selector: 'app-consent-controls',
  standalone: true,
  imports: [CommonModule],
  template: `
    <button (click)="optOut()">Opt out</button>
    <button (click)="optIn()">Opt in</button>
  `,
})
export class ConsentControlsComponent {
  constructor(private seekaService: SeekaService) {}

  optOut(): void {
    const converge = this.seekaService.getConverge();
    if (!converge) return;
    converge.privacy.setPrivacyState({
      grantedIabPurposeIds: [],
      deniedIabPurposeIds: [IabPrivacyConsentPurposeIdMap[IabPrivacyConsentPurposeId.MeasureAdvertisingPerformance]],
    });
  }

  optIn(): void {
    const converge = this.seekaService.getConverge();
    if (!converge) return;
    converge.privacy.setPrivacyState({
      grantedIabPurposeIds: [IabPrivacyConsentPurposeIdMap[IabPrivacyConsentPurposeId.MeasureAdvertisingPerformance]],
      deniedIabPurposeIds: [],
    });
  }
}

Pass a TCF v2 consent string instead

If your CMP exposes a TCF v2 consent string, hand it through directly:

applyConsent(tcfString: string): void {
  const converge = this.seekaService.getConverge();
  converge?.privacy.setPrivacyState({ tcfConsentString: tcfString });
}

If you supply both grantedIabPurposeIds and tcfConsentString, the explicit purpose list wins.

Multi-instance installs

If you install multiple converge instances per page, call setPrivacyState on the scoped SDK wrapper - it fans out across every instance. See Multi-instance installs in the browser overview.

Verifying it works

See Privacy SDK troubleshooting for how to confirm destinations are actually being gated.