AppCompat v21 — Material Design for Pre-Lollipop Devices!

By Chris Banes, Android Developer Relations

The Android 5.0 SDK was released last Friday, featuring new UI widgets and material design, our visual language focused on good design. To enable you to bring your latest designs to older Android platforms we have expanded our support libraries, including a major update to AppCompat, as well as new RecyclerView, CardView and Palette libraries.

In this post we’ll take a look at what’s new in AppCompat and how you can use it to support material design in your apps.

What’s new in AppCompat?

AppCompat (aka ActionBarCompat) started out as a backport of the Android 4.0 ActionBar API for devices running on Gingerbread, providing a common API layer on top of the backported implementation and the framework implementation. AppCompat v21 delivers an API and feature-set that is up-to-date with Android 5.0

In this release, Android introduces a new Toolbar widget. This is a generalization of the Action Bar pattern that gives you much more control and flexibility. Toolbar is a view in your hierarchy just like any other, making it easier to interleave with the rest of your views, animate it, and react to scroll events. You can also set it as your Activity’s action bar, meaning that your standard options menu actions will be display within it.

You’ve likely already been using the latest update to AppCompat for a while, it has been included in various Google app updates over the past few weeks, including Play Store and Play Newsstand. It has also been integrated into the Google I/O Android app, pictured above, which is open-source.

Setup

If you’re using Gradle, add appcompat as a dependency in your build.gradle file:

dependencies {
    compile "com.android.support:appcompat-v7:21.0.+"
}

New integration

If you are not currently using AppCompat, or you are starting from scratch, here’s how to set it up:

  • All of your Activities must extend from ActionBarActivity, which extends from FragmentActivity from the v4 support library, so you can continue to use fragments.
  • All of your themes (that want an Action Bar/Toolbar) must inherit from Theme.AppCompat. There are variants available, including Light and NoActionBar.
  • When inflating anything to be displayed on the action bar (such as a SpinnerAdapter for list navigation in the toolbar), make sure you use the action bar’s themed context, retrieved via getSupportActionBar().getThemedContext().
  • You must use the static methods in MenuItemCompat for any action-related calls on a MenuItem.

For more information, see the Action Bar API guide which is a comprehensive guide on AppCompat.

Migration from previous setup

For most apps, you now only need one theme declaration, in values/:

values/themes.xml:

<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
    <!-- Set AppCompat’s actionBarStyle -->
    <item name="actionBarStyle">@style/MyActionBarStyle</item>

    <!-- Set AppCompat’s color theming attrs -->
    <item name=”colorPrimary”>@color/my_awesome_red</item>
    <item name=”colorPrimaryDark”>@color/my_awesome_darker_red</item>
    
    <!-- The rest of your attributes -->
</style>

You can now remove all of your values-v14+ Action Bar styles.

Theming

AppCompat has support for the new color palette theme attributes which allow you to easily customize your theme to fit your brand with primary and accent colors. For example:

values/themes.xml:

<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
    <!-- colorPrimary is used for the default action bar background -->
    <item name=”colorPrimary”>@color/my_awesome_color</item>

    <!-- colorPrimaryDark is used for the status bar -->
    <item name=”colorPrimaryDark”>@color/my_awesome_darker_color</item>

    <!-- colorAccent is used as the default value for colorControlActivated,
         which is used to tint widgets -->
    <item name=”colorAccent”>@color/accent</item>

    <!-- You can also set colorControlNormal, colorControlActivated
         colorControlHighlight, and colorSwitchThumbNormal. -->
    
</style>

When you set these attributes, AppCompat automatically propagates their values to the framework attributes on API 21+. This automatically colors the status bar and Overview (Recents) task entry.

On older platforms, AppCompat emulates the color theming where possible. At the moment this is limited to coloring the action bar and some widgets.

Widget tinting

When running on devices with Android 5.0, all of the widgets are tinted using the color theme attributes we just talked about. There are two main features which allow this on Lollipop: drawable tinting, and referencing theme attributes (of the form ?attr/foo) in drawables.

AppCompat provides similar behaviour on earlier versions of Android for a subset of UI widgets:

You don’t need to do anything special to make these work, just use these controls in your layouts as usual and AppCompat will do the rest (with some caveats; see the FAQ below).

Toolbar Widget

Toolbar is fully supported in AppCompat and has feature and API parity with the framework widget. In AppCompat, Toolbar is implemented in the android.support.v7.widget.Toolbar class. There are two ways to use Toolbar:

  • Use a Toolbar as an Action Bar when you want to use the existing Action Bar facilities (such as menu inflation and selection, ActionBarDrawerToggle, and so on) but want to have more control over its appearance.
  • Use a standalone Toolbar when you want to use the pattern in your app for situations that an Action Bar would not support; for example, showing multiple toolbars on the screen, spanning only part of the width, and so on.

Action Bar

To use Toolbar as an Action Bar, first disable the decor-provided Action Bar. The easiest way is to have your theme extend from Theme.AppCompat.NoActionBar (or its light variant).

Second, create a Toolbar instance, usually via your layout XML:

<android.support.v7.widget.Toolbar
    android:id=”@+id/my_awesome_toolbar”
    android:layout_height=”wrap_content”
    android:layout_width=”match_parent”
    android:minHeight=”?attr/actionBarSize”
    android:background=”?attr/colorPrimary” />

The height, width, background, and so on are totally up to you; these are just good examples. As Toolbar is just a ViewGroup, you can style and position it however you want.

Then in your Activity or Fragment, set the Toolbar to act as your Action Bar:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.blah);

    Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
    setSupportActionBar(toolbar);
}

From this point on, all menu items are displayed in your Toolbar, populated via the standard options menu callbacks.

Standalone

The difference in standalone mode is that you do not set the Toolbar to act as your action bar. For this reason, you can use any AppCompat theme and you do not need to disable the decor-provided Action Bar.

In standalone mode, you need to manually populate the Toolbar with content/actions. For instance, if you want it to display actions, you need to inflate a menu into it:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.blah);

    Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);

    // Set an OnMenuItemClickListener to handle menu item clicks
    toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            // Handle the menu item
            return true;
        }
    });

    // Inflate a menu to be displayed in the toolbar
    toolbar.inflateMenu(R.menu.your_toolbar_menu);
}

