We’re very pleased to announce the release of AdCatalog v1 for the iOS platform. AdCatalog is a sample project that demonstrates how to incorporate banner and interstitial ad units into your application. In particular, AdCatalog showcases implementations for two standard banner ad sizes—320x50 and 300x250—and several use cases for interstitial ad units: basic, app launch splash screen, in-between game levels, and before playing a stored video.
AdCatalog can be downloaded as a zip from our google-mobile-dev project. Additionally, feel free to clone the repository or examine the source from the checkout page. In version 2, we’ll be looking to add even more advanced layout options to our banner scenario, so be sure to stay tuned. As usual, if you have any questions, comments, concerns, or feature requests, we appreciate hearing the feedback on our developer forum.
We recently announced upcoming changes to AdWords Impression Share metrics. If you are using the AdWords API to download BudgetLostImpressionShare, ImpressionShare, QualityLostImpressionShare and ExactMatchImpressionShare metrics in account and campaign performance reports, then the upcoming change will affect you in the following ways:
BudgetLostImpressionShare
ImpressionShare
QualityLostImpressionShare
ExactMatchImpressionShare
If you wish to backup old Impression Share data or make changes to the way you use Impression Share to control your AdWords campaigns, please do so before January 30th. If you have any questions about the AdWords API, check out our developer forum.
<reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/v201109"> <selector> <fields>CampaignId</fields> <fields>Id</fields> <fields>Impressions</fields> <fields>Clicks</fields> <fields>Cost</fields> <predicates> <field>Status</field> <operator>IN</operator> <values>ENABLED</values> <values>PAUSED</values> </predicates> </selector> <reportName>Custom Adgroup Performance Report</reportName> <reportType>ADGROUP_PERFORMANCE_REPORT</reportType> <dateRangeType>LAST_7_DAYS</dateRangeType> <downloadFormat>CSV</downloadFormat></reportDefinition>
$ xmllint --schema reportDefinition.xsd reportDefinition.xml[xml omitted]reportDefinition.xml validates
As we continue to improve the DFA API, two upcoming security enhancements are particularly noteworthy. We want you to be aware of adjustments to HTTP support and token lifespan and to take them into consideration when planning the development and upkeep of your applications.
Last year Google began an effort to improve the security of our APIs with SSL encryption. Most of Google’s Ads APIs already require requests to be made over HTTPS connections. The DFA API will be following suit this year. We’ll consider the use of HTTP connections deprecated with the release of v1.17 in mid-February, 2012. Support for making requests over HTTP will be completely retired in v1.18, expected to launch in May, 2012. Our client libraries will transition to using HTTPS connections during the launch of v1.17.
Currently, tokens generated from the login service’s authenticate operation do not expire unless the user profile’s password is changed. In the not-too-distant future, API tokens will have a timed lifespan. We will be adding a new error code to represent a failure due to an expired token so that your applications will be able to catch and handle this situation.
We do not have a concrete release date for token expirations yet. It will not be part of the v1.17 release. Please keep an eye on our blog for further updates about this topic. Questions and comments are always welcome on our forum.
Thanks for joining us for Chart Tools week on the blog, where we're sharing ways to use Google Chart Tools. In the fourth and last part of this series, we’ll examine how to organize and manage multiple charts that share the same underlying data using dashboards and controls.
The last request of the CEO is to be able to interact with the data: he wants to filter the line chart and the column chart by expressing a range of page views.
What we need to do now is compose the 2 charts into a Dashboard object, following these steps:
Dashboard
To create a Dashboard, we need the charts to share the same underlying data. For this reason, we will combine the requests for the line and the column chart into a single request:
The result will be similar to:
result = { "kind": "adsense#report", "totalMatchedRows": "9", "headers": [ {...} ], "rows": [ ["2011-01", "28", "46", "41", "165"], ... ["2011-11", "2", "3", "3", "3"] ], "totals": ["", "241", "278", "264", "825"], "averages": ["", "26", "30", "29", "91"]}
Now we can create our DataTable, adding columns for all the metrics:
DataTable
var data = new google.visualization.arrayToDataTable( [['Month', 'PAGE_VIEWS', 'AD_REQUESTS', 'MATCHED_AD_REQUESTS', 'INDIVIDUAL_AD_IMPRESSIONS']].concat(resp.rows));
The next step is to create the wrappers:
var lineChartWrapper = new google.visualization.ChartWrapper({ chartType: 'LineChart', options: {'title': 'Ad requests trend - Year 2011'}, containerId: 'line_chart_div', view: {'columns': [0, 2]}});var columnChartWrapper = new google.visualization.ChartWrapper({ chartType: 'ColumnChart', options: {'title': 'Performances per month - Year 2011'}, containerId: 'column_chart_div', view: {'columns': [0, 1, 3, 4]}});
There are two important differences between creating wrappers for a dashboard and wrappers for standalone charts:
Time to create the control!
Let’s create the control wrapper for our number range filter for the ad requests:
var adRequestsSlider = new google.visualization.ControlWrapper({ 'controlType': 'NumberRangeFilter', 'containerId': 'ad_requests_filter_div', 'options': { 'filterColumnLabel': 'Ad requests', }});
The option container_id specifies the element of the page where the filter will be drawn into, while filterColumnLabel tells the filter which column to target.
container_id
filterColumnLabel
Remember that we need a DataView to convert our string field to numeric fields:
DataView
var view = new google.visualization.DataView(data);view.setColumns([ 0, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 1))}, type:'number', label:'Page views'}, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 2))}, type:'number', label:'Ad requests'}, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 3))}, type:'number', label:'Matched ad requests'}, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 4))}, type:'number', label:'Individual ad impressions'},]);
Creating the Dashboard, binding the control to the charts and drawing the dashboard is as easy as the following:
var dashboard = new google.visualization.Dashboard( document.getElementById('dashboard_div')) .bind(adRequestsSlider, [lineChartWrapper, columnChartWrapper]) .draw(view);
dashboard_div is the element of the page that acts as container for the Dashboard:
dashboard_div
<div id="dashboard_div"> <!--Divs that will hold each control--> <div id="ad_requests_filter_div"></div> <!--Divs that will hold each chart--> <div id="line_chart_div"></div> <div id="column_chart_div"></div></div>
And it’s done! Our Dashboard is ready. Check the live example and the source code for today!
Well done -- our dashboard is ready and the CEO is happy with his new tool! Now you can relax and play foosball!
If you want to know more about our APIs, check the documentation pages:
And if you have any additional questions, don’t hesitate to engage with us in our forums:
You can also join us in one of our AdSense API Office Hours on Google+ Hangouts. Check the schedule for the upcoming Office Hours in our Google Ads Developer Blog.
Lastly, a public service announcement: thanks Riccardo for your help!
- Silvano Luciani, AdSense API Team
Last quarter we announced the release of Ad Catalog for Android, a sample project that demonstrates how to incorporate ads into your application using the Google AdMob SDK. Today, we are excited to announce the release of a walkthrough video to help you get started with Ad Catalog in five minutes! This video will guide you through the entire setup process, from downloading the source code to running it on an emulator. The only preconditions are that you have Eclipse installed as well as an Android SDK version 3.2 or higher.
Ad Catalog shows you two implementations for standard banner ads. You can select the size of the ad that is displayed on the Banners screen by selecting either the 320x50 standard banner ad or the 300x250 medium rectangle ad.
In addition to display ads, Ad Catalog demonstrates various use cases for interstitial ads. Ad Catalog provides examples on how to include interstitial ads in between game levels, before loading a YouTube video, and in between a screen swipe. There is also an option to receive a splash screen interstitial ad. If enabled, the app will load and display an interstitial ad the next time it starts up.
The first version of the Android Ad Catalog source code can be downloaded from the google-mobile-dev project. In the next version, we plan to add examples of banner ads in various advanced layouts. The iOS implementation of Ad Catalog is almost complete, so stay tuned for another release announcement. We appreciate your feedback, so please post any questions or feature requests you may have to our forum.
- Eric Leichtenschlag, AdMob Team
Welcome back to Chart Tools week here on the blog, where we're continuing our overview of generating charts for your AdSense reporting with Google Chart Tools. Today we’ll examine how to generate two other types of charts: a table chart and a geo chart.
The third chart requested by our CEO is a table chart. The table chart will contain the number of ad requests, the number of matched ad requests, and the number of individual ad impressions broken down by ad client ID.
Our request will have these parameters:
And the result will be similar to:
result = { "kind": "adsense#report", "totalMatchedRows": "4", "headers": [ {...} ], "rows": [ ["ca-afdo-pub-1234567890123456", "59", "55", "232"], ... ["partner-mb-pub-1234567890123456", "1", "0", "0"] ], "totals": ["", "278", "264", "825"], "averages": ["", "69", "66", "206"]}
As usual, let’s create a DataTable and a DataView to perform transformations on columns:
var data = new google.visualization.arrayToDataTable([['Ad client id', 'AD_REQUESTS', 'MATCHED_AD_REQUESTS', 'INDIVIDUAL_AD_IMPRESSIONS']] .concat(resp.rows));var view = new google.visualization.DataView(data);view.setColumns([ 0, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 1))}, type:'number', label:'Ad requests'}, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 2))}, type:'number', label:'Matched ad requests'}, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 3))}, type:'number', label:'Individual ad impressions'}]);
Finally, let’s draw the table chart. Note that there is no title for a table chart: if you need one, you’ll have to add it in a different element.
var tableWrapper = new google.visualization.ChartWrapper({ chartType: 'Table', dataTable: view, containerId: 'vis_div'});tableWrapper.draw();
The table chart for our CEO is ready, and it can be sorted and paged.
Check the live example and the source code for today!
Finally, the last chart requested from our CEO: a geo chart. The geo chart will show the number of page views for the year broken down by country name.
result = { "kind": "adsense#report", "totalMatchedRows": "9", "headers": [ {...} ], "rows": [ ["Canada", "1"], ... ["United States", "52"] ], "totals": ["", "241"], "averages": ["", "26"],}
DataTable and DataView creation step:
var data = new google.visualization.arrayToDataTable( [['Country', 'Page Views']].concat(resp.rows));var view = new google.visualization.DataView(data);view.setColumns([ 0, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 1))}, type:'number', label:'Page views'}]);
Now we can draw the geo chart. For the geo chart there is no title:
var geoChartWrapper = new google.visualization.ChartWrapper({ chartType: 'GeoChart', dataTable: view, containerId: 'vis_div'});geoChartWrapper.draw();
Et voilà! We have a map of the world with colors and values assigned to specific countries representing the page views from the countries for the current year.
Check the live example and the source code for today.
Eager to try to see what you can do combining these two powerful Google APIs?
You can start immediately using our Google API Explorer and our Google Visualization PlayGround. You can use the Explorer to query our AdSense Management API, and then use the results inside the code on the Visualization PlayGround to generate a chart.
In the next and final part of this series, we will see how to assemble multiple charts into dashboards and enrich them with interactive controls to manipulate the data they display.
Meanwhile, feel free to post any questions related to Google Chart Tools in Google Visualization API forum, or visit our AdSense Management API forum to ask general questions.
It's Chart Tools week here on the blog, and so we'll be showing you in a 4-part series how to easily generate charts for your AdSense reporting using Google Chart Tools. In today’s second post we’ll examine how to generate another type of chart: a column chart.
The second item required by our CEO is a column chart. The column chart will show the number of page views, ad requests, matched ad requests and individual ad impressions for each month of the current year.
Our request becomes:
Now the result will be similar to:
result = { "kind": "adsense#report", "totalMatchedRows": "9", "headers": [ {...{ ], "rows": [ ["2011-01", "28", "46", "41", "165"], ... ["2011-11", "2", "3", "3", "3"] ], "totals": ["", "241", "278", "264", "825"], "averages": ["", "26", "30", "29", "91"]}
We create the DataTable object, adding the columns for our dimensions:
// Create the data table.var data = new google.visualization.arrayToDataTable( [['Month', 'PAGE_VIEWS', 'AD_REQUESTS', 'MATCHED_AD_REQUESTS', 'INDIVIDUAL_AD_IMPRESSIONS']].concat(result.rows));
Once again we use a DataView to convert the string values to numbers:
var view = new google.visualization.DataView(data);view.setColumns([ 0, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 1))}, type:'number', label:'Page views'}, ... {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 4))}, type:'number', label:'Individual ad impressions'}]);
And finally, let’s create a wrapper for the column chart and draw it:
var columnChartWrapper = new google.visualization.ChartWrapper({ chartType: 'ColumnChart', dataTable: view, options: {'title': 'Performances - Year 2011'}, containerId: 'vis_div'});columnChartWrapper.draw();
Another piece is done: a column chart of our performances that is also displaying tips when hovering over bars. Check the live example and the source code for today!
You can start immediately by using our Google API Explorer and our Google Visualization PlayGround. You can use the Explorer to query our Management API, and then use the results inside the code on the Visualization PlayGround to generate a chart.
Stay tuned for our next post this week, where we’ll show you how to generate other two charts, a table chart and a geo chart.
If you have any questions related to the AdSense Management API, come to our forum; alternatively, visit the Google Visualization API forum if you're looking for support on Chart Tools.
result = { "kind": "adsense#report", "totalMatchedRows": "9", "headers": [ {...} ], "rows": [ ["2011-01", "46"], ... ["2011-11", "3"] ], "totals": ["", "278"], "averages": ["", "30"]}
// Create the data table.var data = new google.visualization.arrayToDataTable( [['Month', 'AD_REQUESTS']].concat(result.rows));
AD_REQUESTS
var view = new google.visualization.DataView(data);view.setColumns([ 0, {calc:function(dataTable, rowNum) {return parseInt(dataTable.getValue( rowNum, 1))}, type:'number', label:'Ad requests'}]);
containerId
var lineChartWrapper = new google.visualization.ChartWrapper({ chartType: 'LineChart', dataTable: view, options: {'title': 'Ad requests trend - Year 2011'}, containerId: 'vis_div'});lineChartWrapper.draw();