Impression Share Script

284 views
Skip to first unread message

alex.kr...@360i.com

unread,
Dec 7, 2016, 11:08:13 AM12/7/16
to AdWords Scripts Forum
Hi,

In the process of making an hourly impression share report to make into a graph.

Have the following:

function main() {

var campaignNameContains = "";
  
var MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
var now = new Date();
var from = new Date(now.getTime() - 16 * MILLIS_PER_DAY);
var to = new Date(now.getTime() - 2 * MILLIS_PER_DAY);
  
var timeZone = AdWordsApp.currentAccount().getTimeZone();

var url = '';
  var ss = SpreadsheetApp.openByUrl(url);
  var sheet = ss.getActiveSheet();
var report = AdWordsApp.report(
  "SELECT Date, CampaignName, HourOfDay, Impressions, SearchImpressionShare " +
  "FROM CAMPAIGN_PERFORMANCE_REPORT " +
  "WHERE CampaignName CONTAINS_IGNORE_CASE '" + campaignNameContains + "' " +
  'DURING ' + Utilities.formatDate(from, timeZone, 'yyyyMMdd') + ','
            + Utilities.formatDate(to, timeZone, 'yyyyMMdd'));

  report.exportToSheet(sheet);
}

Working well so far but some parts of the data are exported as "< 10%"

Is there anyway to have this turn up as 0.05 instead?

Many thanks

Tyler Sidell (AdWords Scripts Team)

unread,
Dec 7, 2016, 11:45:37 AM12/7/16
to AdWords Scripts Forum
Hi,

Unfortunately, right now if the search impression share is less than 10%, it will return that value.  I have already discussed this with the rest of the team.  if the behavior changes, I will go ahead and update this thread.

Thanks,
Tyler Sidell
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages