Digital Goods Transaction of Actions on Google (Overview)

Yoichiro Tanaka
6 min readDec 15, 2018

--

Google Assistant has been launched on May 2018, and already past 31 months at this writing time. Currently, the Google Assistant has many features, and the number of them is increasing day and day. In the features, there are some features that we can use in our actions for business.

  • User Authentication
  • Physical/Digital Goods Purchase

Here, I introduce the Digital Goods Transaction. This purpose of this story is that you can know Digital Goods Transaction of Actions on Google and you can understand how to integrate it into your actions.

You can see the overview of the Digital Goods Transaction on the following document:

I intend to describe the way how to integrate the Digital Goods Transaction into your actions.

As a first thing I want to inform you, you need to use many products of Google, you need to configure many setting items, you need to relate them, and you sometimes need to wait until processes are completed by Google server side. That is, there is a very long journey to use the feature.

Are you ready? Ok, let’s get started.

Digital Goods Types

In the Digital Goods Transaction feature, you can handle the following types of digital goods:

  • One-time purchases only charge the user once. Goods sold as one-time purchases are called “managed products” by the Google Play Console.
  • Subscriptions automatically charge the user on a recurring schedule. These include purchases like a monthly fee for premium features.

Furthermore, there are two sub types in the One-time purchases:

  • Non consumed goods can only be purchased once per user, such as a paid upgrade for an ad-free experience or a game expansion with additional content.
  • Consumed goods can be purchased multiple times, such as a quantity of in-game currency. After the item is purchased, send a consume request to make the item available for purchase again.

You can sell these goods by the Digital Goods Transaction from your actions.

Related Developer Consoles

The Digital Goods Transaction feature consists of some Google products. Therefore, you need to use some developer consoles. For instance, there are the following:

  • Actions on Google Console
  • Dialogflow Console
  • Google Play Console
  • Google Search Console
  • Google Cloud Platform Console
  • Firebase Console

Actually, the Dialogflow is optional. That is, you can build your actions with the Digital Goods Transaction without using Dialogflow. But, if you want to bring a user experience by a high quality conversation, I recommend you using the Dialogflow.

Also, if you use the Cloud Functions to build your fulfillment, the Firebase Console is unnecessary. In the other hand, the Google Cloud Platform Console is required, because you need to turn on the Digital Purchases API and need to issue a service account to use the API on the Google Cloud Platform Console.

Why Google Play Console is necessary?

Actions on Google doesn’t provide any features to manage digital goods. Instead, we need to use the feature provided by the Google Play.

If you build your Android app and want to publish it for users, you will register your Android app to the Google Play with Google Play Console. And, if you want to sell digital goods from the Android app, you will register goods on the Google Play Console, then you can manage them on the Google Play Console.

The Digital Goods feature of the Actions on Google relies on the Google Play Console. That is, if you want to sell digital goods with the Digital Goods Transaction feature of the Actions on Google, you need to register your Android app and the digital goods with the Google Play Console. And, if users purchase them on your actions, your actions will communicate to the Google Play to retrieve each information of goods and to do the payment process.

Why Google Search Console is necessary?

Basically, there is no relationship between Actions on Google project and Android app registered into the Google Play Console. But, you need to establish the relationship to use the digital goods information in the Google Play from the Actions on Google. To do that, something common key in necessary.

Actions on Google uses a validated Web site URL for the relationship. To have the validated Web site URL, you need to use the Google Search Console. After your Web site URL is validated by the Google Search Console, you can related your Actions on Google project to your Android app on the Google Play Console with the URL as the common key. Actually, if you register the URL on both your Actions on Google project and your Android app on the Google Play Console, they are automatically related by the process running on the Google side.

Transaction Flow

The process of the Digital Goods Transaction consists of a collabolation of Google Assistant, Actions on Google, Dialogflow, Google Play and your actions. The flow of the Digital Goods Transaction is the following.

(1) Gather information

Check for available Play store SKUs: You query the Play store with the name of a package you own and a list of associated product IDs (SKUs), and it will return a list of which SKUs are available for this user to purchase.

Access the user’s existing goods (optional): You can also reference the user’s existing entitlements to see what items they’ve already purchased and tailor their ordering experience.

(2) Build order

With the list of available SKUs, you present the user an interactive list of purchasable items in the form of a carousel or list rich response.

(3) Complete the purchase

When the user selects an item, you send a purchase request to the Play store containing the SKU of that item and the ID of the user who wishes to purchase it.

The user is then prompted to complete the transaction using a pre-defined flow.

(4) Describe the purchase status

After the user completes the transaction flow, you receive a status code.

The user sees a response from you that describes whether the transaction was successful or failed.

(5) Make the purchase repeatable

If the user’s purchase was consumable, you send a consume request to the Play store to make the SKU available for future purchase. This is optional.

Prerequisite

You read the following before integrating the Digital Goods Transaction.

Review guidelines

Keep in mind that additional policies apply to Actions with transactions. Please be sure to review the policies and guidelines for transactions.

Locale limitation

Actions that sell digital goods can currently only be deployed in the following countries at December 7, 2018:

  • Australia, Brazil, Canada, Denmark, France, Indonesia, Italy, Japan, Mexico, Netherlands, Norway, Poland, Russia, Singapore, Spain, Sweden, Thailand, Turkey, United Kingdom, United States

You need to confirm whether the country where you want to publish your actions is included in the list above.

Next Action

Before implementing the transaction flow described above, there are so many preparation tasks. I intend to describe how to set up your Android app with the Google Play Console and Android Studio.

--

--