AdsApp.​Draft

Represents a Google Ads draft. Drafts can be used to prepare changes to campaigns, either by applying them directly or running an experiment. For more information, refer to our guide to Drafts and Experiments.

Methods:

MemberTypeDescription
getBaseCampaign AdsApp.Campaign Returns the base campaign to which this draft belongs.
getDraftCampaign AdsApp.Campaign Returns the draft campaign associated with this draft.
getEntityType String Returns the type of this entity as a String, in this case, "Draft".
getId String Returns the ID of the draft.
getName String Returns the name of the draft.
getResourceName String Returns the resource name of the draft.
getStatus String Returns the status of the draft.
hasRunningExperiment boolean Returns true if the draft has a currently-running experiment.
newExperimentBuilder AdsApp.ExperimentBuilder
remove void Removes the draft, thereby removing its associated draft campaign, but not removing the associated base campaign.
setName void Sets the name of the draft.
startApplying void Starts applying the draft's changes back to the base campaign.

getBaseCampaign()

Returns the base campaign to which this draft belongs.

Return values:

TypeDescription
AdsApp.Campaign The base campaign to which this draft belongs.

getDraftCampaign()

Returns the draft campaign associated with this draft.

Return values:

TypeDescription
AdsApp.Campaign The draft campaign associated with this draft.

getEntityType()

Returns the type of this entity as a String, in this case, "Draft".

Return values:

TypeDescription
String Type of this entity: "Draft".

getId()

Returns the ID of the draft.

Return values:

TypeDescription
String The ID of the draft.

getName()

Returns the name of the draft.

Return values:

TypeDescription
String Name of the draft.

getResourceName()

Returns the resource name of the draft.

Return values:

TypeDescription
String The resource name of the draft.

getStatus()

Returns the status of the draft. Possible values: DRAFTED, APPLIED, APPLYING, REMOVED, UNABLE_TO_APPLY.

Return values:

TypeDescription
String The status of the draft.

hasRunningExperiment()

Returns true if the draft has a currently-running experiment.

Return values:

TypeDescription
boolean true if the draft has a currently-running experiment.

newExperimentBuilder()

Returns a new experiment builder for this draft. Once built, the experiment will run with the changes made in this draft.

Return values:

TypeDescription
AdsApp.ExperimentBuilder A new experiment builder for this draft.

remove()

Removes the draft, thereby removing its associated draft campaign, but not removing the associated base campaign.

Returns nothing.

setName(name)

Sets the name of the draft.

Returns nothing.

Arguments:

NameTypeDescription
name String The new name for the draft.

startApplying()

Starts applying the draft's changes back to the base campaign. Does not wait for completion. View this draft in the "All drafts" tab of the UI to see if its changes are finished being applied.

Returns nothing.