Is .snippets() working?

7 views
Skip to first unread message

Jean-Charles FABRE

unread,
Jul 12, 2018, 5:29:33 PM7/12/18
to AdWords API and Google Ads API Forum
Hello,

I'm trying to get stats of the structured snippet extensions of my account with the script below but nothing is returned despite the fact that I have SSE with stats on all my campaigns.

What am I doing wrong?

function getSnippetStats() {
  var campaignIterator = AdWordsApp.campaigns()
        .get();
  if (campaignIterator.hasNext()) {
    var campaign = campaignIterator.next();
    var snippetsIterator = campaign.extensions().snippets().get();

    while (snippetsIterator.hasNext()) {
      var snippet = snippetsIterator.next();

      var stats = snippet.getStatsFor('LAST_MONTH');
      Logger.log(snippet.getHeader() + ', ' + stats.getClicks() + ', ' +
          stats.getImpressions());
    }
  }
}

Luis Xander Talag (AdWords API Team)

unread,
Jul 12, 2018, 11:42:37 PM7/12/18
to AdWords API and Google Ads API Forum
Hi Jean,

Your concern seems to be related to AdWords Scripts rather than the AdWords API. I would suggest to post your issue on the AdWords Scripts Forum to better assist you here.

Thanks and regards,
Luis
AdWords API Team
Reply all
Reply to author
Forward
0 new messages