There are many other things you can do with Toolbar. For more information, see the Toolbar API reference.

Styling

Styling of Toolbar is done differently to the standard action bar, and is set directly onto the view.

Here’s a basic style you should be using when you’re using a Toolbar as your action bar:

<android.support.v7.widget.Toolbar  
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:minHeight="?attr/actionBarSize"
    app:theme="@style/ThemeOverlay.AppCompat.ActionBar" />

The app:theme declaration will make sure that your text and items are using solid colors (i.e 100% opacity white).

DarkActionBar

You can style Toolbar instances directly using layout attributes. To achieve a Toolbar which looks like ‘DarkActionBar’ (dark content, light overflow menu), provide the theme and popupTheme attributes:

<android.support.v7.widget.Toolbar
    android:layout_height=”wrap_content”
    android:layout_width=”match_parent”
    android:minHeight=”@dimen/triple_height_toolbar”
    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

SearchView Widget

AppCompat offers Lollipop’s updated SearchView API, which is far more customizable and styleable (queue the applause). We now use the Lollipop style structure instead of the old searchView* theme attributes.

Here’s how you style SearchView:

values/themes.xml:
<style name=”Theme.MyTheme” parent=”Theme.AppCompat”>
    <item name=”searchViewStyle”>@style/MySearchViewStyle</item>
</style>
<style name=”MySearchViewStyle” parent=”Widget.AppCompat.SearchView”>
    <!-- Background for the search query section (e.g. EditText) -->
    <item name="queryBackground">...</item>
    <!-- Background for the actions section (e.g. voice, submit) -->
    <item name="submitBackground">...</item>
    <!-- Close button icon -->
    <item name="closeIcon">...</item>
    <!-- Search button icon -->
    <item name="searchIcon">...</item>
    <!-- Go/commit button icon -->
    <item name="goIcon">...</item>
    <!-- Voice search button icon -->
    <item name="voiceIcon">...</item>
    <!-- Commit icon shown in the query suggestion row -->
    <item name="commitIcon">...</item>
    <!-- Layout for query suggestion rows -->
    <item name="suggestionRowLayout">...</item>
</style>

You do not need to set all (or any) of these, the defaults will work for the majority of apps.

Toolbar is coming…

Hopefully this post will help you get up and running with AppCompat and let you create some awesome material apps. Let us know in the comments/G+/Twitter if you’re have questions about AppCompat or any of the support libraries, or where we could provide more documentation.

FAQ

Why is my EditText (or other widget listed above) not being tinted correctly on my pre-Lollipop device?

The widget tinting in AppCompat works by intercepting any layout inflation and inserting a special tint-aware version of the widget in its place. For most people this will work fine, but I can think of a few scenarios where this won’t work, including:

  • You have your own custom version of the widget (i.e. you’ve extended EditText)
  • You are creating the EditText without a LayoutInflater (i.e., calling new EditText()).

The special tint-aware widgets are currently hidden as they’re an unfinished implementation detail. This may change in the future.

Why has X widget not been material-styled when running on pre-Lollipop?
Only some of the most common widgets have been updated so far. There are more coming in future releases of AppCompat.
Why does my Action Bar have a shadow on Android Lollipop? I’ve set android:windowContentOverlay to null.
On Lollipop, the action bar shadow is provided using the new elevation API. To remove it, either call getSupportActionBar().setElevation(0), or set the elevation attribute in your Action Bar style.
Why are there no ripples on pre-Lollipop?
A lot of what allows RippleDrawable to run smoothly is Android 5.0’s new RenderThread. To optimize for performance on previous versions of Android, we’ve left RippleDrawable out for now.
How do I use AppCompat with Preferences?
You can continue to use PreferenceFragment in your ActionBarActivity when running on an API v11+ device. For devices before that, you will need to provide a normal PreferenceActivity which is not material-styled.

What’s New in Android 5.0 Lollipop

By Ankur Kotwal, Developer Advocate

Android 5.0 Lollipop is the biggest update of Android to date, introducing an all new visual style, improved performance, and much more. Android 5.0 Lollipop also extends across screens big and small, including phones, tablets, wearables, TVs and cars, to give your users access to information when they need it most.

To get you started on developing and testing on Android 5.0 Lollipop, here are some of the developer highlights with links to related videos and documentation.

User experience

  • Material design for the multiscreen world — Material Design is a new approach for designing apps in today’s multi-device world that takes a comprehensive strategy to visual, motion, and interaction design across a number of platforms and form factors. Android 5.0 brings Material Design to the platform, with a full set of tools for implementing material design in your apps. The system is incredibly flexible, allowing your app to express its individual character and brand with bold colors and a variety of responsive UI patterns and themeable elements.
  • Enhanced notifications — New lockscreen notifications let you surface content, updates, and actions to users at a glance, without needing to unlock their device. Heads-up notifications let you display content and actions in a small floating window managed by the system, no matter which app is in the foreground. Notifications are refreshed for Material Design and you can use accent colors to express your brand.
  • Concurrent documents in Overview — Now you can organize your app by tasks and present these concurrently as individual “documents” on the Overview screen. For example, instant messaging apps could declare each chat as a separate document. Users can flip through these on the Overview screen to find the specific chat they want and jump straight to it.

