您需要在此註冊您的應用程序: https://code.google.com/apis/console#access 然後在應用程序控制臺中啓用AdWords API。 然後在auth.ini電子郵件,密碼,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';
然後找到關於訪問者的類並實例化並調用過濾器方法。
你沒有看到文檔? http://google-api-adwords-php.googlecode.com/svn/trunk/docs/index.html – 2012-08-07 09:36:17