![]() |
Google Ads Scripts Team |
I've found this solution:const Ndays = 5;const timeZone = AdsApp.currentAccount().getTimeZone();
const MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
const today = new Date();
const yesterday = new Date(today.getTime() - MILLIS_PER_DAY);
const startDate = new Date(yesterday.getTime() - Ndays*MILLIS_PER_DAY);
With this values, in the gaql query add this segment:"segments.date BETWEEN '"
+ Utilities.formatDate(startDate, timeZone, format) + "' AND '"
+ Utilities.formatDate(yesterday, timeZone, format) + "'";And it works!I hope this help to someone
El viernes, 28 de julio de 2023 a las 11:17:30 UTC+2, Alberto Esteves Correia escribió:
--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/b29e5e48-bdd1-4000-aa04-6f9fbded228an%40googlegroups.com.
I've found this solution:const Ndays = 5;const timeZone = AdsApp.currentAccount().getTimeZone();
const MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
const today = new Date();
const yesterday = new Date(today.getTime() - MILLIS_PER_DAY);
const startDate = new Date(yesterday.getTime() - Ndays*MILLIS_PER_DAY);With this values, in the gaql query add this segment:"segments.date BETWEEN '"
+ Utilities.formatDate(startDate, timeZone, format) + "' AND '"
+ Utilities.formatDate(yesterday, timeZone, format) + "'";And it works!I hope this help to someone
El viernes, 28 de julio de 2023 a las 11:17:30 UTC+2, Alberto Esteves Correia escribió:
usjwHePzDd
TfVi7gI3AV