Performance

  • Android Runtime (ART) — Android 5.0 runs exclusively on the ART runtime. ART offers ahead-of-time (AOT) compilation, more efficient garbage collection, and improved development and debugging features. In many cases it improves performance of the device, without you having to change your code.
  • 64-bit support — Support for 64-bit ABIs provides additional address space and improved performance with certain compute workloads. Apps written in the Java language can run immediately on 64-bit architectures with no modifications required. NDK r10c includes 64-bit support, for apps and games using native code.
  • Project Volta — New tools and APIs help you build battery-efficient apps. Battery Historian, a tool included in the SDK, lets you visualize power events over time and understand how your app is using battery. The JobScheduler API lets you set the conditions under which your background tasks and other jobs should run, such as when the device is idle or connected to an unmetered network or to a charger, to minimize battery impact. More in this I/O video.
  • OpenGL ES 3.1 and Android Extension Pack — With OpenGL ES 3.1, you get compute shaders, stencil textures, and texture gather for your games. Android Extension Pack (AEP) is a new set of extensions to OpenGL ES that bring desktop-class graphics to Android including tessellation and geometry shaders, and use ASTC texture compression across GPU technologies. More on what’s new for game developers in this DevBytes video.
  • WebView updates — We’ve updated WebView to support WebRTC, WebAudio and WebGL will be supported. WebView also includes native support for all of the Web Components specifications: Custom Elements, Shadow DOM, HTML Imports, and Templates. WebView is now unbundled from the system and will be regularly updated through Google Play.

Workplace

  • Managed provisioning and unified view of apps — to make it easier for employees to have a single device for personal and work use, framework enhancements offer a unified view of apps, notifications & recents across work apps and personal apps. Profile owner APIs, in the workplace context, let administrators create and manage work profiles and defined as part of a new managed provisioning process. More in this I/O video.

Media

  • Advanced camera capabilities — A new camera API gives you new capabilities for advanced image capture and processing. On supported devices, your app can capture uncompressed YUV capture at full 8 megapixel resolution at 30 FPS. You can also capture raw sensor data and control parameters such as exposure time, ISO sensitivity, and frame duration, on a per-frame basis.
  • Audio improvements — The sound architecture has been enhanced, with lower input latency in OpenSL, the addition of multichannel-mixing, and USB digital audio mode support. More in this I/O video.

Connectivity

  • BLE Peripheral Mode — Android devices can now function in Bluetooth Low Energy (BLE) peripheral mode. Apps can use this capability to broadcast their presence to nearby devices — for example, you can now build apps that let a device function as a beacon and transmit data to another BLE device. More in this I/O video.
  • Multi-networking — Apps can dynamically request networks based on capabilities such as metered or unmetered. This is useful when you want to use a specific network, such as cellular. Apps can also request platform to re-evaluate networks for an internet connection. This is useful when your app sees unusually high latency on a particular network, it can enable the platform to switch to a better network (if available) sooner with a graceful handoff.

Get started!

You can get started developing and testing on Android 5.0 right away by downloading the Android 5.0 Platform (API level 21), as well as the SDK Tools, Platform Tools, and Support Package from the Android SDK Manager.

Check out the DevByte video below for more of what’s new in Lollipop!

Android 5.0 Lollipop SDK and Nexus Preview Images

style="border-radius: 6px;padding:0;margin:0;" />

Two more weeks!

By Jamal Eason, Product Manager, Android

At Google I/O last June, we gave you an early version of Android 5.0 with the L Developer Preview, running on Nexus 5, Nexus 7 and Android TV. Over the course of the L Developer Preview program, you’ve given us great feedback and we appreciate the engagement from you, our developer community. Thanks!

This week, we announced Android 5.0 Lollipop. Starting today, you can download the full release of the Android 5.0 SDK, along with updated developer images for Nexus 5, Nexus 7 (2013), ADT-1, and the Android emulator.

The first set of devices to run this new version of Android — Nexus 6, Nexus 9, and Nexus Player — will be available in early November. In the same timeframe, we’ll also roll out the Android 5.0 update worldwide to Nexus 4, 5, 7 (2012 & 2013), and 10 devices, as well as to Google Play edition devices.

Therefore, now is the time to test your apps on the new platform. You have two more weeks to get ready!

What’s in Lollipop?

Android 5.0 Lollipop introduces a host of new APIs and features including:

There’s much more, so check out the Android 5.0 platform highlights for a complete overview.

What’s in the Android 5.0 SDK?

The Android 5.0 SDK includes updated tools and new developer system images for testing. You can develop against the latest Android platform using API level 21 and take advantage of the updated support library to implement Material Design as well as the leanback user interface for TV apps.

You can download these components through the Android SDK Manager and develop your app in Android Studio:

  • Android 5.0 SDK Platform & Tools
  • Android 5.0 Emulator System Image – 32-bit & 64-bit (x86)
  • Android 5.0 Emulator System Image for Android TV (32-bit)
  • Android v7 appcompat Support Library for Material Design theme backwards capability
  • Android v17 leanback library for Android TV app support

For developers using the Android NDK for native C/C++ Android apps we have:

For developers on Android TV devices we have:

  • Android 5.0 system image over the air (OTA) update for ADT-1 Developer Kit. OTA updates will appear over the next few days.

Similar to our previous release of the preview, we are also providing updated system image downloads for Nexus 5 & Nexus 7 (2013) devices to help with your testing as well. These images support the Android 5.0 SDK, but only have the minimal apps pre-installed in order to enable developer testing:

  • Nexus 5 (GSM/LTE) “hammerhead” Device System Image
  • Nexus 7 (2013) – (Wifi) “razor” Device System Image

For the developer preview versions, there will not be an over the air (OTA) update. You will need to wipe and reflash your developer device to use the latest developer preview versions. If you want to receive the official consumer OTA update in November and any other official updates, you will have to have a factory image on your Nexus device.

Validate your apps with the Android 5.0 SDK

With the consumer availability of Android 5.0 and the Nexus 6, Nexus 9, and Nexus Player right around the corner, here are a few things you should do to prepare:

  1. Get the emulator system images through the SDK Manager or download the Nexus device system images.
  2. Recompile your apps against Android 5.0 SDK, especially if you used any preview APIs. Note: APIs have changed between the preview SDK and the final SDK.
  3. Validate that your current Android apps run on the new API 21 level with ART enabled. And if you use the NDK for your C/C++ Android apps, validate against the 64-bit emulator. ART is enabled by default on API 21 & new Android devices with Android 5.0.

Once you validate your current app, explore the new APIs and features for Android 5.0.

Migrate Your Existing App to Material Design

Android 5.0 Lollipop introduces Material Design, which enables your apps to adopt a bold, colorful, and flexible design, while remaining true to a small set of key principles that guide user interaction across multiple screens and devices.

After making sure your current apps work with Android 5.0, now is the time to enable the Material theme in your app with the AppCompat support library. For quick tips & recommendations for making your app shine with Material Design, check out our Material Design guidelines and tablet optimization tips. For those of you new to Material Design, check out our Getting Started guide.

Get your apps ready for Google Play!

Starting today, you can publish your apps that are targeting Android 5.0 Lollipop to Google Play. In your app manifest, update android:targetSdkVersion to "21", test your app, and upload it to the Google Play Developer Console.

Starting November 3rd, Nexus 9 will be the first device available to consumers that will run Android 5.0. Therefore, it is a great time to publish on Google Play, once you’ve updated and tested your app. Even if your apps target earlier versions of Android, take a few moments to test them on the Android 5.0 system images, and publish any updates needed in advance of the Android 5.0 rollout.

Stay tuned for more details on the Nexus 6 and Nexus 9 devices, and how to make sure your apps look their best on them.

Next up, Android TV!

We also announced the first consumer Android TV device, Nexus Player. It’s a streaming media player for movies, music and videos, and also a first-of-its-kind Android gaming device. Users can play games on their HDTVs with a gamepad, then keep playing on their phones while they’re on the road. The device is also Google Cast-enabled, so users can cast your app from their phones or tablets to their TV.

If you’re developing for Android TV, watch for more information on November 3rd about how to distribute your apps to Android TV users through the Google Play Developer Console. You can start getting your app ready by making sure it meets all of the TV Quality Guidelines on October 16, 2014, 10:00 am, by Adam Singer, under From Around the Web.


Plan ahead.
Over the past few years, we’ve seen the holiday rush begin earlier and earlier. And we’ve also noticed that the shopping frenzy is extending beyond the traditional season, with transaction rates in 2013 boasting lifts even after Christmas. These trends make for a lot of opportunity for online retailers, but you need to play your cards right. The most important thing you can do to ensure seasonal success is to plan your digital strategy now.  We’ve analyzed transaction behavior from a portion of our Google Analytics accounts over the 2013 holiday season to develop a guide for seasonal success. 
Which days drive the most transactions?
In order to develop a successful holiday retail strategy, it’s important to first understand the days that drive the most sales for your business. Once you understand this, you can craft a strategy that optimizes your media and promotion not only for these days, but for the entire holiday season.

As digital retailers are well aware, Cyber Monday is THE digital shopping day of the year.  It generates the most transactions of any single day and, in 2013, saw a transaction rate lift of 170% over average.  In second place is Black Friday, a day that has increased in digital importance over the last three years. By 2013, the transaction rate on Black Friday was 114% higher than average.  Beyond these two stars, the table below shows you the top days in 2013 by transaction volume and the lift in transactions rates on each day.

In general, beyond Cyber Monday and Black Friday, the Mondays and Tuesdays before Christmas in December tend to generate the highest volume of transactions.  Interestingly, the highest transaction days are not correlated to the days with the most sessions (traffic to your site), so avoid using the top session days as a proxy for the top transaction days.


How can I drive sales on the top transaction days?
The holiday season generates some of the highest transaction rate spikes and the lowest dips for the entire year. In order to drive digital sales successfully, it’s important that you adjust your bids for auction-based media, such as search ads, appropriately to account for higher transaction rates on key dates and throughout the season.  As you navigate the holiday season, use the lift in transaction rates over the average transaction rate as your bid multiplier for auction-based media (learn more about bid adjustments). This adjustment schedule reflects the increased value of clicks that are more likely to convert, and helps ensure that you stay ahead of competitors and  get in front of the right consumers. The transaction rate lift for the top days are shown in the table above, while the chart below gives you an idea of the lift for the weeks surrounding the holiday season.

As you can see, the top days generate some of the biggest transaction rate lifts, but there’s also plenty of upside in the weeks preceding Thanksgiving as well as right before Christmas.  A smart retailer will generate a bid schedule for the entire season, starting 4-5 weeks before the Thanksgiving holiday.
Marketing to consumers is notoriously tricky and often trend-driven, making the holiday season a difficult and uncertain time for retailers. However, with proper pre-season preparation, digital retailers can set themselves up for seasonal success in 2014.  If you’re a Google Analytics user, you can tailor this analysis and approach to your business, using your own data and the data available in our benchmarking tool.  For more strategies for the holiday season, check out our holiday tips blog post and best practices checklist.
About the Data
In order to perform this analysis, we looked at billions of sessions across millions of Google Analytics accounts. We used session and transaction trends; and we looked at the percentage of sessions that included a transaction to calculate transaction rates. The data includes only accounts that have authorized Google to share website data in an anonymous way (read more). For questions, comments, or praise please contact us at gaqi@google.com 

Posted by Daniel Waisberg and Jocelyn Whittenburg from the Google Analytics team.

Making tag management more accessible and powerful

Today we are happy to introduce improvements to Google Tag Manager that will make both marketing and IT teams happy
  • New APIs that tailor the power of Google Tag Manager to your unique needs
  • A new intuitive interface to help you launch and edit tags even faster
  • More 3rd-party templates to make tagging easier
Many large enterprises use Google Tag Manager to streamline and simplify website and mobile app tagging. It helps marketers control the end-to-end process of adding website tags, while IT departments save time they can spend on more strategic projects. InsureandGo has been using Google Tag Manager for all their tagging needs:
Before, we missed opportunities because tag changes required a website release. Since we’ve enabled Google Tag Manager on the site, it’s enabled the marketing team to measure more on-site actions. For example, using Google Tag Manager to track on-page events such as specific clicks and form submissions helps us understand more granular customer actions, how to market and what to sell. We can make decisions much quicker and see within a few weeks whether the strategy has worked, whereas before it would have taken six to nine months. Simon Everett, Head of Marketing
Let’s look at the new features.
Introducing Google Tag Manager API
Sometimes you just want things your own way. We understand! The new full-featured Google Tag Manager API lets you customize the infrastructure to suit your needs, whether that means building your own tools or better integrations with your existing workflow. From creating and managing users to previewing and publishing containers and tags, the API provides all the power of the web interface.
For example, the new API makes it easy to manage user access in bulk. It’s easy to set permissions for many users at once, or set up your own role-based permissions and let the API give the right level of access to the right people in your organization.
Agencies can use the API to easily manage large tagging setups for their clients: create a master container template, specify variations (such as the domain, or the ad campaign ID) in a Google Sheets doc, and use the API to automatically deploy to multiple containers and keep those containers in sync. 
Our partner Novartis has been able to scale more easily by using Google Tag Manager APIs:
We have a strong data-driven culture at Novartis and thus in the digital space we’re naturally interested in using data and insights to improve the usability and experience of our websites. With many brands and websites across the globe, collecting web analytics data can become time consuming. Two challenges we have faced are data consistency and tagging implementation across many sites. We developed a process where we use the Google Tag Manager API to eliminate a manual, error-prone, process and thus were able to shift our attention from several low-value tasks to determining how to create a great digital experience for our customers.
Angela Grammatas – Digital Analytics Manager for Novartis
More coverage for 3rd-party tags
Starting in the next few weeks, you’ll see more 3rd-party templates in the tag creation flow. We’ve made it easier for marketers to add tags and minimize errors while doing so. When adding a new tag of your own, you’ll select from a list of 3rd-party providers and be underway in just a few clicks. We now offer support for tags from AdRoll, Marin, Comscore, Bizo, Clicktale, Neustar, Distillery, Turn, Mediaplex, VisualDNA, quantcast, Criteo and many more to come soon. Don’t see the tag you need? No problem: you can add it immediately as a custom HTML tag. You can also ask to have a new tag template included in future releases, as Tag Manager will continue to add new tag templates. You’ll find the full list of tag templates in our help center.
Creating a new tag (click image for full-size).
A more intuitive interface
We think tag management should be easy even for non-technical users. Even if you’re new to Google Tag Manager, you’ll be using the improved interface within minutes. Tasks are intuitive and structured much the same way as in AdWords and Google Analytics. Our new updates include:
  • A default workflow that’s simpler and clearer
  • Instant search and autocomplete that can help you find anything in your Google Tag Manager containers
  • New keyboard shortcuts to simplify life for power users
The goal: enable marketing managers to easily add and update tags.
The new container overview page (click image for full-size).
We are confident you’ll find the new Google Tag Manager easier to use and a more powerful solution for your web and app tagging needs. If you are already using Google Tag Manager, you can try out the new user interface today by logging in your accounts and following the instructions. New to Google Tag Manager? Get started today!
Posted by Lukas Bergstrom, Product Manager Google Tag Manager

Updated Cross-Platform Tools in Google Play Game Services

By Ben Frenkel, Google Play Games team

style="border-radius: 6px;padding:0;margin:0;" />

Game services UIs are now updated for material design, across all of the SDKs.

Game developers, we’ve updated some of our popular developer tools to give you a consistent set of game services across platforms, a refreshed UI based on material design, and new tools to give you better visibility into what users are doing in your games.

Let’s take a look at the new features.

Real-time Multiplayer in the Play Games cross-platform C++ SDK

To make it easier to build cross-platform games, we’ve added Real-Time Multiplayer (RTMP) to the latest Google Play Games C++ SDK. The addition of RTMP brings the C++ SDK to feature parity with the Play services SDK on Android and the Play Games iOS SDK. Learn more »

Material Design refresh across Android, cross-platform C++, and iOS SDKs

We’ve incorporated material design into the user-interface of the latest Play Games services SDKs for Android, cross-platform C++, and iOS. This gives you a bold, colorful design that’s consistent across all of your games, for all of your users. Learn more »

New quests features and completion statistics

Quests are a popular way to increase player engagement by adding fresh content without updating your game. We’ve added some new features to quests to make them easier to implement and manage.

First, we’ve simplified quests implementations by providing out-of-the-box toasts for “quest accepted” and “quest completed” events. You can invoke these toasts from your game with just a single call, on any platform. This removes the need to create your own custom toasts, though you are still free to do so.

You also have more insight into how your quests are performing through new in-line quest stats in the Developer Console. With these stats, you can better monitor how many people are completing their quests, so you can adjust the criteria to make them easier to achieve, if needed. Learn more »

Last, we’ve eliminated the 24-hour lead-time requirement for publishing and allowing repeating quests to have the same name. You now have the freedom to publish quests whenever you want with whatever name you want.

New quest stats let you see how many users are completing their quests.

Multiplayer game statistics

Now when you add multiplayer support through Google Play game services, you get multiplayer stats for free, without having to implement a custom logging solution. You can simply visit the Developer Console to see how players are using your multiplayer integration and look at trends in overall usage. The new stats are available as tabs under the Engagement section. Learn more »

Multiplayer stats let you see trends in how players are using your app’s multiplayer integration.

New game services insights and alerts

We’re continuing to expand the types of alerts we offer the Developer Console to let you know about more types of issues that might be affecting your users’ gameplay experiences. You’ll now get an alert when you have a broken implementation of real-time and turn-based multiplayer, and we’ll also notify you if your Achievements and Leaderboard implementations use too many duplicate images. Learn more »

Get Started

You can get started with all of these new features right away. Visit the Google Play game services developer site to download the updated SDKs. For migration details on the Game Services SDK for iOS, see the release notes. You can take a look at the new stats and alerts by visiting the Google Play Developer Console.

Tips for Error Handling with Android Wear APIs

By +Wayne Piekarski, Developer Advocate, Android Wear

For developers using the Android Wear APIs in Google Play services, it is important to correctly handle all the error conditions that can occur on legacy phones or when users do not have a wearable device. This post describes the best practice in handling error conditions with the GoogleApiClient connect() method. If you do not implement this correctly, your existing application functionality may fail for non-wearable users.

There are two ways that the connect() method can return ConnectionResult.API_UNAVAILABLE for wearable support with Google Play services:

  • When requesting Wearable.API on any device running Android 4.2 (API level 17) or earlier
  • When requesting Wearable.API when no Android Wear companion application or device is available

Google Play services provides a wide range of useful features such as integration with Google Drive, Wallet, Google+, and Google Play games services (just to name a few!). During initialization, the application uses GoogleApiClient.Builder() to make calls to addApi() to request the features that are necessary. The connect() method is then called to establish a connection to the Google Play services library, and it can return error codes if any API is not available.

If you request multiple APIs from a single GoogleApiClient, such as Drive and Wear, and the Wear support returns API_UNAVAILABLE, then the Drive request will also fail. Since Wear support is not guaranteed to be available on all devices, you should make sure to use a separate client for this request.

The best practice for developers is to implement two separate GoogleApiClient connections:

  • One connection for Android Wear support, and
  • A separate connection for all of the other APIs you need

This will ensure that the functionality of your app will remain for all users, whether or not there is wearable support available on their devices, as well as on older legacy devices.

It’s important that you implement this best practice immediately, because your current users may be affected if not handled correctly in your app.

Dynamic remarketing now available to advertisers across all verticals

This post originally appeared on the Inside AdWords Blog.

Over the next few weeks we are rolling out dynamic remarketing to all verticals including hotels, flights, real estate, classifieds, jobs, auto, finance and education. Since we launched dynamic remarketing for retailers, many advertisers like Bebe Stores, Netshoes, and Build Direct have been driving better results and more profits from their remarketing campaigns.

Highlighting what matters most to your customers

Dynamic remarketing shows site visitors tailored ads that feature the products they viewed on your website, and related products they might be interested in. Let’s say you sell cars and offer hundreds of makes and models in multiple cities. With dynamic remarketing, you can build one ad that will dynamically show tailored messaging to your site visitors, like the cars they engaged with on your site, and similar cars in that city and price range. Beta clients across multiple verticals reported a 2x increase in conversion rates and 60% reduction in CPA, on average, when they added dynamic ads to their remarketing campaigns.*

Display ads built for mobile, optimized for conversion value 

  • When advertisers add mobile targeting to their remarketing campaigns, we’ve seen conversion volume increase by 15% on average at the same price. That’s why all our dynamic remarketing templates are mobile-optimized to deliver ads seamlessly across screens. Learn more
  • Dynamic remarketing with automated bidding can boost performance by calculating optimal bids for each impression in real-time. This means if you sell an $800 camera and a $20 flashlight, AdWords will automatically prioritize winning more of the $800 conversions than the $20 conversions. This helps to maximize the total value of your conversions, not just the number of conversions.  Learn more

Customers driving success with dynamic remarketing  

In travel, Hotel Urbano built a single dynamic ad that showed each prospective traveler the package, hotel or cruise most relevant to them. Dynamic ads improved their return on ad spend by 38%, and drove 415% more revenue compared to standard remarketing. Mariana Filippo, senior marketing analyst at Hotel Urbano, says it made business more efficient “since we don’t have to change creatives every day across over 4,000 packages across 183 different countries. It keeps up with our frequency so we can deliver the right ad with the right user.

In flights, Jet Airways customized ads based on where and when people were looking to fly, so someone browsing flights from New York to London could see a special offer on business class tickets on the exact day they’re looking to fly. They doubled conversions at a 65% lower CPA by adding dynamic ads to their remarketing strategy.



In local deals
, India’s largest online B2B marketplace IndiaMART used dynamic remarketing to recommend new suppliers to existing customers, increasing lead volume by 400% at a 60% lower CPA. Saugata Halder, product marketing manager at IndiaMART offers this advice: “For marketplaces like us, it’s imperative to showcase the wide range of products available to our buyers. Dynamic remarketing allowed us to reach a larger segment of our customers with personalized ads and to maximize the impact of our marketing efforts.


Join us for a Hangout on Air

Learn how you can get started with Dynamic Remarketing. Join us for a live Hangout on Air with Google product managers and experts on Thursday, October 9th at 9:00am PT/ RSVP here.

For more information visit the AdWords Help Center. If you’re a Google Analytics user, you can visit the Google Analytics Help Center to learn how to use your existing tags to get started with dynamic remarketing.

Posted by Jyoti Vaidee, Product Manager Dynamic Display Ads


*Campaign results may vary across advertisers 

They say that water cannot be created or destroyed

They say that water cannot be created or destroyed

View

My new running book is here

My new running book is here

My new running book hit bookshelves today

View

I’m doing a reddit AMA on Tuesday, September 30th

I'm doing a reddit AMA on Tuesday, September 30th

View

Nikola Tesla Dood

Nikola Tesla Dood

I teamed up with Sarah Donner to create an animated video about Tesla.

View

Allthecooks on Android Wear

By Hoi Lam, Developer Advocate, Android Wear

The best cooking companion since the apron?

Android Wear is designed for serving up useful information at just the right time and in the right place. A neat example of this is Allthecooks Recipes. It gives you the right recipe, right when you need it.

This app is a great illustration of the four creative visions for Android Wear:

  1. Launched automatically
  2. Glanceable
  3. Suggest and demand
  4. Zero or low interaction

Allthecooks also shows what developers can do by combining both the power of the mobile device and the convenience of Android Wear.

Pick the best tool for the job

One particularly well-designed aspect of Allthecooks is their approach to the multi-device experience. Allthecooks lets the user search and browse the different recipes on their Android phone or tablet. When the user is ready, there is a clearly labelled blue action link to send the recipe to the watch.

The integration is natural. Using the on-screen keyboard and the larger screen real estate, Allthecooks is using the best screen to browse through the recipes. On the wearables side, the recipe is synchronised by using the DataApi and is launched automatically, fulfilling one of the key creative visions for Android Wear.

The end result? The mobile / Wear integration is seamless.

Thoughtful navigation

Once the recipe has been sent to the Android Wear device, Allthecooks splits the steps into easily glanceable pages. At the end of that list of steps, it allows the user to jump back to the beginning with a clearly marked button.

This means if you would like to browse through the steps before starting to cook, you can effortlessly get to the beginning again without swiping through all the pages. This is a great example of two other points in the vision: glanceable and zero or low interaction.

