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

'유효 게재빈도'라고도 하는 이 수치는 사용자가 특정 콘텐츠를 인식하거나 기억하기 전에 필요한 최소 조회수입니다 (광고 조회 맥락에서 자주 사용됨). 공유 스토리지를 사용하여 콘텐츠를 K회 이상 본 순 사용자의 보고서를 작성할 수 있습니다.

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

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

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

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

코드 샘플 실험

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

예를 들면 다음과 같습니다.

  • k-frequency-measurement.js은 프레임을 사용하여 로드되며 공유 스토리지 워크릿을 로드하는 역할을 합니다.
  • k-frequency-measurement-worklet.js는 공유 스토리지에서 노출수를 읽고 Private Aggregation API를 사용하여 보고서를 전송하는 공유 스토리지 워클릿입니다.

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();

kuency-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 just 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 sharedStorage.get(hasReportedContentKey)) === 'true';
    const impressionCount = parseInt((await sharedStorage.get(impressionCountKey)) || 0);

    // Don't report if a report has been sent already
    if (hasReportedContent) {
      return;
    }

    // Check impression count against frequency limit
    if (impressionCount < kFreq) {
      await 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 using the Private Aggregation API
    privateAggregation.contributeToHistogram({ bucket, value });

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

// Register the operation

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

참여 및 의견 공유

Shared Storage API 제안은 현재 활발히 논의되고 개발 중이며 변경될 가능성이 있습니다.

Shared Storage API에 관한 의견을 기다리고 있습니다.