How to get Google Analytics dimension/metric description in multi-language? - google-analytics

I am using this API to get a list of dimensions/metrics from Google Analytics: https://developers.google.com/apis-explorer/#s/analytics/v3/analytics.metadata.columns.list?reportTy..., however, I just realized the API only supports 'uiName', 'description' in English! is that true? is there any work around to support multi-language? Thanks!
"items": [
{
"id": "ga:userType",
"kind": "analytics#column",
"attributes": {
"type": "DIMENSION",
"dataType": "STRING",
"group": "User",
"status": "PUBLIC",
"uiName": "User Type",
"description": "A boolean, either New Visitor or Returning Visitor, indicating if the users are new or returning.",
"allowedInSegments": "true",
"addedInApiVersion": "3"
}

That is true the Meta data api only returns data in english. You are going to have to translate the metadata names to your chosen language yourself after you have downloaded the data you need

Related

How to retrive full Wikidata info of an entity

I'm using different kind of queries to retrive wikidata info of an entity like, for Berlin:
https://www.wikidata.org/wiki/Special:EntityData/Q64.json
https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q64&format=json
but all of these did not include the full information.
As an example, i'm not able to find the official language or population data.
How can I get all data?
Both of the shown URLs / APIs do should you the full data for the entity that you are looking at, Q64 being Berlin.
In Wikidata the official language is represented by the Property P37 and the population by Property P1082.
You will find references to these properties in the JSON output.
For example for the language:
{
"mainsnak": {
"snaktype": "value",
"property": "P37",
"hash": "b8dce904caadeef339763625b903974aa4c83c6a",
"datavalue": {
"value": {
"entity-type": "item",
"numeric-id": 188,
"id": "Q188"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
},
"type": "statement",
"id": "Q64$9AEBFCE4-EC53-4A97-B20B-4579FBD32CE7",
"rank": "normal"
}
This refers to Q188 which is German.

Deeplinking into a telegram bot

I have a simple use case. When a user clicks the link below,
T.me/MycompanynameBot?start=Microsoft
I want to show him 3 inline buttons corresponding to 3 Telegram channels within Microsoft. Is this possible?
The key is the bot must be able to retrieve the parameters from the URL.
Thank you.
Yes it's possible to retrieve bot parameter via answerCallbackQuery
Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via #Botfather and accept the terms. Otherwise, you may use links like:
t.me/your_bot?start=XXXX
that open your bot with a parameter.
Here is an example I made for you :
{
"ok": true,
"result": [{
"update_id": 89590932,
"message": {
"message_id": 5978,
"from": {
"id": 223110107,
"is_bot": false,
"first_name": "Ğąme",
"last_name": "Ǿver!",
"username": "GameO7er",
"language_code": "en"
},
"chat": {
"id": 223110107,
"first_name": "Ğąme",
"last_name": "Ǿver!",
"username": "GameO7er",
"type": "private"
},
"date": 1579094448,
"text": "/start Microsoft",
"entities": [{
"offset": 0,
"length": 6,
"type": "bot_command"
}]
}
}]
}
As you can see type=bot_command so you can parse the message if (type == "bot_command") and get text and substring /start from the original text or what ever you want to do.
In many cases I detect users with the parameters for example when I wanna to know who invited this user to bot I share the link in this format:
t.me/NameBot?start=ReferUserID
for example :
t.me/NameBot?start=223110107
is my ID and I can see how many user I've invited to the bot.
Hope be useful.

Does the RingCentral Call Log API Return a "Missed" Value?

In the RingCentral Online Account Portal (https://service.ringcentral.com) and endpoint apps, the call log display shows whether a call was Inbound, Outbound or Missed.
In looking at the API Reference for the Call Log API, it seems that it only sends back Inbound or Outbound for "Direction". Does the developer Call Log API return a "Missed" value? Is there another way to get this information via the Call Log API?
Ref: https://developer.ringcentral.com/api-docs/latest/index.html#!#RefCallLog.html
This question appears to be in reference to the Online Account Portal UI's "Type" column as shown in this screenshot:
The web UI's "Type" column shows Inbound, Outbound or Missed. This can be generated by using the response properties for both direction and result.
direction API response property will be Inbound or Outbound
result API response property is an enumerated value that includes Missed and other values including Voicemail which is the example screenshot. A full list is available in the link below:
Ref: https://developer.ringcentral.com/api-docs/latest/index.html#!#ResultStatusValues
Here is an example response:
{
"uri": "https://platform.ringcentral.com/restapi/v1.0/account/11111111/call-log?view=Simple&showBlocked=true&withRecording=false&dateFrom=2018-08-27T06:18:00.000Z&page=1&perPage=100",
"records": [
{
"uri": "https://platform.ringcentral.com/restapi/v1.0/account/11111111/call-log/22222222?view=Simple",
"id": "22222222",
"sessionId": "33333333",
"startTime": "2018-08-27T17:38:12.634Z",
"duration": 27,
"type": "Voice",
"direction": "Inbound",
"action": "Phone Call",
"result": "Missed",
"to": {
"phoneNumber": "+16505550101"
},
"from": {
"phoneNumber": "+16505550102",
"name": "LOS ALTOS CA",
"location": "Los Altos, CA"
}
}
],
...
}
Please read this blog to find out more information you can find from the call log.

Adobe Analytics API - Real Time Classification

I need to get from Omniture real time API a classify eVar, exclude some value, and then breackdown its with sitesection.
I try with this query:
{
"reportDescription": {
"source": "realtime",
"reportSuiteID": "**RSID**", //MY REPORT SUITE
"metrics": [{
"id": "instances"
}],
"elements": [{
"id": "evar", //MY EVAR
"top": 100,
"classification": "Real Time", //CLASSIFICATION NAME
"search": {
"type": "NOT",
"keywords": ["somevalue"] //THE VALUE TO EXCLUDE
}
},{
"id" : "sitesection",
"top" : 1
}],
"dateGranularity": "minute:1",
"dateFrom": "-1 minute"
}
}
But in the JSON response I see "somevalue" how if it not excluded.
The strange thing is that if I remove the "breakdown" (with sitesection) the classification filter seems to works fine.
I can't use classification filter if a breackdown is used in real time report? I can't find any documentation about that.
An other thing is that if I request a report with the classification, without any search, I receve the response but there is a lot of "::Unspecified::". The problem is that the "::Unspecified::" seems to be the last datas that Omniture receves form my webpages. I think this means that classifications are not in real time, also if you can to use it in real time report.

Google Analytics Experiments always chooses original variation?

I'm setting up a multivariate test through Google Analytics. I created the experiment through the API, and everything is looking like its running, however, only the original is being selected and the variants aren't being served.
I've tried using incognito windows, and had a few other people visit the page as well, but everyone receives a page with ?utm_expid=XXXXXXXX-XX.YYYYYYYYYYYYYYYYYY.0 on the end, where the .0 seems to indicate "show original."
Any ideas why an experiment might always show the original? Here's my experiment as retrieved through the API.
{
"id": "YYYYYYYYYYYYYYYYYYYYY",
"kind": "analytics#experiment",
"accountId": "AAAAAAAA",
"webPropertyId": "UA-ZZZZZZZZZ-0",
"profileId": "XXXXXXXX",
"name": "Product Page - Grid Content",
"description": "Test of product page grid content.",
"created": "2013-11-22T15:53:32.634Z",
"updated": "2013-11-22T16:27:15.406Z",
"objectiveMetric": "ga:timeOnSite",
"optimizationType": "MAXIMUM",
"status": "RUNNING",
"startTime": "2013-11-22T16:00:37.367Z",
"rewriteVariationUrlsAsOriginal": true,
"winnerConfidenceLevel": 0.95,
"minimumExperimentLengthInDays": 7,
"trafficCoverage": 1,
"equalWeighting": true,
"variations": [{
"name": "Newest Products (Original)",
"url": "http://mystore.com/product/pastel-lipstick",
"status": "ACTIVE",
"weight": 0
}, {
"name": "Most Popular Products",
"url": "?",
"status": "ACTIVE",
"weight": 0
}, {
"name": "Related Products",
"url": "?",
"status": "ACTIVE",
"weight": 0
}],
"servingFramework": "REDIRECT",
"editableInGaUi": true
}
UPDATE:
I've suspected this might have something to do with those weight: 0 fields under variations[]. I'm not entirely sure why they appear as weight: 0, or whether that actually prevents variations from showing.
Originally, I wanted to set url: "?" for my variations because I wanted to avoid polluting my query string. Instead of using different URLs/query string variables to determine which variation to show, I used the utm_expid query string variable the GA Experiment redirect adds to determine which variation to show. Although the API accepted these URLs without issue, I'm not sure they're actually considered 'valid.' So I tried changing the URLs to be ?mvt=1 and ?mvt=2 respectively, and saw the weights changed to 0.3333 and variations serve.
Although changing the URL seems to work, does anyone have a thorough explanation for what or why this is happening?
There is an open issue on this https://code.google.com/p/analytics-issues/issues/detail?id=377. If you subscribe to that then you'll get notified when it's fixed.

Resources