If you see the JS code that DFP asks you to embed into your page, they are split into three "phases" :
- first you define the available slots on the page
- second you enable the service
- third you ask the slots to be filled.
In the very first step, you can have some conditional code. So you could replace this statement :
googletag.defineSlot('/1234567/my_slot', [728, 90], 'gpt-apps-large').addService(googletag.pubads());
with a conditional :
if(window.width>728) {
googletag.defineSlot('/1234567/my_slot', [728, 90], 'gpt-apps-large').addService(googletag.pubads());
} else {
googletag.defineSlot('/1234567/my_slot', [468, 60], 'gpt-apps-large').addService(googletag.pubads());
}
Edit: Bonus tip -- use the information here https://support.google.com/dfp_sb/bin/answer.py?hl=en&answer=181070 to debug your ad delivery.