简体   繁体   中英

Working with Google Adwords Api in php

I want to create an application where admin to be able to target specific groups of people at an extreme local level from backend of site so they could type in location and say within 2 mile circle or 1 mile circle and between ages of 35-50 females and then they can see the reporting from the backend as well CTR etc.

For this, i had download the adwords client library http://code.google.com/p/google-api-adwords-php/ and i had set the parameter of auth.ini but I didn't know how to use this library and create above functionality?

You need to register your application here: https://code.google.com/apis/console#access then enable AdWords API in application console. then configure in auth.ini email, password, userAgent, developerToken, clientId and clientSecret, the last 3 tokens are given form application console, and you also need to uncoment [OAUTH2] here.

After that you need to create similar file to init.php in examples/201206/ folder.

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';

Then find class about visitors and instantiate and call filter method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM