0

Hi I'm not a coder and need guidance.

I'm creating a simple skill for Google Assistant in Dialogflow where the goal is to get a user's email. However, when I test it out verbally in Google actions console most of the time it picks up the wrong email address, (I'll say nhs.com and it thinks I'm saying something different) even though I have put example emails in the entities bit.

What is the solution around this? Is it possible to ask permission in Dialogflow to get a users data? I think Google Assistant says no you can only do that (account linking) if you build in Google Assistant? Can you ask the user to verbally spell out their email address, although no idea how you would go about doing that.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • I found this SO thread https://stackoverflow.com/questions/44086605 which discusses account linking which you have mentioned. And this SO thread https://stackoverflow.com/questions/48967802 which mentioned that such feature is not available in Dialogflow directly but provides an alternative in which you can work on. Have you already tried sys.email entity? https://stackoverflow.com/questions/53530274 – Rally H Oct 28 '20 at 07:33
  • Hi, yes that's what i'm currently using sys.email entity but I'm not finding it very reliable when I test it in the simulator in Google Actions Console. Thanks for replying I will take a look at the links you provided. – ahudovsky Oct 28 '20 at 14:32

1 Answers1

2

It is not recommended to ask the user for their email. Emails can have a very difficult structure consisting of characters and numbers. Because of this Google provides you with the option to retrieve the users details via accountlinking. I've listed some options for retrieving an email.

1) Google Sign-in (Requires Code)

Since you said you aren't a coder it will be a bit challenging to get the user's email easily. Your best option would be to use Google Sign-in accountlinking. This provides your bot with a flow that asks the user permission to use their email automatically.

To be able to use this code, you might have to use some code since I do not know if Dialogflow supports retrieving the user email from the webpage when using accountlinking.

The benefit of Google Sign-in is that you will get the active email that is in their Google profile.

2) Regex entity (Requires some technical knowledge about regex)

Dialogflow supports a feature called Regex Entities. With these entities you can provide a regex which will look through the user input for a pattern. If the user input matched the pattern it will take this from the user input. In your case you would need a regex to check for an email pattern.

With a regex entity the user can be prompted to tell their email. With this you approach you won't be certain if it actually is their real email and you might have to add a flow to double check if there weren't any typos in the email.

3) Email entity (Least technical option)

As Rally mentioned in the comments, Dialogflow also supports an email entity. This can be used to automatically detect an email in your user's input. Though it is an easy option to use, I've noticed that it doesn't always detect every email and since you can't improve it's behavior, it might not be the best choice. It definitely is the least technical option, but it might not always work.

Jordi
  • 3,041
  • 5
  • 17
  • 36
  • Thanks Jordi for taking the time to give me all the options, it seems i have a massive challenge ahead. Yes sys.email was the only option i could understand but i am finding that it is not very accurate. In future do you think if you are just creating a skill for google assistant that building it in actions builder will be simpler? – ahudovsky Oct 29 '20 at 09:05
  • 1
    I don't think switching to actions builder will simplify this process much. Action builder still uses the concepts of account linking and email entities (It has no regex entities). When developing for Google Assistant you can't really get around the technical bits when retrieving user information because the system has been build this way for privacy reasons. This is a challenging bit of Google Assistant and switching platforms won't make it less challenging, my best advice would be to pick a option and try to work with it trough trail and error. – Jordi Oct 29 '20 at 09:19
  • Is there a reason you want to avoid Account Linking? (Concern that it will be too difficult to implement? Or you want to stay with Dialogflow so you can use it with other chat systems?) – Prisoner Oct 30 '20 at 14:09
  • Hi Prisoner, I would love to be able to do Account Linking, I think it is a far more reliable way to get an email address than using sys.email as when i test it, emails end up having spelling mistakes or different words in it etc. But I just am finding account linking too difficult to implement unfortunately. – ahudovsky Nov 03 '20 at 12:44