A great (cooking) assistant

One of the key ingredients of great cooking is timing, and Allthecooks is always on hand to do all the inputs for you when you are ready to start the clock. A simple tap on the blue “1” and Allthecooks will automatically set the timer to one hour. It is a gentle suggestion that Allthecooks can set the timer for you if you want.

Alternatively, if you want to use your egg timer, why not? It is a small detail but it really demonstrates the last and final element of Android Wear’s vision of suggest and demand. It is an ever ready assistant when the user wants it. At the same time, it is respectful and does not force the user to go down a route that the user does not want.

It’s about the details

Great design is about being user-centric and paying attention to details. Allthecooks could have just shrunk their mobile app for wear. Instead the Allthecooks team put a lot of thoughts into the design and leveraged all four points of the Android Wear creative vision. The end result is that the user can get the best experience out of both their Android mobile device and their Android Wear device. So developers, what will you be cooking next on Android Wear?

For more inspiring Android Wear user experiences, check out the Android Wear collection on Google Play!

Buy a brick for the Nikola Tesla Museum

Buy a brick for the Nikola Tesla Museum

Have your name engraved and placed on the grounds of Nikola Tesla’s laboratory.

View

Strength and determination will lead to a better you

Strength and determination will lead to a better you

View

How little bees take on enormous hornets

How little bees take on enormous hornets

I wrote a comic about Japanese Honeybees and how they combat Japanese Giant Hornets.

View

The Top 3 Google Analytics Configuration Issues Impacting your Data (and How to Fix Them)

Good data is important.  How important?  Studies show that inaccurate data has a direct impact on the bottom line of 88% of companies.  In fact, the average company loses 12% of its revenue due to bad data.  As you know, Google Analytics is a powerful product with a wealth of features to help you optimize your results online. However, to unleash the power of Google Analytics’ marketing tools, you must ensure the data collected is complete and of the highest quality. The insights that fuel action in Analytics depend on good data, especially for some of our advanced algorithmic marketing functionalities like data driven attribution.
Since its release two months ago, our popular new diagnostics tool is working hard to ensure you’re getting the best results. Today, we’d like to share insights into some of the most common account errors along with likely causes and suggested solutions. In particular, we’ll look at some solutions for when our diagnostics tool is telling you the following:  “Bad Default URL,” “Clicks and Sessions Discrepancy,” and “No Goal Conversions.”  Read on to understand the impact of these issues as well as their common causes.

Bad Default URL
“Data without quality is useless.”
João Correia, Analytics Strategist at Blast Analytics & Marketing
When you create a Google Analytics account for website tracking, one of the first questions we ask is for a default URL. This is generally the homepage of your website. Diagnostics ensures that you have tagged your default URL correctly for this property, and warns you if this is not the case. Having a properly tagged website is an essential step towards being able to understand consumer behavior.
This warning is generally caused by either missing or malformed tracking code installed on your default URL, or more simply a typo in the URL that was input. If the default URL is incorrect, simply login to your Google Analytics account, click the “Admin” button in the header, and click “Property Settings” to adjust your default URL. If the tracking code is flawed, you’ll want to talk to your webmaster and ask to have the tracking code correctly installed
Beyond the default URL, we also check for tracking code health across your site. We look for pages that have missing or malformed tags. And we continually run these checks, ensuring new pages you launch in the future also are properly tagged. 
Clicks / Session Discrepancies
“Diagnostics helped me identify and fix an AdWords data discrepancy in my account.  Without the tool, I may have never even realized that my data was inconsistent.  This is a great tool!”
Monika Rut-Koroglu, Digital Analytics and Optimization at FXCM
Google Analytics offers rich capabilities that help users share data with linked AdWords accounts and gain unique and powerful marketing insights. It’s common to expect the number of clicks you see in AdWords to match the number of sessions you see in Analytics; but this is not always the case. This discrepancy can slow down meaningful analysis, and is a situation that can and should be rectified.
The most common causes of this issue have to do with your configuration settings. For example, when you send ad clicks through a third party that redirects to your site; the third party will often times drop vital tagging parameters which are mandatory for Analytics and AdWords to associate clicks and sessions. Other examples are having AdWords auto-tagging disabled, and redirecting users to mobile sites while unintentionally dropping tagging parameters.
Fixes for these issues can vary; we have a detailed guide to walk users through this or you can follow prompts in Google Analytics when we identify specific actions for you to take. If you have a third party who uses redirects and drops parameters, talk to them to resolve the issue. If auto-tagging is disabled on your AdWords accounts, consider enabling it
No Goal Conversions
“[Google Analytics Diagnostics] is a great idea… Just discovered it the other day on my iPad. Helpful to let me redefine my goals better and find out what’s not working.”
Sherri Matthew, Harpist and Small Business Owner
Google Analytics goals offer valuable ways to identify, track, and help you drive more valuable outcomes. Sometimes goals can break, and stop this critical stream of insights from reaching you. We run diagnostic checks to ensure your goals continually identify a steady flow of high value customers, and we warn you if this flow breaks.
The most common cause for goal breakage is when a goal is based on a URL that changes. If your webmaster updates the URLs on your site, and the URLs in the goal settings aren’t updated accordingly, this will cause your goal to stop tracking. The second most common cause for goals breaking is if the event tracking on your site changes and the events listed in the goal aren’t updated accordingly.
If you’ve had a goal break for these reasons, visit the “Admin” section via a link in the header of your Google Analytics account, and click “Goals” to correct your goal configurations.
More About Diagnostics
Google Analytics Diagnostics scans for problems every day (with some exceptions). It inspects your site tagging, account configuration, and reporting data for potential data-quality issues.  Only users with Edit permission can see and respond to diagnostics messages. Diagnostics honors the first response to a message; for example, when a user ignores a message, it is ignored for all users.
The tool currently scans for dozens of issues, and dozens more are planned. Just keep an eye on your account over time – it will notify you if and when new issues or opportunities are detected.

- Frank Kieviet and Matt Matyas, Google Analytics Team

I will climb the highest peak

