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());
}
}
}