K+ 게재빈도 도달범위 측정

'유효 게재빈도'라고 부르는 경우가 있으며, 사용자가 특정 콘텐츠를 인식하거나 기억할 수 있게 되려면 최소 조회수를 충족해야 합니다 (대개 광고 조회수라는 맥락에서). 공유 저장공간을 사용하여 콘텐츠를 K회 이상 본 순 사용자에 대한 보고서를 작성할 수 있습니다.

Shared Storage API는 다양한 사용 사례를 지원하는 범용 크로스 사이트 저장소를 위한 개인 정보 보호 샌드박스 제안서입니다. Private Aggregation API는 공유 저장소에서 사용할 수 있는 출력으로, 이를 통해 크로스 사이트 데이터를 집계할 수 있습니다.

K+ 게재빈도 측정 사용해 보기

공유 저장소 및 비공개 집계를 사용하여 K+ 빈도 측정을 실험하려면 Chrome M107 이상을 사용하고 있는지 확인하세요. chrome://settings/adPrivacy에서 모든 광고 개인 정보 보호 API를 사용 설정합니다.

명령줄에서 --enable-features=PrivacySandboxAdsAPIsOverride,OverridePrivacySandboxSettingsLocalTesting,SharedStorageAPI,FencedFrames 플래그를 사용하여 공유 저장소를 사용 설정할 수도 있습니다.

코드 샘플 실험

여러 사이트에서 특정 클라이언트에 대해 콘텐츠를 K회 이상 본 사용자 수를 측정하고 싶을 수 있습니다. 이 예에서는 노출수가 공유 저장소에 추가되고 콘텐츠가 로드될 때마다 1씩 증가합니다. 노출수가 3에 도달하면 Private Aggregation API가 호출됩니다. Content ID 측정기준은 집계 키로 인코딩되며 개수는 집계 가능한 값으로 사용됩니다. 요약 보고서에는 '약 391명의 사용자가 광고 캠페인 ID 123을 최소 3회 이상 본 사용자'와 같은 정보가 제공됩니다.

이 예는 다음과 같습니다.

k-frequency-measurement.js

async function injectContent() {
  // Load the Shared Storage worklet
  await window.sharedStorage.worklet.addModule('k-freq-measurement-worklet.js');

  // Run the K-frequency measurement operation
  await window.sharedStorage.run('k-freq-measurement', { data: { kFreq: 3, contentId: 123 });
}

injectContent();

k-frequency-measurement-worklet.js

// Learn more about noise and scaling from the Private Aggregation fundamentals
// documentation on Chrome blog
const SCALE_FACTOR = 65536;

/**
 * The bucket key must be a number, and in this case, it is simply the content
 * ID itself. For more complex bucket key construction, see other use cases in
 * this demo.
 */
function convertContentIdToBucket(contentId) {
  return BigInt(contentId);
}

class KFreqMeasurementOperation {
  async run(data) {
    const { kFreq, contentId } = data;

    // Read from Shared Storage
    const hasReportedContentKey = 'has-reported-content';
    const impressionCountKey = 'impression-count';
    const hasReportedContent = (await this.sharedStorage.get(hasReportedContentKey)) === 'true';
    const impressionCount = parseInt((await this.sharedStorage.get(impressionCountKey)) || 0);

    // Do not report if a report has been sent already
    if (hasReportedContent) {
      return;
    }

    // Check impression count against frequency limit
    if (impressionCount < kFreq) {
      await this.sharedStorage.set(impressionCountKey, impressionCount + 1);
      return;
    }

    // Generate the aggregation key and the aggregatable value
    const bucket = convertContentIdToBucket(contentId);
    const value = 1 * SCALE_FACTOR;

    // Send an aggregatable report via the Private Aggregation API
    privateAggregation.contributeToHistogram({ bucket, value });

    // Set the report submission status flag
    await this.sharedStorage.set(hasReportedContentKey, 'true');
  }
}

// Register the operation

register('k-freq-measurement', KFreqMeasurementOperation); \

참여 및 의견 공유

공유 저장소 제안은 논의 중이며 향후 변경될 수 있습니다. 이 API를 사용해 보고 의견을 보내 주세요.