使用 openx API 进行地理定位

发布于 2024-09-18 20:01:46 字数 99 浏览 8 评论 0原文

我正在使用 openx api 插入广告商/营销活动/横幅,但我似乎找不到任何有关通过 API 对营销活动或横幅进行地理定位的文档。这可以完成吗,或者我是否必须开始直接注入到数据库中。

I am using the openx api to insert advertisers/campaigns/banners but I cannot seem to find any documentation on geo-targeting a campaign or banner via the API. Can this be done, or am I going to have to start injecting directly into the database.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稀香 2024-09-25 20:01:46

我在文档中也没有找到任何内容,但是我能够找到如何做到这一点。

下面是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);

替代文字

I did not find anything in the documentation either, however I was able to find how to do it.

Below is the java code. I used the method setBannerTargeting from BannerXmlRpcService.php.

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

alt text

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文