0
votes

Im new to Google adwords - My client center. I want to view and add campaigns with this. I searched for the google adwords api client library and found the following "http://code.google.com/p/google-api-adwords-php/downloads/list". After that, downloaded the aw_api_php_lib_3.2.2.tar.gz and placed that code in "mysite/protected/" folder. And i have modified configuration in "mysite/protected/adwords/src/Google/Api/Ads/AdWords/auth.ini" file.

I can able to view all the campaigns. Now i want to add campaign with My client center. My code is,

Yii::import('application.adwords.*');
                        require_once('examples/v201206/BasicOperations/AddCampaigns.php');
                        $user = new AdWordsUser();
                        $user->LogAll();
                        AddCampaignsExample($user, $campaign_name, $period, $budget, $delmethod, $status, $stdate, $enddate, $impressions, $timeunit, $level);

I have passed the appropriate values in the $campaign_name,$period,$budget..etc,. Its working well.

But i want to add all the fields available in Google adwords add campaign like "Type, Location options (advanced), Languages, Ad extensions, Advanced settings, etc.,". How can i add these fields with Google adwords API - Client library. Please advice.

1

1 Answers

0
votes

@lifeline, You're using the sample code, not the client library. If you want to configure a complete campaign, you need to use the API classes, like the sample code does.

Basically, you need to follow these steps to create objects with the AdWords API:

  • Define the service (for example, CampaignService);
  • Define the object (for example, Campaign);
  • Set the object properties;
  • Add the object in a operations array;
  • Call the mutate method on service object, passing the operations array (this method will send your data to adwords);
  • Get and process the results;

You can see these steps clearly in the API sample code. To learn more about the CampaignService, Campaign object and other things, see the API documentation:

Good luck with your project.