Hi All,
Thank you for reaching out to us. This is Yasmin from the Google Ads Scripts Team. Please excuse us for only getting back now as your message failed to be routed to our support queue.
@Sigurd - Thanks for providing your insights here.
@Chandan - I've created a script which can fit your use-case; kindly find it in the attachments. I would recommend to test this in Preview Mode. Once satisfied with the output, you can start the live execution of the script or schedule it.
Let us know if you have any further clarifications.
Best regards,
|
||||||
Hi Chandan,
I'm afraid that it's not recommended to set a time that's minute specific as scripts is on an hourly basis. You can implement an if-else statement to check if a date (such as today) is greater than or equal to the date and time you're aiming to set the script to pause the campaign. I would recommend creating a new date object of today, and compare it with a specific date object of when you'd like the script to pause the campaign. It's also helpful logging these objects in order to get a grasp of how they are considered.
Kindly do note that, when creating a date object using a string that does not provide a timezone offset, the timezone is assumed to be America/Los_Angeles (Pacific time), regardless of the timezone associated with the Google Ads account. That being said, you can refer to our documentation on Working with Dates and Times for more information on important concepts, common pitfalls, and recommended approaches when working with dates and times in Google Ads scripts.
Let us know if you have any further clarifications.
Best regards,
![]() |
Google Ads Scripts Team |