Google AdManager Matching allows AdSpirit to attach itself directly to placement defined by Google AdManager (GAM; formerly Google DFP) on a page and which were not filled by GAM.
Procedure
- Integrate the Google AdManager Matching Script into your website. The integration should happen as early as possible in the website code.
- The script will append itself to all slots defined by GAM in the page and wait to see if they are filled by GAM.
- If a slot is not filled, the matching script will search for a suitable AdSpirit advertising space and insert it in place of the GAM slot.
Setup
Include the Google AdManager Matching Code as follows:
<script>
window.asm_host = 'delivery.youradserver.com';
window.asm_cdn = 'cdn.youradserver.com';
window.asm_wsid = '123';
window.asm_global_params = ''; //optional additional parameters to be added to each placment script
</script>
<script src="//cdn.youradserver.com/adasync.min.js" async type="text/javascript"></script>
<script src="//cdn.youradserver.com/adgtp.min.js" async type="text/javascript"></script>
Configuration
By default the code is set to automatic configuration. The script will automatically search for GAM slots and automatically assign suitable AdSpirit advertising spaces. If you would like a manual assignment instead, please use the variable window.asm_gtp_options:
//disable autodetection for slots:
window.asm_gtp_options.isAutoDetectSlots = false;
//disable autodetection for mappings:
window.asm_gtp_options.isAutoDetectMappings = false;
//set GAM slots that should be added (use GAM slot path):
window.asm_gtp_options.addSlots = ['/123/myslot1','/123/myslot2];
//alternative, set GAM slots that should be added (use GAM slot path):
window.asm_gtp_slots = window.asm_gtp_slots || [];
window.asm_gtp_slots.push('/123/myslot1');
//set mappings that should be added (use GAM slot path):
window.asm_gtp_options.addMappings = [{'query':'/123/myslot1','pid':'789','params':'&target=123'}];
//alternative, set mappings that should be added (use GAM slot path):
window.asm_gtp_mappings = window.asm_gtp_mappings || [];
window.asm_gtp_mappings.push({'query':'/123/myslot1','pid':'789','params':'&target=123'});
window.asm_gtp_mappings.push({'query':'mywebsite_leaderboard3','pid':'789','params':'&target=123'});
window.asm_gtp_mappings.push({'query':'myDivForPlacement','pid':'789','params':'&target=123'});
Mapping
The mapping, i.e. the allocation of GAM slots to AdSpirit advertising spaces, takes place for each GAM slot in the following way:
- Match of mapping search (query) with exact slot ID (path#div#size)
- Match of mapping search (query) with exact slot ID (path#div)
- Match of mapping search (query) with slot ID (path)
- Match of mapping search (query) with slot name (part of the path after the last / )
- Correspondence of mapping search (query) with Slot-DIV (div)
- (If auto detection is active) Match of slot name with AdSpirit placement name
- (If auto detection is active) Match of slot name with alternative AdSpirit placement name
- (If auto-detection is active) Match of Slot-DIV with AdSpirit placement name
- (If auto-detection is active) Match of Slot-DIV with alternative AdSpirit placement name