Create a
Google Assistant app
in just a few clicks.

Google | Time 5 min
April 2021
What is a Google Assistant?

Google Assistant is an AI-powered virtual assistant developed by Google. There are currently two ways to engage in two-way conversation with the Google Assistant:

  • Using your mobile phone.
  • Using the Google Home Assistant.
What can I do with the Google Assistant?

To engage with a Google Assistant, you can directly talk or write to it. Currently, there are a variety of actions that you can use your Google Assistant for:

  • Manage tasks: send texts, set up meetings in your calendar or reminders, read emails …
  • Plan your day: make reservations, check flight/movie status, find itineraries …
  • Enjoy entertainment: play and control your music, watch videos on YouTube …
  • Revisit fond memories: Google can easily find your pictures of certain moments in time, like when you did that trip to Italy in the summer, remember? Well, Google does!
  • Get answers: Where else can you find information other than the great Google? Ask Google Assistant and it’ll provide the answers you seek, no matter the subject!
Can I create an app for the Google Assistant?

Yes, anyone can create an app for the Google Assistant! We’ll help you get started with Google Actions and create an app in just a few clicks. You don’t even need to know how to code, how cool is that?

You’ll need:

1. Create an Actions project

Open the Actions console and click on “New Project”. Let’s call our new project “Pivott-Actions”. You can also go ahead and choose a language for your action, as well as a country or region.

-

Then it’s time to choose the kind of action you want to build. Currently, there are six types of actions:

  • Smart Home: allows you to control your smart home devices with the Google Assistant and Google Home app.
  • Food ordering: integrates your food ordering flow with Google Search, Maps and the Assistant.
  • Game: allows you to build any type of game, from a trivia game to a fully immersive, multiplayer game experience.
  • Story telling: creates a family-friendly interactive narrative.
  • Education: builds an educational experience.
  • Custom: this is the type of action we’ll go for today, as the one we are creating doesn’t belong to any other category. It’ll allow you to build a unique conversational experience for your users.

Google Actions will then ask “how do you want to build it?”. Let’s go for a Blank project. Because the best way to learn is to start from scratch. So click on Start building and let’s build our very first action!

2. Start a Conversation

Before moving forward, here are some key terms you’ll need to understand to be able to start a conversation.

  • Main invocation: “An entry point for users to start conversations with your Action. When users say a phrase similar to “Hey Google, talk to ” , the main invocation triggers and responds to the user.” – Source : Google Codelabs
  • Prompt:”Defines what your Action sends to users as a response. Prompts can be simple text and speech responses or rich messages, like cards and images.” – Source : Google Codelabs

To start a Conversation, start with finding a display name. Note that a display name is mandatory for it to be able to go to productions, but is not necessary for a test application. The display name has to be more than a word, and needs to include a prefix. Let’s call ours “The Pivott Action” for now. Users will be able to invoke your actions by saying: “Hey Google, talk to The Pivott Action”.

Click save. Perfect! We can now start adding a main invocation: click on main invocation on the menu on the left. In the YAML code editor, replace the text “Start building your action by defining main invocation.” in the speech field with a message of your choice. In this example we will go for “Hello! Thank you for your interest in Pivott. We are a very ambitious team, and always happy to greet newcomers.” Then click on the save button.

Test your Action

Congratulations, you just finished the first two steps and can now test your newly made action! To do that, click on “test” in the upper menu and then type (or click on the microphone and say) “Talk to the Pivott Action”. If everything goes well you should hear: “Alright. Let’s get the test version of The Pivott Action. Hello! Thank you for your interest in Pivott. We are a very ambitious team, and always happy to greet newcomers.

Got it? Great! Then let’s take it up a notch and complicate our action a bit more. In the next step, we’re changing our action from just one answer to more of a conversation.

3. Create your Action’s conversation and deploy

Go back to “develop” and back to Main invocation. On the bottom right, you’ll see “transition”. Let’s change it to a new scene called “Start”. (see below)

Save and then go to the scene you just created by clicking on the left menu. Let’s add a prompt on enter, by clicking on “on enter” and checking the “send prompt” box. Replace the speech text with “What would you like to know about Pivott: Our services, Our clients, what job opening do we currently have or our contact info?” Then hit save again.

To add suggestions, click on “insert suggestion” on the bottom right and add as many suggestions as needed. In this example we added four: “Services”, “Clients”, “Job openings” and “Contact”.

-

For Google to recognise these suggestions, we need to add them as “Custom intent”. User intent defines user input that the Action can understand. You define the training phrases for these intents. When users say something that matches or is similar to a training phrase, the corresponding intent is matched. – Source : Google Codelabs

In the menu on the left, you can see “Custom intent”. Click on the little “+” sign, We’ll start with services, so let’s call this custom intent “services”, and click on it. Now we’ll add training phrases, which are synonyms or examples of what a user could possibly say to match the word. So for example, if our intent was “yes” a training phrase would be “I would”, “tell me” or “of course”. But don’t worry about “yes” or “no”, these two are already default in the system intent and you don’t need to set them up. Isn’t that great? For services, we used “How can you help?”, “What do you do?” “help” and “services”. Don’t forget to save!

-

Perfect! Now that Google understands what “services” is about, let’s add it to our start scene. Go to start, click on the little “+” sign next to “add intent handling”, then send prompts to add an answer. Replace the speech field with “We are happy to help you with our services, Creative & content marketing, Social media marketing, Dynamic creative optimisation, data & Automation, Digital Production and performance marketing.” In the transition field you can select “End conversation” to end the conversation. Then save.

-

You can do the same for all other suggestions. Once done, don’t forget to test your action.

And voilà! You can now deploy your creation and let anybody use it! Congratulations, you just built your very first Google Assistant app. Want to know more? Read further about it on codelabs, or contact us and we’ll gladly help you out!

People don’t buy
what you do,
they buy why
you do it.

Simon sinek