키-값 타겟팅

키-값을 사용하면 광고 단위보다 더 세부적으로 광고를 타겟팅할 수 있습니다. 키-값에 대해 자세히 알아보세요.

각 광고 요청에 대해 하나 이상의 키에 하나 이상의 연결된 값을 담아 전달할 수 있습니다. 이러한 키-값은 Ad Manager의 광고 항목 수준에서 구성된 타겟팅 옵션을 기준으로 평가됩니다. 예를 들어 맞춤 키-값 age=18-34을 전달하면 다른 기준이 모두 일치한다는 가정 하에 18~34세 연령대를 타겟팅하는 광고 항목이 게재될 수 있습니다.

타겟팅 설정

네트워크의 필요에 따라 슬롯 수준과 페이지 수준에서 모두 타겟팅을 구성할 키-값을 지정할 수 있습니다.

슬롯 수준

페이지의 개별 광고 슬롯에 키-값을 설정할 수 있습니다.

슬롯 수준 타겟팅을 사용하면 슬롯별로 타겟팅을 구성할 수 있습니다. 이는 동일한 페이지의 개별 슬롯에 서로 다른 타겟팅이 필요한 경우에 유용하지만 모든 슬롯에 동일한 키-값이 적용되는 경우에는 비효율적일 수 있습니다. 다음 예와 같이 Slot.setTargeting()을 사용하여 슬롯 수준 타겟팅을 활용합니다.

페이지 수준

페이지의 모든 광고 슬롯에 키-값을 설정할 수 있습니다.

페이지 수준 타겟팅을 사용하면 모든 광고 슬롯에 동일한 키-값 집합이 설정됩니다. 경우에 따라 타겟팅을 구성하는 데 필요한 총 코드 양이 줄어들 수 있습니다. 다음 예와 같이 googletag.pubads().setTargeting()을 사용하여 페이지 수준 타겟팅을 활용합니다.

<head>
   
<meta charset="utf-8" />
   
<meta name="viewport" content="width=device-width, initial-scale=1" />
   
<meta
     
name="description"
     
content="Use key-value targeting to control the ads eligible to serve to specific ad slots."
   
/>
   
<title>Key-value targeting</title>
   
<script
     
async
     
src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"
     
crossorigin="anonymous"
   
></script>
   
<script>
      window
.googletag = window.googletag || { cmd: [] };

     
// GPT slots
      let adSlots
= [];

      googletag
.cmd.push(() => {
       
// Configure slot-level targeting.
        adSlots
[0] = googletag
         
.defineSlot("/6355419/Travel/Asia", [728, 90], "banner-ad-1")
         
.addService(googletag.pubads())
         
.setTargeting("color", "red")
         
.setTargeting("position", "atf");
        adSlots
[1] = googletag
         
.defineSlot("/6355419/Travel/Asia", [728, 90], "banner-ad-2")
         
.addService(googletag.pubads())
         
.setTargeting("position", "btf");

       
// Configure page-level targeting.
        googletag
.pubads().setTargeting("interests", "basketball");

       
// Enable SRA and services.
        googletag
.pubads().enableSingleRequest();
        googletag
.enableServices();
     
});
   
</script>
</head>

이 예에서는 광고 단위 /6355419/Travel/Asia 및 광고 크기 728x90를 지정하는 두 개의 광고 슬롯이 정의됩니다. 그런 다음 키-값 타겟팅이 적용되어 각 슬롯에 게재될 수 있는 광고를 더욱 제한하고 차별화합니다.

슬롯 수준 타겟팅과 페이지 수준 타겟팅을 모두 사용하는 경우 키-값이 결합되며 모든 기준을 충족하는 광고만 지정된 슬롯에 게재될 수 있습니다. 이 예에서 각 슬롯의 효과적인 타겟팅은 다음과 같습니다.

광고 슬롯 효과적인 타겟팅
1 color=red AND position=atf AND interests=basketball
2 position=btf AND interests=basketball

여러 키 또는 값 타겟팅

위 예에서는 슬롯 수준 타겟팅과 페이지 수준 타겟팅을 조합하여 단일 광고 슬롯에 여러 타겟팅 키를 정의했습니다. 다음은 동일한 효과적인 타겟팅을 달성하기 위한 대체 접근 방식입니다.

이 예에서는 공유 키-값이 각 광고 슬롯에 반복됩니다.

// Slot-level targeting with multiple keys.
adSlots
[0] = googletag
   
.defineSlot('/6355419/Travel/Asia', [728, 90], 'banner-ad-1')
   
.addService(googletag.pubads())
   
.setTargeting('color', 'red')
   
.setTargeting('position', 'atf')
   
.setTargeting('interests', 'basketball');
adSlots
[1] = googletag
   
.defineSlot('/6355419/Travel/Asia', [728, 90], 'banner-ad-2')
   
.addService(googletag.pubads())
   
.setTargeting('position', 'btf')
   
.setTargeting('interests', 'basketball');

이 예시에서는 기본 타겟팅이 페이지 수준에서 설정되고 필요에 따라 슬롯 수준에서 재정의됩니다.

// Page-level default targeting.
googletag
.pubads().setTargeting('interests', 'basketball')
                 
.setTargeting('position', 'btf');

// Slot-level targeting overrides.
adSlots
[0] = googletag
   
.defineSlot('/6355419/Travel/Asia', [728, 90], 'banner-ad-1')
   
.addService(googletag.pubads())
   
.setTargeting('color', 'red')
   
.setTargeting('position', 'atf');
adSlots
[1] = googletag
   
.defineSlot('/6355419/Travel/Asia', [728, 90], 'banner-ad-2')
   
.addService(googletag.pubads());

setTargeting()를 호출할 때 값 배열을 제공하여 단일 키의 여러 값을 타겟팅할 수도 있습니다.

// Page-level targeting with multiple values for a single key.
googletag
.pubads().setTargeting('interests', ['baseball', 'basketball']);

타겟팅 삭제

타겟팅이 설정되면 구성된 키-값은 광고 슬롯의 전체 기간 동안 모든 광고 요청과 함께 전송됩니다. 하지만 경우에 따라 시간이 지남에 따라 타겟팅을 변경하는 것이 좋을 수 있습니다. setTargeting()는 키-값을 추가하고 덮어쓰는 데 사용할 수 있지만 이 방법으로는 삭제할 수 없습니다. 이를 위해서는 Slot.clearTargeting() 또는 googletag.pubads().clearTargeting()을 대신 사용해야 합니다.

// Step 0, define slot- and page-level targeting.
  adSlots
[0] = googletag
   
.defineSlot("/6355419/Travel/Asia", [728, 90], "banner-ad-1")
   
.addService(googletag.pubads())
   
.setTargeting("color", "red")
   
.setTargeting("position", "atf");

  googletag
.pubads().setTargeting("interests", "basketball");

 
// Step 1, clear slot-level color targeting.
  adSlots
[0].clearTargeting("color");

 
// Step 2, clear all page-level targeting.
  googletag
.pubads().clearTargeting();

clearTargeting()가 특정 키 (슬롯 또는 페이지 수준)로 호출되면 해당 키만 삭제됩니다. 키를 지정하지 않으면 해당 수준의 모든 타겟팅이 삭제됩니다.

위의 예에서 각 단계 후 광고 슬롯의 효과적인 타겟팅은 다음과 같습니다.

단계 효과적인 타겟팅
0 color=red AND position=atf AND interests=basketball
1 position=atf AND interests=basketball
2 position=atf