$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
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.
----