For Using DFP (DoubleClick for Publisher)
It is possible to deliver through DFP. Insert tags you used, because how to implemented tags are different; whether tags are synchronized or not.
In case of nonsynchronous tags
- Add creatives to the order you want, and set the type of creatives
third party
. - Insert RFP JavaScript Tag as Creative.
- Insert JavaScript tags, ads unit template and, empty element that assigns display placement of ads.
- In addition, it needs to insert CSS for display.
- Insert click macro of DFP. Insert it accurately, and then it is possible to measure screen transitions and the clicks.
- You must implement template to tags if you using DFP click macro.
<!-- About reading CSS. It needs to customize. -->
<link rel="stylesheet" type="text/css" href="https://yourdomain/sample.css">
<!-- Template od ads unit -->
<script type="text/rfp-infeed-template" data-adspot-id="NzYzOjEyMg">
<div class="article">
<div class="contents">
<!-- Insert click macro of DFP, and then write down click URL of RFP just beneath of click macro of DFP. -->
<a href="%%CLICK_URL_UNESC%%{{click_url}}" target="_blank">
<h3>{{title}}</h3>
<p>{{description}}</p>
<span class="source">{{displayed_advertiser}}</span>
</a>
</div>
</div>
</script>
<!-- Assigning display location of ads -->
<div data-rfp-adspot-id="NzYzOjEyMg" style="display:none"></div>
<!-- Calling for ads script. -->
<script src="https://js.rfp.fout.jp/rfp-infeed.js"></script>
<script>
RFP.InFeed.Default.run({
before_render:function(ad_info, placement_info) {
// You must implement this step in order to connect DFP macro.
ad_info.click_url = encodeURIComponent(ad_info.click_url);
// Please respond as necessary to round up the explanation.
// If the advertisement frame size is fixed, it is recommended that round-up processing be implemented, as long characters may cut off.
var desc_max_len = 30;
if (ad_info.description.length > desc_max_len) {
ad_info.description = ad_info.description.substr(0, desc_max_len - 1) + '…';
}
return ad_info;
}
});
</script>
It needs to read a CSS additionally because of displaying ads in iframe.
In case of synchronized tags
- Add creatives to the order you want, and set the type of creatives
Tthird party
. - Insert JavaScript of RFP as creative.
- Insert JavaScript such as advertisement unit template, empty element that assigns display placement of advertisement.
- Insert click macro of DFP. Insert it accurately, and then it is possible to measure screen transitions and clicks.
- You must implement template to tags if you using DFP click macro.
<!-- Template of ads units. -->
<script type="text/rfp-infeed-template" data-adspot-id="NzYzOjEyMg">
<div class="article">
<div class="contents">
<!-- Insert click macro of DFP, then put click URL of RFP right after -->
<a href="%%CLICK_URL_UNESC%%{{click_url}}" target="_blank">
<h3>{{title}}</h3>
<p>{{description}}</p>
<span class="source">{{displayed_advertiser}}</span>
</a>
</div>
</div>
</script>
<!-- Assigning display placement of ads. -->
<div data-rfp-adspot-id="NzYzOjEyMg" style="display:none"></div>
<!-- Calling for ads script -->
<script src="https://js.rfp.fout.jp/rfp-infeed.js"></script>
<script>
RFP.InFeed.Default.run({
before_render:function(ad_info, placement_info) {
// You must implement this step in order to connect DFP macro.
ad_info.click_url = encodeURIComponent(ad_info.click_url);
// Please respond as necessary to round up the explanation.
// If the advertisement frame size is fixed, it is recommended that round-up processing be implemented, as long characters may cut off.
var desc_max_len = 30;
if (ad_info.description.length > desc_max_len) {
ad_info.description = ad_info.description.substr(0, desc_max_len - 1) + '…';
}
return ad_info;
}
});
</script>
If you use synchronized tags, it doesn’t need to call for style sheets.
Using template from Admin UI
If you use template which draft from Admin UI, dfp click macro would not work correctly. You should use this only if you does not need to measure clicks by DFP.
In this case, the lines below must be removed.
// You must implement this step in order to connect DFP macro.
ad_info.click_url = encodeURIComponent(ad_info.click_url);