The problem of OpenX and geo targeting

I downloaded the latest version of OpenX 2.8.6, and I'm trying to set up geo-targeting, but it doesn't work. I turned on geo targeting in the administration panel (Configuration → Global Settings → Geo Targeting Module Type → OpenX Max mind (flat file)). I read in the OpenX documentation that there is no need to put any database path in the plugin settings, so I tried without it. I set the delivery options for the test banner, which will be shown only in Serbia. I am updating a page on which banners are displayed, but this banner is never displayed.

I thought that maybe the problem is in the old database and that my IP address is not recognized, so I downloaded the latest database (.dat file) from MaxMind (light version of the Country database) and put the path in the plugin settings, but it still not working.

Can someone help me solve this problem?

+5
source share
1 answer

I had the same problem. It seems that OpenX since version 2.8.x uses its own php-based GeoIP-Database reader (for example, the "flatfile" parameter in the settings) instead of using the geoip module, which does not seem to work with the current GeoIP.dat

To solve this problem, I did the following:

1) open plugins / geo-targeting / oxMaxMindGeoIP / oxMaxMindGeoIP.delivery.php

2) do a search:

    if (isset($GLOBALS['_MAX']['GEO_IP'])) {
        $ip   = $GLOBALS['_MAX']['GEO_IP'];
        OX_Delivery_logMessage('['.$ip.'] : ip from cookie. Plugin_geoTargeting_oxMaxMindGeoIP_oxMaxMindGeoIP_Delivery_getGeoInfo', 7);
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
        OX_Delivery_logMessage('['.$ip.'] : ip from remote addr. Plugin_geoTargeting_oxMaxMindGeoIP_oxMaxMindGeoIP_Delivery_getGeoInfo', 7);
    }
    $aGeoConf = (is_array($conf['oxMaxMindGeoIP'])) ? $conf['oxMaxMindGeoIP'] : array();

3) :

$ret = array(
    "country_code" => $_SERVER['GEOIP_COUNTRY_CODE']
);
return $ret;

4)

:

 * @return array An array(
 *                  'country_code',
 *                  'region',
 *                  'city',
 *                  'postal_code',
 *                  'latitude',
 *                  'longitude',
 *                  'dma_code',
 *                  'area_code',
 *                  'organisation',
 *                  'isp',
 *                  'netspeed'
 *              );
 */

-doc (mod_geoip), ( ) IP-. lighttpd 1.5 + mod_geoip ( ). apache_note/pecl-geoip/mod_geoip env...

Oh btw. , , mod_geoip, db , php ( openx).

+5

All Articles