Is there an anonymous ID in Actions on Google with Dialogflow?

client id issued by your actions to google
google assistant account linking example
google client id and secret
google home account linking failed
google actions console
google assistant link account
google app id
dialogflow api

Is there an anonymous ID in Actions on Google with Dialogflow that I can access using DialogFlow in Node.js?

I don't need to know the Google account of who is using the Action, but I do want to have a unique identifier so that the Action can know when they come back.

Google no longer provides one for you. You will have to generate one when a new user interacts with your webhook and store the generated id in their user storage object.

To identify a new user your just check if they already have an id in their user storage object. For generating the id you can use an library like uuid. https://www.npmjs.com/package/uuid

Uuidv4 is probably the one that you need if you just need a unique id for simple identifications

Account linking with Google Sign-In, Your Action can request access to your user's Google profile during a take note of the value of Client ID issued by Google to your Actions. originalRequest.data.message.from.id The Telegram says this field is a: "Unique identifier for this user or bot" So I think it is safe to use it for authentication and identify every intent of my users fulfilled by my webhook. I was wondering about the actions-on-google authentication and I found the field originalRequest.data.user.userId.

The original idea from Google was to leverage a field called userStorage, but this feature seems to be borked ATM.

userStorage Documentation: https://developers.google.com/actions/assistant/save-data

Reddit thread regarding issues: https://www.reddit.com/r/GoogleAssistantDev/comments/d88z7e/userstorage_saga_continued/

Unless something has changed (I haven't checked on userStorage since I've been busy writing a fix around it) you may be out of luck without Account Linking. Feel free to try userStorage and keep me honest as they may have remedied the situation internally.

Alternatively, if all you need is an identifier or session for a single conversation you can leverage the conversationId which will be unique until the conversation ends.

Build fulfillment with the Actions on Google Node.js client library, The Node.js client library is a fulfillment library for Actions on Google that webhook API for Dialogflow and Actions SDK as a service function. Their anonymous handler functions take a conv argument and send back a  The Dialogflow agent contains all the intents that define your Action. Note: When creating a new project, Actions on Google enables Firebase , Google's developer platform that provides a number of services for app developers.

I've found a possible option...

(When working in DialogFlow in Node.js, most code is in a handler and the parameter is usually called conv. The following assumes that it is inside such a handler.)

On every single call, check for an 'existing' id in the session data and the user storage:

var id = conv.data.MyId || conv.user.storage.MyId || '';

if(!id) {
  id = /* make a new Id for this user... a GUID or some other unique id */
  conv.user.storage.MyId = id;
}

Once I get the Id from storage or make a new one, it is critical to reassign it to conv.data, since conv.user.storage seems to be reliably provided only on the first call!

// IMPORTANT
conv.data.MyId = id;

/* use the Id as needed */

My code looks up the Id in a firebase database to get details from their last visit.

This seems to be working, but may not be reliable.

Anonymous User Identifier will NOT be worked from June 2019 , r/GoogleAssistantDev: A community for developers building Actions for the Google If your action is using `conv.user.id`, we will NOT be able to use its code from on a google assistant project, with dialogflow, firebase and google storage,  Authenticating users with Actions on Google. the case then the user will be shown a dialog that will allow them to create an account there an then, of the Client ID, Client

userId is missing from the Dialogflow API response, I have tried the same from the simulator present in console.actions.google.com and I couldn't find `userId` here as well. Details. Personalizing  This page describes the actions and parameters settings for intents and how they are used when intents are matched at runtime.. Where to find this data. When building an agent, it is most common to use the Dialogflow Console (visit documentation, open console).

dialogflow/dialogflow-fulfillment-nodejs, This happens when I migrate from deprecated anonymous ID in userId I am using dialogflow-fulfillment version 0.6.1, and action-on-google version 2.5.0. If I perform the save onto conv.user.storage using the google home  To define Actions in Dialogflow, you create intents in your Dialogflow agent and assign them as entry points into your Action. You can create the following types of Actions: Default Action : Every Dialogflow agent must have one and only one Action that's invoked when users ask for your Action by name (for example, "Ok Google.

Using Jovo with just a Dialogflow Agent (without Action on Google , Using Jovo with just a Dialogflow Agent (without Action on Google) node_modules/jovo-core/src/BaseApp.ts:211:11) at <anonymous> Module: true }, "id": "4e4d624b-1369-47fa-90d5-0052e5764666-21947381",  Dialogflow is a Google service that runs on Google Cloud Platform, letting you scale to hundreds of millions of users. Optimized for the Google Assistant Dialogflow is the most widely used tool to build Actions for more than 400M+ Google Assistant devices.

Comments
  • Thanks, @Jordi. I'm now using uuidv4 as suggested, though I remove the '-' and prepend a letter to be able to use it as a firebase id!