Filling a map {kw_id --> date, daily_impr}
Filling a map {kw_text --> id, list_of_labels }
'WHERE LabelIds IN ["' + arrayOfIds.join('","') + '"] 'Hi Everyone,
Thank you for reaching out to us.
When checking for keywords, please note that keyword IDs may be shared across ad groups. To uniquely identify a keyword, you must specify both its adgroup and the keyword ID. You may refer to this detailed explanation for more details.
As for the script on Filling a map {kw_id --> date, daily_impr}, please change this line (const id = row["Id"];). The id should be var instead of const. Otherwise, you'll only be referencing a single ID value.
Regards,
|
||||||
var labelsIds = [];

--
-- 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 a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/TqxVrXY98rc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/d8e3b468-e244-4f82-a228-9799e41c8d80o%40googlegroups.com.
var settings = { url: 'https://docs.google.com/spreadsheets/rest-of-url', // export data to this spreadhseet sheet: 'SheetName', label:'test', // only fetch keywords with this label report: 'KEYWORDS_PERFORMANCE_REPORT', daysAgo: 14, // start date will be this number of days before yesterday. End date will be yesterday }
function main() { doStuff();}function doStuff() { var timePeriod = dates(); var labelIter = AdsApp.labels() .withCondition('Name = '+ settings.label) .get(); if (labelIter.totalNumEntities() === 1) { var labelId = labelIter.next().getId(); } else {Logger.log('Found: '+labelIter.totalNumEntities()+' labels. Expected 1')}
var report = AdsApp.report( 'SELECT ' + 'Date,AdGroupId,AdGroupName,Id,Criteria,LabelIds,Labels,Impressions ' + 'FROM ' + settings.report.toUpperCase() + ' ' + 'WHERE ' + 'LabelIds CONTAINS_ALL ["' + labelId + '"] ' + // use CONTAINS_ALL/CONTAINS_ANY with LabelIds. IN/NOT_IN doesn't work 'DURING ' + timePeriod ); var ss = SpreadsheetApp.openByUrl(settings.url); var sheet = ss.getSheetByName(settings.sheet); report.exportToSheet(sheet);Logger.log('All done!\n\n..data for these dates '+timePeriod+' exported to this spreadsheet:\n\n'+settings.url); }function dates() {var timeZone = AdsApp.currentAccount().getTimeZone(); var today = new Date(); var oneDay = 1000*60*60*24; var yesterday = new Date(today-oneDay); var xDays = oneDay * settings.daysAgo; var xDaysAgo = new Date(yesterday-xDays); var dateFormat = 'yyyyMMdd'; var startDate = Utilities.formatDate(xDaysAgo,timeZone,dateFormat); var endDate = Utilities.formatDate(yesterday,timeZone,dateFormat); return startDate + ',' + endDate}Thanks, but the array is const. No? It's content is mutable.I have tried that, and still the report doesn't finish.
To unsubscribe from this group and all its topics, send an email to adwords...@googlegroups.com.
Hi Elad,
Thanks for getting back to us.
With regard to this inquiry ("From the screenshot attached, it seems "id" in both results are of 6 digits. So just need to compare, as is. Correct?"), yes, you just need to compare those IDs together with their respective AdGroup ID to get the actual keyword (as stated on my previous response on the uniqueness of the keyword). As for your other questions, I do agree with Sigurd's answers on those. You can also refer to the sample script shared by Sigurd. I've also checked that script on my end.
Feel free to let us know if you have further questions/concerns.
@Sigurd - thanks for sharing with us your sample script.
Regards,
var videoAds = AdsApp .videoAds() .withCondition('????') .get();Hi all,
I have this code:
I'm not sure what to put in the withCondition to get all such only beaconsless videoAds.I have seen this doc, but wasn't sure what where clause could fit.
Thanks
|
||||||
Hey, Elad. I'm still digging, but I don't think we expose beacon tracking information in the Ads UI or in the Scripts product. It would help me investigate if you could provide an account with an ad with beacon tracking enabled, so I can look them up in ICS.As a short-term workaround, if the client knows which ads do / do not have beacon tracking, then they could write the condition as something like `Id IN [...]` or `Id NOT IN [...]`
|
||||||
|
||||||
--
-- 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 a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/TqxVrXY98rc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/qO-W9000000000000000000000000000000000000000000000QTOX2R00plDENlniTmeFAXLZ38BUsQ%40sfdc.net.
|
||||||
|
||||||
--
-- 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 a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/TqxVrXY98rc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/-sr3U000000000000000000000000000000000000000000000QW7TS700cQVwNNeFSAyOciaArwQ5Ig%40sfdc.net.
|
||||||