我正在使用 openx api 插入广告商/活动/横幅,但我似乎找不到任何关于通过 API 对活动或横幅进行地理定位的文档。可以这样做,还是我将不得不开始直接注入数据库。
问问题
994 次
1 回答
2
我也没有在文档中找到任何内容,但是我能够找到如何做到这一点。
下面是java代码。我使用了 BannerXmlRpcService.php 中的 setBannerTargeting 方法。
public static String GEO_CONTINENT_LIMITATION = "deliveryLimitations:Geo:Continent";
public static String GEO_COUNTRY_LIMITATION = "deliveryLimitations:Geo:Country";
map = new HashMap();
public static String[] CONTINENTS = new String[]{
"AS","EU","AF","OC","CA","SA","NA","AQ",
};
public static String CONTAINS_OPERATOR = "=~";
public static String OR_LOGICAL_OPERATOR = "or";
..........................
List list = new ArrayList();
HashMap targeting = new HashMap();
targeting.put("logical",Targeting.OR_LOGICAL_OPERATOR);
targeting.put("type",Targeting.GEO_CONTINENT_LIMITATION);
targeting.put("comparison",Targeting.CONTAINS_OPERATOR);
targeting.put("data",Targeting.CONTINENTS[1]);
list.add(targeting);
...........................
map.put("aTargeting",list);
proxy.setTargeting(bannerID,list);
于 2010-09-24T18:09:15.943 回答