tags:

views:

118

answers:

1

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.

+1  A: 

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

Cornel Creanga
It seems like there is far too much context lost here, could you provide just the request body or more of the code.
Unkwntech
I've added the XML generated by the RPC call.
Cornel Creanga