0

我想创建一个应用程序,让管理员能够从站点后端定位极端本地级别的特定人群,这样他们就可以输入位置并说在 2 英里圈或 1 英里圈内以及年龄在 35-50 岁之间的女性然后他们可以看到来自后端的报告以及点击率等。

为此,我下载了 adwords 客户端库http://code.google.com/p/google-api-adwords-php/并设置了auth.ini的参数,但我不知道如何使用它库并创建上述功能?

4

1 回答 1

0

您需要在此处注册您的应用程序: https ://code.google.com/apis/console#access 然后在应用程序控制台中启用 AdWords API。然后在 auth.ini 中配置 email、password、userAgent、developerToken、clientId 和 clientSecret,最后 3 个令牌由应用程序控制台提供,您还需要在此处取消注释 [OAUTH2]。

之后,您需要在 examples/201206/ 文件夹中创建与 init.php 类似的文件。

error_reporting(E_STRICT | E_ALL);

define('SRC_PATH', dirname(__FILE__) . '/../../src/');
define('LIB_PATH', 'Google/Api/Ads/AdWords/Lib');
define('UTIL_PATH', 'Google/Api/Ads/Common/Util');
define('AW_UTIL_PATH', 'Google/Api/Ads/AdWords/Util');

define('ADWORDS_VERSION', 'v201206');

// Configure include path
ini_set('include_path', implode(array(
    ini_get('include_path'), PATH_SEPARATOR, SRC_PATH
)));

// Include the AdWordsUser
require_once LIB_PATH . '/AdWordsUser.php';

然后找到关于访问者的类并实例化并调用过滤器方法。

于 2013-01-30T16:16:11.223 回答