Bugs with Drafts and Experiments in the New Scripts Experience

400 views
Skip to first unread message

Tamsin Mehew

unread,
Apr 20, 2022, 9:27:48 AM4/20/22
to Google Ads Scripts Forum
Hi,

I've had a couple of issues with Drafts and Experiments in the new scripts experience:

1. draft.hasRunningExperiment() works for drafts from a DraftSelector. But if the draft is from DraftOperation.getResult() then you get a system error

SystemError: Could not read from Google Ads
(Internal details: Missing field campaignDraft.hasExperimentRunning
in object {
  "campaign": {
    "resourceName": "customers/{customer id}/campaigns/{campaign id}",
    "status": "ENABLED",
    "adServingOptimizationStatus": "OPTIMIZE",
    "experimentType": "BASE",
    "biddingStrategyType": "TARGET_SPEND",
    "targetingSetting": {
      "targetRestrictions": [
        {
          "targetingDimension": "AUDIENCE",
          "bidOnly": true
        }
      ]
    },
    "baseCampaign": "customers/{customer id}/campaigns/{campaign id}",
    "name": "Test Search Campaign",
    "id": "{campaign id}",
    "campaignBudget": "customers/{customer id}/campaigns/{campaign id}",
    "startDate": "2022-04-20",
    "endDate": "2037-12-30"
  },
  "campaignDraft": {
    "resourceName": "customers/{customer id}/campaigns/{campaign id}~-1",
    "draftId": "-1",
    "baseCampaign": "customers/{customer id}/campaigns/{campaign id}",
    "name": "Test Search Campaign - Draft"
  }
})
    at g (adsapp_compiled:273:50)
    at Ba (adsapp_compiled:278:3)
    at wx.hasRunningExperiment (adsapp_compiled:11575:12)
    at Object.<anonymous> (adsapp_compiled:18315:54)



2. ExperimentBuilder's documentation says withEndDate() and withStartDate() are optional
However if you use the sample code to build an experiment without a start or end date you get an input error
  InputError: Can't build experiment:
  - required field startDate is missing
  - required field endDate is missing
    at Jk (adsapp_compiled:3263:11)
    at V (adsapp_compiled:3253:3)
    at ux.startBuilding (adsapp_compiled:11657:5)
    at Object.<anonymous> (adsapp_compiled:18315:54)




Thanks,
Tamsin
 

Google Ads Scripts Forum Advisor

unread,
Apr 21, 2022, 5:52:53 AM4/21/22
to adwords...@googlegroups.com

Hello Tamsin,

 

Michael here from Google Ads scripts Team.

 

For us to investigate further on the issue, kindly provide the following details:

  • Customer ID / CID
  • Scriptname

Regards,

Google Logo
Michael Angelo
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a54mM:ref

Tamsin Mehew

unread,
Apr 21, 2022, 10:00:55 AM4/21/22
to Google Ads Scripts Forum
Hello Michael,

  • The CID is 226-673-4799
  • The script name is 'Drafts & Experiments testing'

Thanks!

Google Ads Scripts Forum Advisor

unread,
Apr 27, 2022, 7:56:36 AM4/27/22
to adwords...@googlegroups.com

Hello Tamsin,

I’m James, also a member of the Google Ads scripts support team. Allow me to assist you further.

Can you please confirm if you’re executing the mentioned script using preview mode or you’re actually running it?

I suggest that you run your script because it allows you to actually build the draft on your account instead of previewing it. Also, make sure that the name that you will provide in the withName() method of your draft builder should be unique.

After that, can you also create a specific functionality that will delay the execution of your createExperiment function inorder to give more time with the draft to be built successfully in our backend? 

Lastly, regarding the issue with your experimentBuilder, I know that including start date and end date is optional based on our documentation, but can you please try to include it within your experimentBuilder?

Please let me know how it goes on your end.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a54mM:ref

Tamsin Mehew

unread,
May 10, 2022, 12:56:51 PM5/10/22
to Google Ads Scripts Forum
Hello James,

> Can you please confirm if you’re executing the mentioned script using preview mode or you’re actually running it?
> I suggest that you run your script because it allows you to actually build the draft on your account instead of previewing it. Also, make sure that the name that you will provide in the withName() method of your draft builder should be unique.

I've tried actually running it today and did not get a system error from draft.hasRunningExperiment(). 
(I thought I did get that error from actually running the script before, but either I'm mistaken or the problem is fixed. Either way it's good!)

Sadly the input error from creating the experiment is still there.


> After that, can you also create a specific functionality that will delay the execution of your createExperiment function inorder to give more time with the draft to be built successfully in our backend? 

I tried adding a sleep of 60 seconds, and there was still an input error when creating the experiment.


