-
I am working a for a wordpress site that uses DFP to manage ads. There are two admins: one for the website owner and another for the 3rd party ads.
-
There are two kind of ads. Regular ads (300X600). But if DFP doesn't find it, it go for alternate ad (300 X 250) also known as extra.
The problem i am facing is that: in the owners admin. The DFP is showing the impression like 200K impressions for regular ad and 3rd party is showing 180K impressions . but for extra( alternate ad) DFP is showing 15K impressions where as on the 3rd party admin it is showing as only 250 impressions.
The regular ad and extra ad is managed in php: class-dfp has function ad_units() where described the ad units. in this case:
<?php
dfp_register_ad_unit('right_1', array(
'sizes' => '[[300, 600], [300, 250]]',
'sizeMapping' => array(
'[768, 200]' => '[[300, 600], [300, 250]]',
'[0, 0]' => '[]',
),
'extra' => array(
'[300, 250]' => 'right_1_extra'
),
'widget' => true,
'companion' => true,
));
dfp_register_ad_unit('right_1_extra', array(
'sizes' => '[300, 250]',
'sizeMapping' => array(
'[768, 200]' => '[300, 250]',
'[0, 0]' => '[]',
),
));
?>
right_1 generally is filled with ad 300 X 600, but if DFP does not find it it will replace it by ad sized 300 X 250 and another add will appear in blank space, and it will be right_1_extra i.e an ad sized 300 X 250.
When reporting support staff for DFP regarding this issue. The reply was:
"In case your requirement is to conditionally call the ad unit right_1_extra on the page, then you need to disable the fetch call for the ad unit by using the disableinitialload() function. Later, with the help of the refresh function, you can call this tag separately (independent of the page load). This way, DFP won’t count an impression until the request is made and the discrepancy is eliminated"
after little research I found this is done in dfp.js file
googletag.cmd.push(function() {
// Process ad slots (insert occurs onReady)
DFP.process(ad_slots);
// Set Custom Targeting
DFP.setTargeting(custom_targeting);
// Init
googletag.pubads().addEventListener('slotRenderEnded', DFP.renderEnded);
googletag.pubads().collapseEmptyDivs();
googletag.pubads().setCentering(true);
googletag.pubads().enableSingleRequest();
googletag.companionAds().setRefreshUnfilledSlots(true);
googletag.enableServices();
});
I tried to use the function but no luck. I am new with this DFP thing and need some tips for it. Thank you guys for reading this all. I would appreciate if share your knowledge.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire