Workbook above the limit of 5000000 cells

115 views
Skip to first unread message

Julie Baioni

unread,
May 24, 2019, 2:17:46 AM5/24/19
to Google Ads Scripts Forum
This is what I am running, but I get the error:  This action would increase the number of cells in the workbook above the limit of 5000000 cells.
I am running ALL the fields for a complete report.  I know I saw something about setting the param to not exceed this number, but I can't find the code for it now that I need it.  Can anyone help me?



//Running Keyword Performance Report
var QUERIES = [{'query' : 'SELECT AbsoluteTopImpressionPercentage, AccountCurrencyCode, AccountDescriptiveName, AccountTimeZone, ActiveViewCpm, ActiveViewCtr, ActiveViewImpressions, ActiveViewMeasurability, ActiveViewMeasurableCost, ActiveViewMeasurableImpressions, ActiveViewViewability, AdGroupId, AdGroupName, AdGroupStatus, AllConversionRate, AllConversions, AllConversionValue, ApprovalStatus, AverageCost, AverageCpc, AverageCpe, AverageCpm, AverageCpv, AveragePageviews, AveragePosition, AverageTimeOnSite, BaseAdGroupId, BaseCampaignId, BiddingStrategyId, BiddingStrategyName, BiddingStrategySource, BiddingStrategyType, BounceRate, CampaignId, CampaignName, CampaignStatus, ClickAssistedConversions, ClickAssistedConversionsOverLastClickConversions, ClickAssistedConversionValue, Clicks, ConversionRate, Conversions, ConversionValue, Cost, CostPerAllConversion, CostPerConversion, CostPerCurrentModelAttributedConversion, CpcBid, CpcBidSource, CpmBid, CreativeQualityScore, Criteria, CriteriaDestinationUrl, CrossDeviceConversions, Ctr, CurrentModelAttributedConversions, CurrentModelAttributedConversionValue, CustomerDescriptiveName, Date, DayOfWeek, EngagementRate, Engagements, EnhancedCpcEnabled, EstimatedAddClicksAtFirstPositionCpc, EstimatedAddCostAtFirstPositionCpc,  FinalAppUrls, FinalMobileUrls, FinalUrls, FinalUrlSuffix, FirstPageCpc, FirstPositionCpc, GmailForwards, GmailSaves, GmailSecondaryClicks, HasQualityScore, HistoricalCreativeQualityScore, HistoricalLandingPageQualityScore, HistoricalQualityScore, HistoricalSearchPredictedCtr, Id, ImpressionAssistedConversions, ImpressionAssistedConversionsOverLastClickConversions, ImpressionAssistedConversionValue, Impressions, InteractionRate, Interactions, InteractionTypes, IsNegative, KeywordMatchType, LabelIds, Labels, Month, MonthOfYear, PercentNewVisitors, PostClickQualityScore, QualityScore, Quarter, SearchAbsoluteTopImpressionShare, SearchBudgetLostAbsoluteTopImpressionShare, SearchBudgetLostTopImpressionShare, SearchExactMatchImpressionShare, SearchImpressionShare, SearchPredictedCtr, SearchRankLostAbsoluteTopImpressionShare, SearchRankLostImpressionShare, SearchRankLostTopImpressionShare, SearchTopImpressionShare, Status, SystemServingStatus, TopImpressionPercentage, TopOfPageCpc, TrackingUrlTemplate, UrlCustomParameters, ValuePerAllConversion, ValuePerConversion, ValuePerCurrentModelAttributedConversion, VerticalId, VideoQuartile100Rate, VideoQuartile25Rate, VideoQuartile50Rate, VideoQuartile75Rate, VideoViewRate, VideoViews, ViewThroughConversions, Week, Year ' +
    'FROM   KEYWORDS_PERFORMANCE_REPORT ' +
    'DURING LAST_30_DAYS',
                //Put Url of Google spreadsheet the script with update
                'spreadsheetUrl' : 'SPREADSHEET_URL_HERE',
                //Add tabName for different tabs if you want to add more Reports 
                'tabName' : 'Sheet1',
                //Use Current version for AdWords: Check for Google Adwords updates on versions 
                'reportVersion' : 'v201809'
               }];

// Setting the Data to Print to Spreadsheet and update

function main() {
  for(var i in QUERIES) {
    var queryObject = QUERIES[i];
    var query = queryObject.query;
    var spreadsheetUrl = queryObject.spreadsheetUrl;
    var tabName = queryObject.tabName;
    var reportVersion = queryObject.reportVersion;
    //log to view bugs
    Logger.log(spreadsheetUrl + " " + query);
    //Don't forget to put spreadsheet Url in code above
    var spreadsheet = SpreadsheetApp.openByUrl(spreadsheetUrl);
    //this calls the tab name and will not print without name
    var sheet = spreadsheet.getSheetByName(tabName);
     var report = AdWordsApp.report(query, {apiVersion: reportVersion});
    report.exportToSheet(sheet);
  }
}

Google Ads Scripts Forum Advisor Prod

unread,
May 24, 2019, 5:54:44 AM5/24/19
to adwords...@googlegroups.com

Hi Julie,

With regard to the issue that you are encountering during getting data from Keywords Performance Report, you may add condition to lessen the result and not to exceed the limit. You may refer to the following guides to modify your query.

Please let me know if you have further concerns or if you encounter any issues.

Regards,
Hiroyuki
Google Ads Scripts Team



ref:_00D1U1174p._5001UAqVNf:ref

Julie Baioni

unread,
May 24, 2019, 12:48:22 PM5/24/19
to Google Ads Scripts Forum
I appreciate you getting back to me.  The keywords (criteria) in the report are what we want, so how do I set how many keywords to take in so I don't exceed the cell limit.  I want to get as many as I can.  Any suggestions?  If I add a condition not related to the keyword(criteria), then I am not getting the report I need. Can I add a condition for criteria?  It says I can't set a limit.  It specifically says you can't set limit in a report.  

Google Ads Scripts Forum Advisor Prod

unread,
May 27, 2019, 2:08:45 AM5/27/19
to adwords...@googlegroups.com

Hi Julie,

Unfortunately, it is currently not possible to limit the number of rows that you get from the report. However, it is possible to add condition for Criteria as this is a filterable field. You may add condition in your WHERE clause depending on your preference.

If you can't resolve the issue after trying the above, I would suggest you to confirm the following.

  • Remove unnecessary fields from SELECT clause if there is
  • update time range to shorter than LAST_30_DAYS

Please let me know if you have further concerns.

Julie Baioni

unread,
May 27, 2019, 4:13:34 PM5/27/19
to Google Ads Scripts Forum
Thank you for the info.  I have successfully run a report by following  what you suggested.  
Reply all
Reply to author
Forward
0 new messages