DFP中的多个广告/广告素材尺寸(Multiple Ad/Creative Sizes in DFP)

编程入门 行业动态 更新时间:2024-10-23 21:38:55
DFP中的多个广告/广告素材尺寸(Multiple Ad/Creative Sizes in DFP)

我想知道如何在DFP广告管理系统中为不同的浏览器宽度/屏幕分辨率创建不同的广告/广告素材尺寸。 我发现这篇关于此问题的DFP文章,但它专门针对移动用户,并且他们不提供任何代码,而只是一种方法。 这是文章:

http://support.google.com/dfp_premium/bin/answer.py?hl=en&answer=2615435

在其中,他们提供了一个如下所示的代码方法:

if screen size < 300px ad tag size = 216 else if screen size < 600px ad tag size = 300 else ad tag size = 600

但这篇文章仅适用于移动广告。 :(这是我的广告形象的jsfiddle: http : //jsfiddle.net/EptwH/3/

如果有人可以告诉我是否有一种方法可以为不同的浏览器宽度设置多个广告素材/广告尺寸,那就太棒了。 还有一件事要补充,我并不完全想要改变广告尺寸,比例将保持不变...例如,我想要100x50广告,然后是200x100,然后是300x150,然后是400x200如果有人可以帮助我,或者让我知道这是否可能......这将是惊人的!

I'm wondering how one would go about creating different ad / creative sizes for different browser widths / screen resolutions in DFP. I found this DFP article regarding this issue, but it was specifically for mobile users, and they do not give any code, rather just a method. Here is the article:

http://support.google.com/dfp_premium/bin/answer.py?hl=en&answer=2615435

In it they give a code method that looks like this:

if screen size < 300px ad tag size = 216 else if screen size < 600px ad tag size = 300 else ad tag size = 600

But this article was for mobile ads only. :( Here is a jsfiddle of my ad image: http://jsfiddle.net/EptwH/3/

If anyone could inform me on whether or not there is a method to have multiple creative/ad sizes for different browser widths, that would be amazing. And one more thing to add, I do not COMPLETELY want to change the ad dimensions, the ratio will stay the same... so for example, I'd like a 100x50 ad, then a 200x100, then a 300x150, then a 400x200 etc. If anyone could help me out, or let me know if this is even possible....that would be amazing!

最满意答案

如果您看到DFP要求您嵌入页面的JS代码,则会将它们拆分为三个“阶段”:

首先定义页面上的可用插槽 第二,你启用该服务 第三,你要求填补空位。

在第一步中,您可以拥有一些条件代码。 所以你可以替换这个语句:

googletag.defineSlot('/1234567/my_slot', [728, 90], 'gpt-apps-large').addService(googletag.pubads());

有条件的:

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()); }

修改:额外提示 - 使用https://support.google.com/dfp_sb/bin/answer.py?hl=zh-CN&answer=181070调整广告投放方式中的信息。

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.

更多推荐

本文发布于:2023-08-07 08:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463796.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:广告   多个   素材   尺寸   DFP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!