Youtube Analytics APi Error while trying to generate the report for traffic source - youtube-analytics-api

When I specify the following metrics and dimensions the query does not work:
Metrics - views
Dimensions - insightTrafficSourceType
When I specify the following metrics and dimensions the query does not work:
Metrics - views
Dimensions - insightTrafficSourceType
Query URL -https://youtubeanalytics.googleapis.com/v2/reports?endDate=2017-01-30&startDate=2017-01-28&metrics=views&ids=contentOwner==CONTENT_OWNER_ID&dimensions=insightTrafficSourceType
Error :message The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v2/available_reports for a list of supported queries.

When you are requesting a content owner report for traffic sources, you must also provide a filter to the query.
The filter can be one of the following:
video, channel, group, or a supported combination of uploaderType and claimedStatus
See documentation for the content owner traffic sources report:
https://developers.google.com/youtube/analytics/content_owner_reports#traffic-source-reports

Related

how to find the number of metrics and types of metrics used in microstrategy project

I am new into microstrategy an trying to find out the specific metrics(different metrics for different vendors) used in a project and trying to pull the total number of metrics in every group/vendor. How can we do this using the command manager scripts like : LIST ALL METRICS IN FOLDER FOR PROJECT.
Using this command I get multiple like 50k + metrics and my system freezes out. So need help with correct script or some solution.
Try search support in rest API. You can add metric as the query parameter and use page by to query object list.
https://www2.microstrategy.com/producthelp/Current/RESTSDK/Content/topics/REST_API/REST_API_Workflow_Searching.htm

Where are the methods specified that are needed to analyse an Analytics Data API V1 Beta report?

I have added GTM and GA4 to some website apps to produce tables of detailed stats on click-throughs of ads per advertiser for a date range. I now have suitable reports working successfully using Data Studio, but my attempts to do the same using the PHP implementation of Analytics Data API V1 Beta (in order to do batch runs covering many date ranges) repeatedly hit a brick wall: the methods needed to analyse the response from instantiating BetaAnalyticsDataClient and then invoking runPivotReport or batchRunReports or batchRunPivotReports (and so on) appear not be specified.
The only example that I could work from is the ‘quickstart’ one that does a basic dimension and metric retrieval, and even this employs:
getRows()
getDimensionValues()
getValue()
getMetricValues
that do not appear in the API documentation, at least that I can find.
The JSON response format for each report is of course documented: for example the output from running runPivotReport is documented as an instantiation of runPivotReportResponse.
But nowhere can I find a specification of the methods to be used to traverse the JSON tree (vide getDimensionValues() above) and extract some output data.
Guesswork has taken me part way, but purely for example, when retrieving pivot data, should a
getPivotDimensionHeaders()[0]
be followed by a
getDimensionValues()
or a
getPivotDimensionValues()
I am obviously approaching this all wrong, but what should I do, please?

Prometheus Grafana Templating order by count

I am trying to put a dropdown for each API end point which will show the QPS and Latency of http requests (RED metrics).
I used Grafana's templating and used the following prometheus query.
label_values(http_duration_milliseconds_count, api_path)
But the problem here is sort order. It shows some longtail api requests like /admin/phpMyAdmin all.
I want to do only the top 10 endpoints by count to be shown in this drop down. How do I achieve this?
Attached an image for reference on my first dashboard.
We can use query_result to achieve this.
https://grafana.com/docs/grafana/latest/datasources/prometheus/template-variables/#use-query-variables
query_result(topk(10, sort_desc(sum(http_tt_ms_count) by (api_path))))
http_tt_ms_count - is my metric timeseries of Prometheus with time taken.
api_path - is my label name
This query_result will give three-tuple value like this.
{api_path="/search/query"} 25704195 1507641522000
used the Regex field in query path to get only the api names.
*api_path="(.*)".*
This looks like a long way but
label_values((topk(10, sort_desc(sum(http_tt_ms_count) by (api_path)))), api_path)
is not working in Grafana which made me to go into this path.

google analytics transactionId and pagePath dimensions in the same query

I am trying to retrieve for each transaction on my website the pagepath. I am not really interesting into any metrics. I was trying to use transactionRevenue but I get the error
400: 'Selected dimensions and metrics cannot be queried together.'
What is a suitable metric to use when these two dimensions are together?
error 400: 'Selected dimensions and metrics cannot be queried
together.'
Not all dimensions and metrics can be queried together which ever ones you have chosen you cant query them together. Its best to check the dimensions and metrics explorer to check if you can query them together.
ga:pagePath can be combined with ga:transactionRevenue so that should not be your problem. I am not sure what other dimensions and metrics you have in there.
Query with out metrics
The reporting api requires that you send at least one metric. It is not possible to make a request with out any metrics.
•Any request must supply at least one metric; a request cannot consist
only of dimensions.
What I don't understand is you speak of not wanting any metrics yet ga:transactionRevenue is a metric.

Grafana - Graph with metrics on demand

I am using Grafana for my application, where I have metrics being exposed from my data source on demand, and I want to monitor such on-demand metrics in Grafana in a user-friendly graph. For example, until an exception has been hit by my application, the data source does NOT expose the metric named 'Exception'. However, I want to create a graph before hand where I should be able to specify the metric 'Exception' and it should log it in the graph whenever my data source exposes the 'Exception' metric.
When I try to create a graph on Grafana using the web GUI, I'm unable to see these 'on-demand metrics' since they've not yet been exposed by my data source. However, I should be able to configure the graph such that in case these metrics are exposed then show them. If I go ahead and type out the non-exposed metric name in the metrics field, I get an error "Timeseries data request error".
Does Grafana provide a method to do this? If so, what am I missing?
It depends on what data source you are using (Graphite, InfluxDB, OpenTSDB?).
For graphite you can enter raw query mode (pen button). To specify what ever query you want, it does not need to exist. Same is true InfluxDB, you find the raw query mode in the hamburger menu drop down to the right of eacy query.
You can also use wildcards in a graphite query (or regex in InfluxDB) to create generic graphs that will add series to the graph as they come in.