No values return for Channel metrics - adsense

AdSense community!
We integrate with Google AdSense and we came across one issue, where we don't receive any values for Channel (custom_channel_name) metrics from API.
Request:
GET /adsense/v1.4/accounts/pub-1814736887286790/reports?startDate=2021-01-30&endDate=2021-03-10&dimension=CUSTOM_CHANNEL_NAME&metric=PAGE_VIEWS HTTP/1.1
Host: www.googleapis.com
Authorization: Bearer ya29.a0AfH6SMDhQM2OppSUprzHiS-mT0FI_ku36J9HME1D0W0nXhTHs4vvfkwIelv8mVVed4Pu_xGzrFbbefkeKCRue-X-RR8fgZhevYF1r6Eo6-VymNnJAkNoFDMwAEeAqvvUFiTQh3iyMAffLj0fJqK1yU2JrRXgQQ
Response:
{
"kind": "adsense#report",
"totalMatchedRows": "0",
"headers": [
{
"name": "CUSTOM_CHANNEL_NAME",
"type": "DIMENSION"
},
{
"name": "PAGE_VIEWS",
"type": "METRIC_TALLY"
}
],
"totals": [
"",
null
],
"averages": [
"",
null
],
"startDate": "2021-01-30",
"endDate": "2021-03-10"
}
We did not find in the API documentation that the metric would no longer be supported. Maybe you know what the problem is and help us solve it?
Thank you for your help!
Regards,
Ziga

The custom channel dimension is still supported in the API. Keep in mind that if a report row would have all zeros, then the row is not returned by the API. I would recommend you check this report in the UI to compare the results.

Related

TemperatureControl trait confusion

I have just started with Google Actions. The first trait we want to support is the temperature reading from my device. It's not a thermostat so we'll need to use TemperatureControl trait (readonly-sensor, no control) .
The issue is that after implementing TemperatureControl, I can't request Google Assistant to read out the temperature. Has anyone encountered similar issue? I have search the topic on TemperatureControl, seems there was none similar issue reported. Thanks in advance.
The more detail flow is:
ask "What's the temperature in Bedroom?"
I receive a QUERY intent in my backend server and responded with Ambient Temperature
but, the answer is "Sorry I can't reach the bedroom right now. Please try again"
After that, I tried to add HumiditySetting Trait to verify my SYNC/ QUERY validity.
This is working.
ask "What's the Humidity level in Bedroom?"
I receive a QUERY intent in my backend server and responded with Ambient Humidity. Actually it's the same response as in the case of Temperature.
but, the answer is "the bedroom has a current humidity reading of xx%"
My SYNC Response is validated with https://developers.google.com/assistant/smarthome/tools/validator
Below is a sample:
{
"requestId": "10692316150281033205",
"payload": {
"agentUserId": "1-5671",
"devices": [
{
"id": "3466",
"type": "action.devices.types.CAMERA",
"traits"[
"action.devices.traits.HumiditySetting",
"action.devices.traits.TemperatureControl"
],
"name": {
"defaultNames": [
"bedroom"
],
"name": "bedroom",
"nicknames": [
"bedroom"
]
},
"willReportState": true,
"roomHint": null,
"deviceInfo": null,
"otherDeviceIds": null,
"customData": {
"deviceId": "CQAMNGF"
},
"attributes": {
"temperatureUnitForUX": "C",
"queryOnlyHumiditySetting": true,
"queryOnlyTemperatureControl": true
}
}
],
"errorCode": null
}
}
I found the issue.
I was using thermostatTemperatureSetpoint and thermostatTemperatureAmbient in Query response.
After changing them back to temperatureSetpointCelsius
temperatureAmbientCelsius, it works.

How to use roomHint and structureHint with smarthome actions on Google

We are currently setting un a Smarthome action, and we would like to provide roomHint on the first sync (not on request sync) as it's really tedious to set up rooms on the first sync, but it does not work.
We tried to name rooms in english and also in italian, (as it's not really clear from the documentation if there is a list on room names that we can use?) but no way.
So can you please give us a hint how to use the roomHint field?
Also in the API doc we've found structureHint, does it work? The documentation for SYNC intent does not mention this field.
Here is our SYNC intent with one device and room, we took office from the example JSON:
{
"requestId": "3582198904737125163",
"payload": {
"agentUserId": "xyz#qwertyz.com",
"devices": [
{
"id": "deviceID",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff"
],
"name": {
"name": "Lampadina",
"defaultNames": [
"Lampadina_XYZ"
],
"nicknames": [
"Lampadina"
]
},
"willReportState": false,
"customData": {
"modelType": "DEVICE"
},
"roomHint": "office"
}
]
}
}
Thanks
Unfortunately, I believe the structureHint is only in the HomeGraph API sync response.
It cannot be used in the Sync intent.
If someone can tell me I'm wrong and how to use it, you'd be a hero.

Error "Empty speech response"

I tried to connect DialogFlow and Actions on Google, so I created some intents, connected the services, added explicit and implicit invocations etc, but when I try the bot in the simulator https://console.actions.google.com/project/[projectId]/simulator/ it always gives me the error:
"Failed to parse Dialogflow response into AppResponse, exception
thrown with message: Empty speech response"
even tough inputType was "KEYBOARD".
What I tried so far:
I did set "Response from this tab will be sent to the Google Assistant integration" in Dialog Flow (do you have to set it for every single intent?), but I don't see any extra setting for speech.
I disabled the second language, first I had also intents in German
I also turned off the Fullfillment Webhook (implemented in API v1 and then also v2) with no change
I only found this user with the same problem https://productforums.google.com/forum/#!topic/dialogflow/xYjKlz31yW0;context-place=topicsearchin/dialogflow/Empty$20speech$20response but no resolution.
the fulfillment checkbox is checked at the intents
The bot works fine when I use it through "Try it now" on the very right in Dialog Flow or in the Web Demo https://bot.dialogflow.com/994dda8b-4849-4a8a-ab24-c0cd03b5f420
Unfortunately the docs don't say anything about this error. Any ideas?
Here a screenshot of the error on the Actions integration:
This is the full debug output:
{
"agentToAssistantDebug": {
"agentToAssistantJson": {
"message": "Failed to parse Dialogflow response into AppResponse, exception thrown with message: Empty speech response",
"apiResponse": {
"id": "c12e1389-e887-49d4-b399-a332188ca946",
"timestamp": "2018-01-27T03:55:30.931Z",
"lang": "en-us",
"result": {},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "1517025330705"
}
}
},
"assistantToAgentDebug": {
"assistantToAgentJson": {
"user": {
"userId": "USER_ID",
"locale": "en-US",
"lastSeen": "2018-01-27T03:55:03Z"
},
"conversation": {
"conversationId": "1517025330705",
"type": "NEW"
},
"inputs": [
{
"intent": "actions.intent.MAIN",
"rawInputs": [
{
"inputType": "KEYBOARD",
"query": "Talk to Mica, the Hipster Cat Bot"
}
]
}
],
"surface": {
"capabilities": [
{
"name": "actions.capability.MEDIA_RESPONSE_AUDIO"
},
{
"name": "actions.capability.WEB_BROWSER"
},
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
}
]
},
"isInSandbox": true,
"availableSurfaces": [
{
"capabilities": [
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
}
]
}
]
},
"curlCommand": "curl -v 'https://api.api.ai/api/integrations/google?token=TOKEN' -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: AUTH_TOKEN' -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"USER_ID\",\"locale\":\"en-US\",\"lastSeen\":\"2018-01-27T03:55:03Z\"},\"conversation\":{\"conversationId\":\"1517025330705\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"Talk to Mica, the Hipster Cat Bot\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]}]}'"
},
"sharedDebugInfo": [
{
"name": "ResponseValidation",
"subDebugEntry": [
{
"debugInfo": "API Version 2: Failed to parse JSON response string with 'INVALID_ARGUMENT' error: \": Cannot find field.\".",
"name": "UnparseableJsonResponse"
}
]
}
]
}
Also "debugInfo" sounds like an internal problem:
"API Version 2: Failed to parse JSON response string with
'INVALID_ARGUMENT' error: \": Cannot find field.\"."
Here a screenshot of the welcome intent:
ps.
It took me AGES to figure out, what
"Query pattern is missing for custom intent"
means - so I just document it here: In Dialog Flow - Intent - "User says" you have to DOUBLE CLICK on a word in the text input field when you want to set it as query parameter - which seems to be required for Actions on Google.
This happened to me. If this happens for an Intent you just added in the Dialogflow console and you are using Webhook fulfillment for the action, check the intent's fulfillment settings and ensure that the Webhook fulfillment slider is on. Evidently new intents don't automatically get webhook fulfillment: you have to opt each one in piecemeal (or at least, that was my experience).
I experienced this situation too.
My problem was that I used a SimpleResponse in my fulfillment index.js without referencing to it. So the solution for me was to add SimpleResponse like this in index.js:
const {dialogflow, SimpleResponse} = require('actions-on-google');
So, always check if you aren't using any dependencies without including it in your js-file.
Probably not the most common cause of the problem, but it can be.
I got this when running through the codelabs tutorial (https://codelabs.developers.google.com/codelabs/actions-1/index.html#4) and didn't name my intent the same name as it is referenced in the webhook script:
I came across this error when trying to develop my own WebHook. I first verified that my code was called by looking into the Nginx log, after which I knew there was a problem in my JSON output because I based my output on outdated examples.
The (up-to-date) documentation for both V1 and V2 of the API can be found here:
https://dialogflow.com/docs/fulfillment/how-it-works
This example response for v2 of the dialogflow webhook API helped me to resolve this error:
{
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "this is a simple response"
}
}
]
}
}
}
}
Source: https://github.com/dialogflow/fulfillment-webhook-json/blob/master/responses/v2/ActionsOnGoogle/RichResponses/SimpleResponse.json
You can find more examples in the official github repository linked above.
Another possibility is if you have a text response (even an empty one) like so:
Then you need to click the trash can next to the response to clear it out to use the webhook.
The Actions on Google support helped me fix this problem:
I needed to add a text as Default Response to the intent used for Explicit Invocation.

Fiware Orion subscription to STH in NGSI V2 with legacy values

Im working with sth, with ngsi v1 i dont have any problems. When i try to use it with ngsi v2 ( trough legacy values) im having several problems.
Im creating a subscription in v2 in this way:
POST /v2/subscriptions HTTP/1.1
Host: <orion-context-broker-host>:<orion-context-broker-port>
Content-Type: application/json
fiware-service: xxxx
fiware-servicepath: /xxxx
{
"description": "Probando legacy",
"subject": {
"entities": [
{
"id": "sthlegacy2",
"type": "NGSIV2"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"attrsFormat":"legacy",
"http": {
"url": "http://<sth-host>:<sth-port>/notify"
},
"attrs": []
},
"expires": "2040-01-01T14:00:00.00Z",
"throttling": 0
}
The subscription is well created but when i try to update a value the subscription state changes to "failed", and it does not create anything in sth.
I would appreciate a solution, something I must be doing wrong.

Insights before 2010-04-02 are missing?

I'd like to get Insights data before 2010-04-02, but it seems to be impossible to retrieve via the Graph API or FQL query. If you make a Graph API request spanning over 2010-04-02 you will get results starting at 2010-04-02 and going forward with the rest simply missing. Can any one explain this or have a way to get around this limitation?
Here is an example of the problem: http://developers.facebook.com/tools/explorer/?method=GET&path=2439131959%2Finsights%2Fapplication_active_users%3Fsince%3D2010-03-28%26until%3D2010-04-10%26date_format%3DY-m-d
There should be results from 2010-03-28 to 2010-04-10, but you only get 2010-04-02 and onwards.
{
"data": [
{
"id": "2439131959/insights/application_active_users/day",
"name": "application_active_users",
"period": "day",
"values": [
{
"value": 172118,
"end_time": "2010-04-02"
},
{
"value": 177263,
"end_time": "2010-04-03"
},
{
"value": 176568,
"end_time": "2010-04-04"
},
{
"value": 190725,
"end_time": "2010-04-05"
},
...
Maybe your insights were a "victim" of this: https://developers.facebook.com/docs/reference/fql/insights/
We are deprecating some old insights. These metrics are marked as
deprecated throughout this document. After 12/21/2011, data for these
metrics won't be available prior to 07/19/2011 -- please download this
data before this 12/21/2011. These insights will be completely removed
from API after 02/15/2012.