Geo-settings for Advertising Campaigns

Viewing

campaign/geo

Parameters:

  • token — authorization (string)
  • id — id of the ad campaign (int)

Example of the method request:

 $token,
        'id' => 999999
    );
    if( $curl = curl_init() ) {
        curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/campaign/geo');
        curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
        $out = curl_exec($curl);
        echo $out;
        curl_close($curl);
    }

// Result:

{
    "countries": {
        "geo_ru": {
            "name": "Russia", // region name
            "checked": true, // selected or not
            "count": 84836 // approximate number of visits per day
        },
        "geo_ua": {
            "name": "Ukraine",
            "checked": false,
            "count": 22551
        },
        ...
    },
    "ru_regions": {
        "region_105": {
            "name": "Moscow",
            "checked": true,
            "count": 17419
        },
        "region_106": {
            "name": "Saint Petersburg",
            "checked": true,
            "count": 5551
        },
        ...
    },
    "ua_regions": {
        "region_10": {
            "name": "Kiev",
            "checked": false,
            "count": 9226
        },
        "region_21": {
            "name": "Donetsk region",
            "checked": false,
            "count": 3692
        },
        ...
    },
    "error_code": 0
}

Setting Regions

campaign/geo_set_by_names

Parameters:

  • token — authorization (string)
  • regions — names of regions separated by commas (string)

Example of the method request:

 $token,
        'id' => 999999,
        'regions' => 'moscow,spb,yaroslavl,sverdlovsk'
    );
    if( $curl = curl_init() ) {
        curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/campaign/geo_set_by_names');
        curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
        $out = curl_exec($curl);
        echo $out;
        curl_close($curl);
    }

// Result:

{
    "status": "ok",
    "error_code": 0
}
IPweb

Rate the material:

Rating: 3.75 out of 5. Total ratings: 4.
-