I will climb the highest peak

View

Enhanced Google Analytics Audience Capabilities Come to Apps

Good news for mobile app developers: Audience Demographics and Interests Reporting and Remarketing are now available for apps in Google Analytics.  Just one of the improvements for audience segmentation and remarketing we’re announcing today, these changes should make it even easier for all our advertisers to reach their high-value customer segments. 
In-App Audience Demographics Reporting and Remarketing
Good analytics are especially important to app developers. At Google I/O, Hovhannes Avoyan, the CEO and Founder of PicsArt , had this to say: 
“We need analytics to help us understand who our users are, how they interact with our application, how our application performs. With all that knowledge, we want to apply different monetization strategies to different kinds of users.” 
Now developers can see just how different user segments engage and monetize with In-App Audience Demographics Reporting
And it’s more than just data. Analysts and developers can blend audience demographic and behavior data into detailed audience lists to be targeted with in app remarketing campaigns. In short, all the great remarketing capabilities for Google Analytics users on the web are now available for apps as well.
New In-App Audience Demographics Reporting
Segmentation and remarketing lists get an upgrade
Creating remarketing lists for apps and web is now even easier with recent upgrades to both segmentation and audience building. A streamlined creation flow for creating audiences allows users to go from segment to audience within clicks (plus a few bonus admin features like list renaming and automatic list sizing).
New Audience Builder Experience, now supporting App lists
If you prefer to stand on the shoulders of remarketing giants, Analytics power users have developed and shared audience definitions that import via template links or from the solutions gallery. This simplifies things dramatically for new users. A process that could be complicated and time-consuming can now be done with 6 clicks in under 1 minute. Give it a try: import our Engagement Pack of Core Remarketing Lists.
On the segmentation side, users have told us they wanted segments to be more discoverable, easier to manage, and more intuitive to build. We’ve been listening, and have made interface improvements, adding a simple “Add Segment” button within reports, a new segment-selection interface, hover-over segment definitions, and a 1-click action dialogue to Share, Edit, Copy, Remove, or Remarket to a segment. 
New Segmentation Experience: fewer errors for better analysis
Measure remarketing performance with the new Display Targeting report
Once you’ve found a segment, created an audience, and activated your remarketing campaign, close the loop by measuring the performance of those audiences across all remarketing campaigns . Enter the new Adwords Display Targeting report in the Acquisition section to see all your active remarketing lists, along with impressions, spend, behavior, and conversion rates under the “Interests and Remarketing” tab.
New Remarketing List Performance in Display Targeting Report
You can learn how to update your SDK to enable these features in our Help Center or get started now by creating some remarketing lists. We hope that these improvements make your audience segmentation and remarketing– in apps and on the web– more intuitive and more effective. We’d love to hear from you! Please leave questions or feedback in the comments, and stay tuned for more audience-related improvements. 

Posted by Dan Stone, Product Manager, and Kanu Singhal, Technical Lead from the Google Analytics Audience Team

Messaging on Android Wear

By Timothy Jordan, Developer Advocate

Sending messages on Android Wear feels as easy as it was to pass notes back in school. Remember when your friends always felt nearby? That feeling is why I love staying in touch with friends and family using my wearable.

Your messaging app likely already works on Android Wear. With just a few more lines of code you can unlock simple but powerful features that let your users communicate even more effortlessly.

Message notifications for free

If your Android app uses notifications to let the user know about new messages, these will work automatically on their wearable. That is, when you build notifications with the NotificationCompat.Builder class, the system takes care of displaying them properly, whether they appear on a handheld or wearable. Also, an “Open on phone” action will be added so it’s easy for the user to reply via the app on their handheld.

Google+ Hangouts message.

Reply like a champ

Messages on Wear get really exciting when you can reply directly from the watch with your voice. In addition to being super convenient, this always gives me a Dick Tracy thrill… but maybe that’s just me. =]

To add this functionality, it’s as simple as adding an action to the notification via WearableExtender that includes a RemoteInput to your notification. After the user replies, you’ll just grab their voice input as a string from the RemoteInput included in the Intent. You can even include text responses the user can easily select from a list by passing an array of them to the setChoices method of the RemoteInput. More details and code can be found here.

WhatsApp message with the reply by voice action.

See who is texting

Messages are more meaningful when you are connected to the sender. That’s why we recommend you include the photo of the sender as the background of the notification. As soon as the user taps into the message, they also see who it’s from, which will make it matter more (or maybe that other thing, depending on who it is).

You should add a photo with a resolution of at least 400×400, but we recommend 640×400. With the larger size, the background will be given parallax scrolling. If the background is to be included in the apk, place it in the res/drawable-nodpi directory. Then call setBackground() on your WearableExtender and add it to your notification. More details and code can be found here.

Path Talk message with a clear picture of the sender.

Custom actions

Basic notifications with reply by voice and a good background image are the most important parts to get done right away. But why stop there? It’s easy to extend the unique parts of your service to the wearable. A simple first step is adding in a custom action the way Omlet does. These are just actions defined with the WearableExtender that raise an intent on the handheld.

Omlet includes two extra actions with every message: Like and Check-In. Check-In sends along the user’s current location.

Custom Layouts

Custom interaction on the wearable, like the following example from TextMe, is straightforward to implement. They have what appears to be a simple notification with an action that allows the user to select an emoticon. However, to show this emoticon picker, they are actually issuing a notification from the wearable. The round trip looks something like this:

  1. The handheld gets a new message, issues a notification setLocalOnly(True), and sends a message to the wearable using the Data Layer API
  2. The wearable receives that message using the WearableListenerService and issues a custom notification with a PendingIntent to launch an activity when the user views the notification
  3. That activity has a custom layout defined with the Wearable UI Library
  4. Once the user selects an emoticon, the wearable sends a message back to the handheld
  5. The handheld receives that message and sends it along to the server

Custom layouts are documented in more depth here.

TextMe allows users to reply with a quick emoticon.

Next steps

Make your messaging service awesome by providing rich functionality on the user’s wearable. It’s easy to get started and easy to go further. It all starts at developer.android.com/wear.