Hi Vitaly,
I joined the GoogleAds workshop recently and tried to do exactly what you 
want: *create a complete hierarchy of entities (budget-campaigns-ad 
groups-ads-keywords) for a newly created managed account*

My answer is Yes, you can create the complete Campaign hierarchy in one 
operation. Below is what I found:

1- Order of the operation that you put into List<MutateOperation> is 
important: CampaignBudgetOperation --> CampaignOperation --> 
AdGroupOperation --> AdGroupAdOperation --> AdGroupCriterionOperation
2- Use different temporary Ids for new resource:
    CampaignBudget resourcename = customers/12345/campaignBudgets/ *-1* 
    Campaign resourcename = customers/12345/campaigns/ *-2*
    AgGroup resourcename = customers/12345/adGroups/ *-3*

Below is the pseudo code in .NET but you'll get the idea:

var googleAdsService = 
client.GetService(Google.Ads.GoogleAds.Services.V1.GoogleAdsService);

googleAdsService.Mutate(googleAdsId, new List<MutateOperation>

                    {
                        new MutateOperation
                        {
                            CampaignBudgetOperation = new 
CampaignBudgetOperation
                            {
                                Create = new CampaignBudget {  ResourceName 
= "customers/12345/campaignBudgets/*-1"*, ... }
                            },
                        new MutateOperation
                        {
                            CampaignOperation = new CampaignOperation
                            {
                                Create = new Campaign { ResourceName = 
"customers/12345/campaigns/ *-2", *CampaignBudget = 
"customers/12345/campaignBudgets/*-1"* }
                            }
                        },
                        new MutateOperation
                        {
                            AdGroupOperation = new 
Google.Ads.GoogleAds.V1.Services.AdGroupOperation
                            {
                                Create = new AdGroup { ResourceName = 
"customers/12345/adGroups/ *-3**", *Campaign =  "customers/12345/campaigns/ 
*-2" *}
                            }
                        },
                        new MutateOperation
                        {
                            AdGroupAdOperation = new 
Google.Ads.GoogleAds.V1.Services.AdGroupAdOperation
                            {
                                Create = new AdGroupAd { ResourceName = 
[not required], AdGroup =  "customers/12345/adGroups/ *-3**" *}
                            }
                        },
                        new MutateOperation
                        {
                            AdGroupCriterionOperation = new 
Google.Ads.GoogleAds.V1.Services.AdGroupCriterionOperation
                            {
                                Create = new AdGroupCriterion { 
ResourceName = [not required], AdGroup =  "customers/12345/adGroups/ *-3*
*" *}
                            }
                        }
                    });


Hope this helps

On Wednesday, 27 March 2019 04:48:46 UTC+11, Vitaly Dukhota wrote:
>
> Hi,
>
> I know it's possible to mutate multiple entities of the same kind in a 
> single request, and the operations will be done atomically (all or none). 
> For example, it's possible to create multiple campaign operations and 
> submit them all in a single atomic request, but the problem is that they 
> all have to be of the same kind (only campaign operations for the example). 
> I also know that it's possible to create a batch operation with can mutate 
> entities of different kinds (for example, both campaigns and ad groups) in 
> a (kind of) single request. The problem with batch operations is that they 
> are not atomic - some operations might fail whilst others will be completed.
>
> My question is: is it possible to create entities of different kinds in a 
> single atomic operation? For example, I want to create a complete hierarchy 
> of entities (budget-campaigns-ad groups-ads-keywords) for a newly created 
> managed account. Is it possible to create the hierarchy atomically?
>
> Thanks in advance.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/08192f19-ca56-4c79-8db0-12b0c697b502%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Operati... Vitaly Dukhota
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... Vitaly Dukhota
        • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
    • Re... Van Vu
      • ... Vitaly Dukhota

Reply via email to