Campaign drafts

  • Campaign drafts allow you to stage changes to a base campaign in a virtual draft campaign before applying them.

  • The base campaign is a normal, active campaign, while the draft campaign is a virtual layer for aggregating changes without affecting serving ads.

  • Creating a campaign draft involves creating a CampaignDraft resource and specifying its base campaign and name.

  • Modifications to a draft campaign are made by finding its associated draft campaign resource name and treating it like a real campaign.

  • You can either promote a draft campaign to apply its changes to the base campaign (asynchronous) or remove the campaign draft to discard the changes (synchronous).

Campaign drafts are a way of staging some set of intended changes to a base campaign. Each campaign draft has a base campaign and a draft campaign associated with it.

  • The base campaign is a normal campaign in your account, with ads, ad groups, and other resources.
  • The draft campaign is a virtual layer where changes are aggregated as you perform operations, but don't affect any real campaigns in your account. Once you are satisfied with the state of the draft campaign, you can apply it to a real campaign in a few different ways.

You can find a complete example of experiment creation in the code samples catalog.

Create a draft

To create a CampaignDraft:

  1. Create a CampaignDraft object with the following fields:

    • base_campaign: The resource name of the campaign that this draft will be based on.
    • name: A name for your campaign draft.
  2. Next, create a CampaignDraftOperation with the create field set to the CampaignDraft object you created.

  3. Finally, send this operation to the Google Ads API using the CampaignDraftService.MutateCampaignDrafts method. The create request is synchronous and returns a response immediately.

Modify a draft campaign

After you create a campaign draft, you can retrieve its resource name from the results field of the MutateCampaignDraftsResponse.

You must retrieve the resource name of its associated draft campaign before you can make changes to it. With the campaign draft resource name, you can query GoogleAdsService.SearchStream to find the draft campaign:

SELECT campaign_draft.draft_campaign
FROM campaign_draft
WHERE campaign_draft.resource_name = "CAMPAIGN_DRAFT_RESOURCE_NAME_HERE"

After you have the draft campaign's resource name, you can modify it like any other campaign in your account. The draft campaign cannot serve ads, but acts as a staging area for changes that you can apply to a base campaign later.

Promote or remove a draft campaign

After you are done configuring your draft campaign, you have a few options:

  1. Promote the draft campaign to the base campaign by calling CampaignDraftService.PromoteCampaignDraft. This applies all the changes you made in the draft campaign to the base campaign. This is an asynchronous operation.
  2. Remove the campaign draft using the remove operation of CampaignDraftService.MutateCampaignDrafts, passing in the resource name of the campaign draft. This cancels the draft and discards any changes if you decided not to proceed. This is a synchronous operation.