In my Actions on Google project, I save some data (like an uuivd userId) between conversations using conv.user.storage. With my own testing account, this works fine. On another testing account, the user.storage is cleared and the data is lost. The accounts have these differences:
A Google Home is connected to the account where user storage DOES works and voice match is set up, personal results is enabled.
NO Google Home is connected to the account where user storage DOESN'T work, no voice match is set up, personal results isn't an option since no device other than iPhone is connected. This account is used on smartphone (iPhone) only.
I know the user storage will be cleared when:
Voice match is set up and there is no match.
The user disabled personal data.
But this isn't the case for either accounts. I know the user is recognized as the same account because of the lastSeen and because the userId between conversations remains the same, as can be seen in the Conv object:
at the end of the conversation:
"user": {
"raw": {
"userStorage": "{\"data\":{\"userId\":\"f581e751-ad81-4a6b-9519-00a57d5e30d4\"}}",
"lastSeen": "2019-03-13T11:58:39Z",
"locale": "nl-NL",
"userId": "ABwppHEOonglGmWakeizd_Stx_OpUhSNzx2K4JWETc73FW-KctZLM2vc4B7V6Fxk9OfL3RQ3n5jIgw"
},
"storage": {
"userId": "f581e751-ad81-4a6b-9519-00a57d5e30d4"
},
"_id": "ABwppHEOonglGmWakeizd_Stx_OpUhSNzx2K4JWETc73FW-KctZLM2vc4B7V6Fxk9OfL3RQ3n5jIgw",
"locale": "nl-NL",
"permissions": [],
"last": {
"seen": "2019-03-13T11:58:39.000Z"
},
"name": {},
"entitlements": [],
"access": {},
"profile": {}
},
at the beginning of a new conversation:
"user": {
"raw": {
"lastSeen": "2019-03-13T11:59:33Z",
"locale": "nl-NL",
"userId": "ABwppHEOonglGmWakeizd_Stx_OpUhSNzx2K4JWETc73FW-KctZLM2vc4B7V6Fxk9OfL3RQ3n5jIgw"
},
"storage": {},
"_id": "ABwppHEOonglGmWakeizd_Stx_OpUhSNzx2K4JWETc73FW-KctZLM2vc4B7V6Fxk9OfL3RQ3n5jIgw",
"locale": "nl-NL",
"permissions": [],
"last": {
"seen": "2019-03-13T11:59:33.000Z"
},
"name": {},
"entitlements": [],
"access": {},
"profile": {}
},
Does anyone know any other reason why user.storage might be cleared other than the ones stated above, or another way without using account linking?
I think I figured it out. In https://myaccount.google.com/u/3/activitycontrols?utm_source=google-account&utm_medium=web I forgot to toggle the Chrome-history and activity option.
Related
I have a rails application and use elastic search as a search engine in my rails app. this app collects data from the mobile application and could collect from any kind of mobile app. mobile app sends two types of data user profile details and user actions details. my app admins could search over this data with multiple conditions and operations and fetch the specific results and which are user profile details. after that my app admins could communicate with this profile, for example, send an email, SMS, or even chat online. In my case I have two options to save user data; first of all, I want to save user profiles details and user action details in a separate document with this structure profile doc:
POST profilee-2022-06-09/_doc
{
"profile": {
"app_id": "abbccddeeff",
"profile_id": "2faae1d6-5875-4b36-b119-74a14589c841",
"whatsapp_number": "whatsapp:+61478421940",
"phone": "+61478421940",
"email": "user#mail.com",
"first_name": "john",
"last_name": "doe"
}
}
user actions details:
POST events_app_id_2022-05-17/_doc
{
"app_id": "9vlgwrr6rg",
"event": "Email_Sign_Up",
"profile_id": "2faae1d6-5875-4b36-b119-74a14589c840",
"media": "x1z1",
"date_time": "2022-05-17T11:48:02.511Z",
"device_id": "2faae1d6-5875-4b36-b119-74a14589c840",
"lib": "android",
"lib_version": "1.0.0",
"os": "Android",
"os_version": "12",
"manufacturer": "Google",
"brand": "google",
"model": "sdk_gphone64_arm64",
"google_play_services": "available",
"screen_dpi": 440,
"screen_height": 2296,
"screen_width": 1080,
"app_version_string": "1.0",
"app_build_number": 1,
"has_nfc": false,
"has_telephone": true,
"carrier": "T-Mobile",
"wifi": true,
"bluetooth_version": "ble",
"session_id": "b1ad31ab-d440-435f-ac12-3d03c30ac44f",
"insert_id": "1e285b51-abcf-46ae-8359-9a9d58970cdf"
}
As I said before app admins search over this document to fetch specific profiles and use that result to communicate with them, in this case, the problem is the mobile user could create a profile and a few days or a few months later create some actions so user profile details and user action details are generated in different days so if app admins want to fetch specific result from this data and wrote some complex query I have at least two queries by application on my elastic search in my app it's impossible because each query must save for later use by admin, so As a result of business logic it's impossible to me, and I have to add in some case I need to implement join query that based on elastic search documentation It has cost so it's impossible In the second scenario I decided to save both user profile and action in one docs somethings like this:
POST profilee-2022-06-09/_doc
{
"profile": {
"app_id": "abbccddeeff",
"profile_id": "urm-2faae1d6-5875-4b36-b119-74a14589c841",
"whatsapp_number": "whatsapp:+61478421940",
"phone": "+61478421940",
"email": "user#mail.com",
"first_name": "john",
"last_name": "doe",
"events": [
{
"app_id": "abbccddeeff",
"event": "sign_in",
"profile_id": "urm-2faae1d6-5875-4b36-b119-74a14589c841",
"media": "x1z1",
"date_time": "2022-06-06T11:52:02.511Z"
},
{
"app_id": "abbccddeeff",
"event": "course_begin",
"profile_id": "urm-2faae1d6-5875-4b36-b119-74a14589c841",
"media": "x1z1",
"date_time": "2022-06-06T11:56:02.511Z"
},
{
"app_id": "abbccddeeff",
"event": "payment",
"profile_id": "urm-2faae1d6-5875-4b36-b119-74a14589c841",
"media": "x1z1",
"date_time": "2022-06-06T11:58:02.511Z"
}
]
}
}
In this case, In the same state, I have to do as same as I do in before and I have to generate a profile index per day and append user action to it, so It means I have to update continuously each day, assume I have 100,000 profile and each one have 50 actions it means 100,000 * 50 per day update that have severity on my server so still it's impossible. So Could you please help me what is the best model to save my data in elastic search based on my descriptions?
Update: Does elastic search useful for my requirements? If I switch to other databases like MongoDB or add Hadoop it be more useful in my case?
I am building an action with the new Actions Builder and everything is going pretty smoothly. I just setup account linking and can successfully link my account, however, once I do link my account there is no token included in the subsequent requests for me to use, even though the account linking status is in the request as "LINKED". Can anyone shed any light on why I am not seeing a token?
For reference, here is a version of one of my requests.
{
"requestJson": {
"handler": {
"name": "main"
},
"intent": {
"name": "actions.intent.MAIN",
"params": {},
"query": "Talk to my new app"
},
"scene": {
"name": "actions.scene.START_CONVERSATION",
"slotFillingStatus": "UNSPECIFIED",
"slots": {},
"next": {
"name": "ListPrompt"
}
},
"session": {
"id": "ABwppHE7M6NS8KdyjljEptrtZZ5GkE3qDdaiwjYbL9ehrA-t_c-ZsCrZ_WhN0ZTG5lXXXXXXhU6Im5vgeSwow",
"params": {},
"typeOverrides": [],
"languageCode": ""
},
"user": {
"locale": "en-US",
"params": {},
"accountLinkingStatus": "LINKED",
"verificationStatus": "VERIFIED",
"packageEntitlements": [],
"lastSeenTime": "2020-07-13T12:02:42Z"
},
"home": {
"params": {}
},
"device": {
"capabilities": [
"SPEECH",
"RICH_RESPONSE",
"LONG_FORM_AUDIO"
]
}
}
}
The Google docs for the Account Linking with the new Actions Builder have now been updated with additional information. The token is now provided within the headers of the incoming request. Details of how to find and decode this can be found at https://developers.google.com/assistant/identity/google-sign-in#handle_data_access_requests
I'm using App ID and I follow this tuts https://cloud.ibm.com/docs/services/appid?topic=appid-tutorial-roles for my personal project.
I tried to call API {{APPID_MANAGEMENT_SERVER_HOST}}/management/v4/{{APPID_TENANT_ID}}/users with body:
"idp": "cloud_directory",
"idp-identity": "huynhdn#gmail.com",
"profile": {
"attributes": {
"role": "MANAGER"
}
}
}
I get Future User in User Profiles! => OK
Next, I call {{APPID_MANAGEMENT_SERVER_HOST}}/management/v4/{{APPID_TENANT_ID}}/cloud_directory/Users to set password for this user.
"displayName": "Test User",
"password": "abcd1234",
"emails": [
{
"value": "huynhdn#gmail.com",
"primary": true
}
]
}
Finally, I call {{APPID_AUTH_SERVER_HOST}}/oauth/v4/{{APPID_TENANT_ID}}/token to get token with user created above! But when i check in app id, attribute "role" is gone :(
WHY? or Anyone can help me another way to create user has "username", "password", "attribute" with API management!
The doc page you're referencing above states that in order to get future user attribute the user must validate ownership over email. You can either do it through standard means, or manually specifying status:confirmed when creating your CLoud Dir user, e.g.
{
"displayName": "John Smith",
"password": "p4ssw0rd",
"emails": [
{
"value": "john#example.com",
"primary": true
}
],
"status":"CONFIRMED"
}```
The documentation at https://developers.google.com/actions/smarthome/create-app#actiondevicessync mentions that the roomHint field of the JSON response to the sync request can be used to have Google automatically assign devices to correct rooms.
However, no matter what I return in that field, the user still has to manually assign every device to a room and I cannot get Google to automatically recognize the correct room using this roomHint field
Here's an example response:
{
"requestId": "500166151965294748",
"payload": {
"devices": [
{
"id": "9",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff"
],
"name": {
"name": "Light"
},
"willReportState": false,
"roomHint": "Attic"
}
]
}
}
Right now supplying a value for the roomHint is not used by the HomeGraph to determine which room this device is in.
So the situation is such:
I want the user to perform an (unique) action on my page. I do this through the presentation of an interface and a set of objects on my page. Works flawlessly.
But in order to present a complete user interface I must also give the option to delete the performed action, so I must know if a user has already interacted with a certain object.
Now could I run through all the objects, the user has interacted with and check, if the asked object is in there, but this way is not very resource savvy, when the user has interacted with a lot of items.
So the basic question is: Is there an API method, where I can look whether this user has already an action with the given object?
Thanks for your help!
https://graph.facebook.com/me/APP_NAMESPACE:ACTION_NAME
This will give you a list of all the actions of type ACTION_NAME that the current user has performed.
In the list you'll also find the connected objects.
Example:
https://graph.facebook.com/me/polarprint_forum:ask
{
"data": [
{
"id": "10150663311283415",
"from": {
"id": "549348414",
"name": "Joakim Syk"
},
"start_time": "2012-03-08T13:10:44+0000",
"end_time": "2012-03-08T13:10:44+0000",
"publish_time": "2012-03-08T13:10:44+0000",
"application": {
"id": "346637838687298",
"name": "Polar Print Forum"
},
"data": {
"question": {
"id": "10150604589861693",
"url": "http://www.polarprint.se/facebook_thread_tab/946/k\u0025C3\u0025A4ppteknik_vid_kullersten.html",
"type": "polarprint_forum:question",
"title": "käppteknik vid kullersten"
}
},
"likes": {
"count": 0
},
"comments": {
"count": 0
}
}
],
"paging": {
"next": "https://graph.facebook.com/me/polarprint_forum:ask?format=json&offset=25&limit=25"
}
}
A more efficient approach would probably be to store this information on your end when creating the actions.