> Lastly, regarding the issue with your experimentBuilder, I know that including start date and end date is optional based on our documentation, but can you please try to include it within your experimentBuilder?

I've included a start and end date:
  experimentBuilder.withName(newExperimentName)
      .withStartDate("20220511")
      .withEndDate("20361230")
      .withTrafficSplitPercent(50)
      .startBuilding();


When I ran this, the run's status in Script History was 'Incomplete' and there was a different error message
10/05/2022 17:23:39 Exception: Call to CampaignExperimentService.CreateCampaignExperiment failed: The required field was not present.
    at adsapp_compiled:18069:354
    at adsapp_compiled:18080:9
    at sa (adsapp_compiled:228:15)
    at Object.call (adsapp_compiled:236:20)
    at cI.create (adsapp_compiled:18209:16)
    at vx.startBuilding (adsapp_compiled:11659:15)
    at Object.<anonymous> (adsapp_compiled:18324:54)


(This happens even if there's a 60 second sleep between creating the draft and trying to create the experiment)

Thanks for your help!
Tamsin

Google Ads Scripts Forum Advisor

unread,
May 12, 2022, 10:16:27 PM5/12/22
to adwords...@googlegroups.com
Hi Tamsin,

I work along with James. Allow me to assist you in this.

I've checked the script in question and I'm getting an error "SystemError: Could not read from Google Ads (Internal details: Missing field campaignDraft.hasExperimentRunning" on my end which is different to what you reported. Could you please confirm this? Also, could you please provide a screenshot of your error that you were getting on your end? Once provided, I'll be sharing this to the wider team for further investigation.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a54mM:ref

Tamsin Mehew

unread,
Jun 9, 2022, 9:13:58 AM6/9/22
to Google Ads Scripts Forum
Hi Teejay,

I get the "Missing field campaignDraft.hasExperimentRunning" when running on preview 

Preview_with_error.png


The "Exception: Call to CampaignExperimentService.CreateCampaignExperiment failed: The required field was not present." error happens when the script is run. Here's a screenshot
Running_error.png

Thanks for looking into this,
Tamsin

Google Ads Scripts Forum Advisor

unread,
Jun 14, 2022, 12:27:39 AM6/14/22
to adwords...@googlegroups.com
Hi Tamsin,

Thank you for getting back to us. I've raised this (including the reports and findings thus far) to the rest of the team for further investigation. I'll update this thread the soonest they share their feedback.

Tamsin Mehew

unread,
Jun 14, 2022, 3:12:37 AM6/14/22
to Google Ads Scripts Forum
Thank you, Teejay

Tamsin Mehew

unread,
Oct 6, 2022, 6:11:25 AM10/6/22
to Google Ads Scripts Forum
Hi,

I was wondering if there's any update on this?

I've just tried the script again and I get the same exception ("Call to CampaignExperimentService.CreateCampaignExperiment failed: The required field was not present."). And there's only a few weeks before the old Ads Scripts experience goes away and we won't be able to create experiments with scripts at all.

Thanks,
Tamsin

Google Ads Scripts Forum

unread,
Oct 20, 2022, 11:30:48 PM10/20/22
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/zb7AvUL9zFM) from the forum as it wasn't routed to our support queue.

Regards,
Yasmin
Google Ads Scripts Team

Google Ads Scripts Forum Advisor

unread,
Oct 21, 2022, 6:51:40 AM10/21/22
to adwords...@googlegroups.com

Hello,

 

Just circling back here. It appears that our team has gotten to the bottom of the issue and submitted a fix. We'll update this thread once we've confirmed that it's live.

 

Regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a54mM:ref

Google Ads Scripts Forum Advisor

unread,
Nov 8, 2022, 2:58:59 AM11/8/22
to adwords...@googlegroups.com

Hello,

We appreciate your patience on this. 

I would like to inform you that this issue has been fixed. You may now try it on your end then let us know how it goes.

Thanks,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a54mM:ref

Tamsin Mehew

unread,
Nov 8, 2022, 2:08:14 PM11/8/22
to Google Ads Scripts Forum
Hi James,

Thanks for the update!

Unfortunately when I tried to run the script (after adding a traffic split type), it still fails - but now with a different error:
08/11/2022 18:54:47 Exception: Call to CampaignExperimentService.CreateCampaignExperiment failed: Cannot create an experiment from a draft, which has a status other than proposed.
    at adsapp_compiled:18880:354
    at adsapp_compiled:18891:9
    at sa (adsapp_compiled:236:15)
    at Object.call (adsapp_compiled:244:20)
    at aJ.create (adsapp_compiled:19025:16)
    at $x.startBuilding (adsapp_compiled:12067:15)
    at $x.startBuilding (adsapp_compiled:12086:11)
    at Object.<anonymous> (adsapp_compiled:19141:54)


