It's possible to Edit an Text AD ?

995 views
Skip to first unread message

ics

unread,
Mar 18, 2010, 5:48:31 AM3/18/10
to AdWords API Forum
I know its possible to change the status of an ad with the following
code:

$ad = new Ad();
$ad->id = $adId;

$adGroupAd = new AdGroupAd();
$adGroupAd->adGroupId = $adGroupId;
$adGroupAd->ad = $ad;
$adGroupAd->status = 'PAUSED';

// Create operations.
$operation = new AdGroupAdOperation();
$operation->operand = $adGroupAd;
$operation->operator = 'SET';

$operations = array($operation);

// Update ad.
$result = $adGroupAdService->mutate($operations);

But it's possible to change the headline, the description and the url
of the link of the Ad ??

I tried:

// Create text ad.
$textAd = new TextAd();
$textAd->headline = 'test2222';
$textAd->description1 = 'test222';
$textAd->description2 = 'test22';
$textAd->displayUrl = 'www.test.com';
$textAd->url = 'http://www.test.com';
$textAd->id = $adId;

// Create ad group ad.
$textAdGroupAd = new AdGroupAd();
$textAdGroupAd->adGroupId = $adGroupId;
$textAdGroupAd->ad = $textAd;
$textAdGroupAd->status = 'ENABLED';

// Update operations.
$textAdGroupAdOperation = new AdGroupAdOperation();
$textAdGroupAdOperation->operand = $textAdGroupAd;
$textAdGroupAdOperation->operator = 'SET';


//---


$operations = array($textAdGroupAdOperation);

// Update ad.
$result = $adGroupAdService->mutate($operations);

but there is no difference... it only change the status of the add but
not the description, url, headline,...

I hope you someone can help me

best regardes

j.e.frank

unread,
Mar 18, 2010, 10:04:34 AM3/18/10
to AdWords API Forum
You can only modify the status of an existing Ad. If you want to
change the text, headline, etc, you should create a new Ad, and pause
or delete the existing Ad.

This is consistent with what happens in the AdWords Web UI. If you
click to edit an Ad, you get a popup with this text:
----
You can edit this ad.
Changing the ad will delete the existing ad and create a new one. The
new ad will begin with statistics at zero, and statistics for the old
ad will be shown in the "Deleted ads" row.
----

Ramesh Amala Srinivasan

unread,
Jan 7, 2011, 10:44:19 PM1/7/11
to adwor...@googlegroups.com
//You can only modify the status of an existing Ad//

how to modify the status of text ad ? how to pass the text ad id whose status need to be updated..

AdWords API Advisor

unread,
Jan 9, 2011, 10:50:09 PM1/9/11
to AdWords API Forum
Hi Ramesh,

You need to create an AdGroupAd and an Ad object within it, set the
adGroupId, status and adId, and call AdGroupAdService::mutate with SET
operation. See this code example for more details.

http://code.google.com/p/google-api-adwords-dotnet/source/browse/branches/v11.3/examples/csharp/v201008/UpdateAd.cs?r=140

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Jan 8, 8:44 am, Ramesh Amala Srinivasan <amalavisi...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages