Hide
AdWords scripts

AdWordsApp.Stats

Statistics common to various entity types.

Typical usage:

 var stats = campaign.getStatsFor("LAST_MONTH");
 var impressions = stats.getImpressions();
 var clicks = stats.getClicks();
 // etc.

Note that Analytics-related stats (Stats.getAveragePageviews(), Stats.getAverageTimeOnSite() and Stats.getBounceRate()) are only available for Campaigns, Ad groups, Keywords, and Ads. The method calls will return null for other entity types.

Entities with stats:

Methods:

MemberTypeDescription
getAverageCpc double Returns the average cost per click.
getAverageCpm double Returns the average cost per thousand impressions.
getAveragePageviews double Returns the average number of pages viewed per visit.
getAveragePosition double Returns the average position.
getAverageTimeOnSite double Returns the average time a visitor spent on site, in seconds.
getBounceRate double Returns the bounce rate of the entity, in 0..1 range.
getClickConversionRate double Returns the conversion rate for clicks, in 0..1 range.
getClicks long Returns the number of clicks.
getConversionRate double Returns the conversion rate, in 0..1 range.
getConversions long Returns the number of conversions.
getConvertedClicks long Returns the number of clicks that converted.
getCost double Returns the cost in the default currency of the account.
getCtr double Returns the click through rate of the entity, in 0..1 range.
getImpressions long Returns the number of impressions.

getAverageCpc()

Returns the average cost per click.

Return values:

TypeDescription
double The average cost per click.

getAverageCpm()

Returns the average cost per thousand impressions.

Return values:

TypeDescription
double The average cost per thousand impressions.

getAveragePageviews()

Returns the average number of pages viewed per visit. Returns null if the account is not linked to Analytics.

Return values:

TypeDescription
double The average page views.

getAveragePosition()

Returns the average position.

Return values:

TypeDescription
double The average position.

getAverageTimeOnSite()

Returns the average time a visitor spent on site, in seconds. Returns null if the account is not linked to Analytics.

Return values:

TypeDescription
double The average time on site.

getBounceRate()

Returns the bounce rate of the entity, in 0..1 range. When a visitor to your site sees only one page or triggers only one event, Analytics considers this visit a "bounce." Returns null if the account is not linked to Analytics.

Return values:

TypeDescription
double The bounce rate.

getClickConversionRate()

Returns the conversion rate for clicks, in 0..1 range.

Return values:

TypeDescription
double The conversion rate for clicks.

getClicks()

Returns the number of clicks.

Return values:

TypeDescription
long The number of clicks.

getConversionRate()

Returns the conversion rate, in 0..1 range.

Return values:

TypeDescription
double The conversion rate.

getConversions()

Returns the number of conversions.

Return values:

TypeDescription
long The number of conversions.

getConvertedClicks()

Returns the number of clicks that converted.

Return values:

TypeDescription
long The number of clicks that converted.

getCost()

Returns the cost in the default currency of the account.

Return values:

TypeDescription
double The cost in the default currency of the account.

getCtr()

Returns the click through rate of the entity, in 0..1 range.

Return values:

TypeDescription
double The click through rate.

getImpressions()

Returns the number of impressions.

Return values:

TypeDescription
long The number of impressions.