I'm a bit confused by this as 'proposed' doesn't look like any of the possible statuses for drafts (DRAFTEDAPPLIEDAPPLYINGREMOVEDUNABLE_TO_APPLY), and there isn't a way to directly change a draft's status. Is this another bug?


Also I checked what happens when running the script without specifying an end date or start date - this still gives 'required field' errors, despite the documentation saying they are not required fields.
08/11/2022 18:29:09 InputError: Can't build experiment:

  - required field startDate is missing
  - required field endDate is missing
    at Vk (adsapp_compiled:3309:11)
    at V (adsapp_compiled:3299:3)
    at $x.startBuilding (adsapp_compiled:12065:5)
    at $x.startBuilding (adsapp_compiled:12086:11)
    at Object.<anonymous> (adsapp_compiled:19141:54)


Thanks again,
Tamsin

Google Ads Scripts Forum

unread,
Nov 14, 2022, 2:06:15 AM11/14/22
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/zb7AvUL9zFM) from the forum as it wasn't routed to our support queue.

Regards,
Yasmin
Google Ads Scripts Team

Google Ads Scripts Forum

unread,
Nov 14, 2022, 4:13:31 AM11/14/22
to Google Ads Scripts Forum
Hi Tamsin,

Thank you for getting back to us and confirming an issue is still encountered.

Before I may communicate this, could you please confirm if you've tried to update your script to specify either withTrafficSplitType('COOKIE') or withTrafficSplitType('RANDOM_QUERY') depending on whether you want a cookie-based or search-based traffic split? If you haven't yet, I would recommend for you to do so and kindly let us know how it goes on your end.


Regards,
Yasmin
Google Ads Scripts Team

Tamsin Mehew

unread,
Nov 14, 2022, 4:28:04 AM11/14/22
to Google Ads Scripts Forum
Hi Yasmin,

Yes, when I ran the script on the 8th I had added withTrafficSplitType("COOKIE").

  var experimentBuilder = draft.newExperimentBuilder();
  experimentBuilder.withName(newExperimentName)
      .withStartDate("20221111")
      .withEndDate("20361230")
      .withTrafficSplitPercent(50)
      .withTrafficSplitType("COOKIE")
      .startBuilding();


Thanks,
Tamsin

Tamsin Mehew

unread,
Jan 24, 2023, 7:04:39 AM1/24/23
to Google Ads Scripts Forum
Hi,

Just wondering if there's any update to this issue?

Thanks,
Tamsin

Google Ads Scripts Forum

unread,
Feb 3, 2023, 2:47:15 AM2/3/23
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/zb7AvUL9zFM) from the forum as it wasn't routed to our support queue.

Regards,
Yasmin
Google Ads Scripts Team

Google Ads Scripts Forum Advisor

unread,
Feb 3, 2023, 6:11:55 AM2/3/23
to adwords...@googlegroups.com

Hi,

 

Please excuse us for only getting back now as your message failed to be routed to our support queue.

 

It appears that the team has already confirmed that this issue has already been fixed. With this, can you please confirm if you are still experiencing an issue on your end? If you still are, could you please provide the screenshot of the latest execution of your script showing the error so that I may communicate this to our internal team?

 

Kindly send it via `Reply privately to author` option. If the said option is not available on your end, you may send those through the email alias `googleadsscr...@google.com` instead.

 

Best regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a54mM:ref

Tamsin Mehew

unread,
Feb 7, 2023, 12:33:35 PM2/7/23
to Google Ads Scripts Forum
Hi Yasmin,

I can confirm that I am still experiencing issues. I can't see a `Reply privately to author` option so I've emailed screenshots to the address you gave.

Thanks for your support,
Tamsin

Tamsin Mehew

unread,
Feb 14, 2023, 5:21:19 AM2/14/23
to Google Ads Scripts Forum
Hi Yasmin,

Could you please confirm that the email was received and the issues have been routed to the support queue? Or is there any additional information you need?

Thanks,
Tamsin

Google Ads Scripts Forum

unread,
Feb 17, 2023, 3:35:25 AM2/17/23
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/zb7AvUL9zFM/m/Pi8HnlukAQAJ) from the forum as it wasn't routed to our support queue.


Regards,
Yasmin
Google Ads Scripts Team

Google Ads Scripts Forum

unread,
Feb 17, 2023, 5:12:39 AM2/17/23
to Google Ads Scripts Forum
Hi Tamsin,

I can confirm that I was able to receive the email you had sent to us and have communicated it with our internal team. We'll keep you posted when we hear any relevant feedback.

Best regards,

Yasmin
Google Ads Scripts Team

Reply all
Reply to author
Forward
0 new messages