Wednesday, January 31, 2018

Working with Experiment Campaigns in AdWords Scripts

If you've started using Google's Draft and Experiment campaigns, you may have noticed some odd behavior with scripts. We were getting these campaigns back in our selectors, even if they were no longer active experiments. And if we tried to change their status to 'ended', we couldn't do so.

I'll explain the similarities and differences so that hopefully you can avoid some of the frustration I faced when we started using experiments in AdWords and some scripts started to break.

Experiment campaigns are like other campaigns in the following ways:

  1. Experiment campaigns are returned in API reports like CAMPAIGN_PERFORMANCE_REPORT
  2. Experiment campaigns are returned by AW Scripts selectors like campaignSelector = AdWordsApp.campaigns()
Experiment campaigns are unlike normal campaigns in some important ways:
  1. Experiment campaigns, once enabled are always enabled. If you end the experiment, the ServingStatus becomes 'ENDED' but the CampaignStatus remains 'ENABLED'
  2. Experiment campaigns cannot have labels
  3. Experiment campaigns cannot have their status or budget changed (as these are tied to the corresponding 'base' campaign)
As you can see, there are situations where some of these oddities can lead to issues. For example, if you have a script that pauses any campaigns that have exceeded a certain budget for the month (like those that Optmyzr provides), the script will recognize that an experiment campaign has spent too much but it will be unable to label it or pause it.

So I wanted to exclude experiment campaigns from my selectors and found this was possible and documented. You can exclude campaigns of different types by adding the following to a selector:
  • withCondition("CampaignExperimentType = BASE")
  • withCondition("CampaignExperimentType = DRAFT")
  • withCondition("CampaignExperimentType = EXPERIMENT")

But there is also an undocumented feature in AdWords Scripts that can help filter these campaigns:
  • withCondition("ServingStatus = SERVING")
The other possible condition values are ENDED, PENDING, NONE, SUSPENDED

The cool trick I learned here is that you can use conditions that are not documented in the AdWords Scripts reference. You just refer to the fields in the corresponding API report and try adding them to selectors.

Thanks to Alex from the Google team for pointing this out.


  1. It's really a nice and helpful piece of info. I am glad that you just shared this helpful
    information with us. Please keep us up to date like this.
    Best website designing company in Laxmi Nagar

  2. I am very grateful you did share your knowledge here. It is an exuberant post.

    P/S: Pls feel free to visit my place, if you care about sunglass spot free shipping

  3. I admire this article for the well-researched content and excellent wording
    seo company in chennai

  4. Do you know how to write a simple medical assistant resume? Here is a quality step by step guide

  5. Buy a discounted IWC watch from this Time and get free shipping. Large selection in stock. replica watches UKIWC watches, is an iconic brand. The IWC Portuguese, replica IWC watches sale a collection that includes the IWC Portuguese automatic and IWC Yacht Club chronograph is legendary. IWC Schaffhausen is also known for the IWC Aquatimer, Top Gun, Big Pilot watch, Mark XVII, Pilot's Watch, Spitfire chronograph and their Big Pilot Watch, the St-Exupery.

  6. This comment has been removed by the author.

  7. Another great resource for ad scripts is

    Reach out to Captive Nest if you have any questions about AdWords Scripts or complex API's.