키-값을 사용하여 광고 단위보다 더 세부적으로 광고를 타겟팅할 수 있습니다. 키-값에 대해 자세히 알아보세요.
각 광고 요청에 대해 하나 이상의 연결된 값을 포함하는 키를
하나 이상 전달할 수 있습니다. 이러한 키-값은 Ad Manager의 광고 항목 수준에서 구성된 타겟팅 옵션과 비교하여 평가됩니다. 예를 들어 age=18-34
의 맞춤 키-값을 전달하면 다른 기준이 모두 일치한다는 가정 하에 만 18~34세의 연령대에 타겟팅된 광고 항목이 게재될 수 있습니다.
타겟팅 설정
키-값을 지정하여 네트워크 요구사항에 따라 슬롯 수준과 페이지 수준 모두에서 타겟팅을 구성할 수 있습니다.
- 슬롯 수준
페이지의 개별 광고 슬롯에 키-값을 설정할 수 있습니다.
슬롯 수준 타겟팅을 사용하면 슬롯별로 타겟팅을 구성할 수 있습니다. 이는 같은 페이지의 개별 슬롯에 다른 타겟팅이 필요하지만 동일한 키-값이 모든 슬롯에 적용되는 경우 비효율적일 수 있는 경우에 유용합니다. 다음 예와 같이 Slot.settargeting()을 사용하여 슬롯 수준 타겟팅을 활용하세요.
- 페이지 수준
페이지의 모든 광고 슬롯에 키-값을 설정할 수 있습니다.
페이지 수준 타겟팅은 모든 광고 슬롯에 동일한 키-값 집합이 적용되도록 합니다. 경우에 따라 타겟팅을 구성하는 데 필요한 총 코드 양이 줄어들 수 있습니다. 다음 예에서와 같이 googletag.pubads().setTargeting()을 사용하여 페이지 수준 타겟팅을 활용하세요.
<head> <script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script> <script> window.googletag = window.googletag || {cmd: []}; // GPT slots var adSlots = []; googletag.cmd.push(function() { // 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 |