Mutating Ad by specifying ad_id and ad_group_id / campaign_id

168 views
Skip to first unread message

Mamoru Miura

unread,
Oct 27, 2023, 4:27:44 PM10/27/23
to Google Ads API and AdWords API Forum
Dear support team,

I have a responsive search ad and want to mutate its text (headlines and descriptions). I also use the campaign test feature, which duplicates the ad, and there are two ads whose ad_id is the same.

I want to mutate only one ad (and remain the other). I think it's possible to do so by specifying not only ad_id but also other identifiers (e.g. ad_group_id or campaign_id). Generally, it is recommended to use AdService and AdOperation to mutate an ad, but they take only ad_id and account_id as parameters, which is not enough to distinguish the two ads. I found AdGroupAdService but it seems not to be able to mutate any ad (refer to https://groups.google.com/g/adwords-api/c/90KwjMr2CnA). What can I do to achieve my goal?

Best regards,

D. H.

unread,
Oct 29, 2023, 10:04:32 PM10/29/23
to Google Ads API and AdWords API Forum
Hi,

I've run into the same issue when creating Campaign Experiments. There are two states with three different campaigns with different results.

Let's consider this to be our BASE campaign: customers/1234567890/campaigns/2345678901. This campaign will have a campaign.experiment_type field value of "BASE".

1) Campaign Experiment Status = SETUP
This campaign will have a campaign.experiment_type of "UNKNOWN" and it will have an extra long resource name, e.g., customers/1234567890/campaigns/223344556678901.
  • In this state the campaign and ad group resource names (and IDs) have different values from the BASE campaign.
  • But the ad resource names (and IDs) have the same values as the BASE campaign.
  • So you cannot mutate the experiment ad without mutating the base ad because as you've found the API call only uses the ad resource name which is identical to the BASE ad resource name.
  • You might not even be able to update the experiment ad in the UI at this point without updating the BASE ad
  • In this state the only thing you can do to update an ad is to delete it (which also requires the ad group ID also) and then re-create the ad with whatever items are updated in the experiment campaign and ad group.
  • Incidentally, for search ads, the keyword resource names are also the same here but, for whatever reason, the keyword mutate does require the ad group ID, so you don't run into the same issue and can mutate to update keywords.

2) Campaign Experiment Status = INITIATED/ENABLED
Once you've initiated/enabled the experiment a third campaign will be created with a campaign.experiment_type of "EXPERIMENT" and it will have an "normal" length resource name, e.g., customers/1234567890/campaigns/3456789012.
  • In this state the ad and keyword resource names (and IDs) are different so you can use a normal method to mutate the experiment ad without affecting the BASE ad.
  • This can still be before the experiment start date so you don't need to wait until the experiment is actually in-progress before mutating the ads, just that the experiment is enabled.

A final note is if you run the campaign report with PARAMETERS include_drafts = true' set  you'll see the three campaigns returned – BASE, UNKNOWN, and EXPERIMENT – even once the experiment is enabled. But at this point any mutates should be to the objects in the EXPERIMENT campaign, not the UNKNOWN one.

Hope this helps,

D.H.

Google Ads API Forum Advisor

unread,
Oct 30, 2023, 4:09:41 AM10/30/23
to mam...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for contacting the Google Ads API support team.

By reviewing your concern, I understand that you are trying to mutate the text (headlines and descriptions) for a responsive search ad. Since there are create, update and remove mutate operations on the AdGroupAd. Could you please tell me which operation you are trying to perform via API? Kindly confirm whether you are able to perform the required mutate operation vis UI?

In order to investigate your issue further, kindly provide us with the complete API logs (request and response with request-id and request header) generated at your end and uncropped UI screenshot of where you are facing the issue.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02q8loP:ref"

Thanks,
 
Google Logo Google Ads API Team


Google Ads API Forum Advisor

unread,
Oct 30, 2023, 4:11:05 AM10/30/23
to heiberge...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for contacting the Google Ads API.

By reviewing your concern, I understand that you are facing an issue regarding the mutate the text (headlines and descriptions) for a responsive search ad when creating Campaign Experiments. In order to investigate your issue further, kindly provide us with the complete API logs (request and response with request-id and request header) generated at your end and uncropped UI screenshot of where you are facing the issue.


If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02q9494:ref"


Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages