Google Analytics Metadata API: Allowed Dimensions/Metrics Combinations - google-analytics-api

The Metadata API doesn't have an attribute or specific mapping to allowed dimensions/metrics combinations?

I am not sure if this is a question or a statement but you are correct the Google Analytics metadata API returns a list of dimensions and metrics that can be used in the Google Analytics Core reporting API.
At this time there is no API that will tell you which dimensions and metrics are valid combinations. the only way to do that is to check the dimensions and metrics reference manually or run the request and see what happens.
I have discussed it with the API team over the last several years its on there list but I don't think it has a very high priority for them.

Related

exporting data from Bluemix Presence Insights

I'm trying to export data from Presence Insights on Bluemix, I followed the following documentation:
https://presenceinsights.ng.bluemix.net/pidocs/analytics/export/
however I can't seem to find export button mentioned inside the document.
Data can be exported from the IBM Presence Insights Dashboard if you have data available. There are also REST APIs for exporting data. They are documented in the Floors, Sites, and Zones sections of the API Reference.
There were REST APIs in the product some time ago, but they were found to have limitations that made them less useful in production. In particular, the amount of data that builds up forces the response time on the API to grow beyond what the Bluemix infrastructure allowed. The API requests would timeout. To that end, the APIs were backed out, but it appears the documentation was left. That will be removed shortly.
Presence Insights still understands the value of exporting the data, so a new scheme is under investigation. For example, it would be ideal if the data could be exported under the covers to a production data storage facility, on a regular time frame.
In the interim, an alternative solution would be to use a Subscription to gather the backend enter/exit/dwell/timeout events directly and roll your own solution to store only what you need in whatever facility works for your application.

Analytics API shortcuts

Regarding Google Analytics API: Is it possible to consume data from defined shortcuts in GA?
You can't get data directly from a Shortcut, unfortunately. However, you can definitely get the data - you just have to build a query that gets the same info as the shortcut.
Check out the API Explorer if you haven't before: https://ga-dev-tools.appspot.com/query-explorer/. This is a good way to quickly learn the capabilities of the Core Reporting API v3. It basically comes down to a date range, metrics, dimensions, filters, segments, and sorting.

Right way to use Google Analytics API

Has anyone worked with GA API? I want to make a custom report on my web application by pulling data from my Google Analaytics Account. This may include pulling goals and conversions data. Is this possible?
Yes its possible but its a little tricky.
You can test what I am talking about here: http://ga-dev-tools.appspot.com/explorer/
Restricted dimension and metric combinations:
If you check the Dimension and metric reference. next to each of the dimensions and metrics there you can check them on and off. If you check under the Goals conversions group you will notice that when you select some of them you are no longer able to select other ones. So you will have to decided exactly what data you need and are allowed to request from the API.
XX in the metrics
If you check some of the goal metrics you will notice that they have an XX in them. The xx must be replaced with the goal number that you wish to select out. For example: ga:goalXXStarts would become ga:goal1Starts
List of all goals
If you need to get a list of all of the goals you will find that in the Management API not the core reporting API.
I hope this helps.

how to specify URL in filters pagePath core reporting api V3

I am building a web app that pulls data through the Core Reporting Api v3 from Google. I am using the client PHP library offered by Google.
I am currently trying to specify a page and retrieve its pageviews for a time range. Every other seems to be working okay except for the fact that if a specfy a filter with ga:pagePath==http://link/uri then I get 0 all the time no matter the time range.
I think the problem is got to do with the setting of value for this pagePath. I want to have spearate data for the desktop version of the site and the smartphone version denoted by s. subdomain
Can anyone hint me on some tips and or tricks to use to get the required data?
Example URL:
http://domain.com/user/profile/id/1
http://s.domain.com/user/profile/id/1
Thanks in advance!
for the the default implementation of Google Analytics, ga:pagePath doesn't include the scheme or hostname so in your case you'd actually want to filter using ga:hostname and ga:pagePath together.
I suggest you use the Query Explorer to build your queries and get familiar with what will work. You can also use this tool to at least get a sense for what type of data the ga:pagePath and ga:hostname dimensions return before trying to filter on them. Finally, once you have the query you want, you can easily get the exact Core Reporting API query by clicking on the Query URI button.
Also check out the Combining Filters section of GA API docs.
So if you want filter on ga:pagepath for domain.com and s.domain.com separately you could do something like
filters=ga:pagePath==/user/profile/id/1;ga:hostname==domain.com
filters=ga:pagePath==/user/profile/id/1;ga:hostname==s.domain.com

Clarification on Bing Maps API locationCode field

I'm working on learning the Bing Maps API for my current project at work. In various locations in route and traffic data output, there is a field called locationCode (or locationCodes). The documentation provides no clarification on what this field is, except to state: "A subscription is typically required to be able to interpret these codes for a geographical area or country."
Nothing I've been able to find yet defines this further or clarifies what data that code can be translated into by these subscription services. So, what are some of the services available to translate this code and what data can be obtained via these services?
Those information are related to traffic for specific roads, see the details for the API:
http://msdn.microsoft.com/en-us/library/hh441726.aspx
Also the description of each field included in the result:
http://msdn.microsoft.com/en-us/library/hh441730.aspx
You are referring to the locationCode. Those are related to the Traffic Message Channel information where the included information are the event id, the location code, expected incident duration, affected extent and other details.
Those TMC are managed in different ways depending on the country you are interested in and specialised mapping data provider can give you access to those kind of information and that's what the subscription is about. It is also related to the way you can use the TMC depending on the concerned area to get or give information from there.
For more information about TMC:
http://en.wikipedia.org/wiki/Traffic_message_channel