how to specify URL in filters pagePath core reporting api V3 - google-analytics-api

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

Related

Google analytics API missing data?

I am trying to access data via the analytics reportingv4 API. I am using the.net version in visual studio. I can get it to return data but just not the data I want.
I am using a specific account that only has one view attached to it. If I try to view the data I'm looking for, using the web interface, it works, by filtering it using the search box. For example, there is currently 20 page hits for today. If I try the same, using the API, no data is returned. If I remove the filter, from my code, data is returned but none of the pages that I am looking for.
Any ideas?
Thanks
I was being silly. I eventually noticed that I was supplying a date range for the year 2017! The processing which

Cakephp 3.1 REST - Filtering data

I have setup my application for REST access as per documentation. The default routes are working well. I am able to retrieve, update and delete records, however, I am not sure how I could filter data sending parameters to the controller. I wonder if I can do that using querystring or if there is a better way to accomplish that. Please can someone give me directions?
Reads about the Request object in the manual. And use the Search Plugin for filtering.
The search plugin comes with a lot of documentation that explains how to use it as well.
Your question is so generic that a proper answer would end up in a whole article - which I'm obviously not going to write, there is enough information available on HTTP requests and query params. Use Google or read these links:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Messages
https://www.w3.org/Protocols/HTTP/Request.html

drupal 8 rest api: get allowed values for list field

I am not a drupal dev, and i know next to nothing of php specifically. That said, I am developing a new interface for an existing drupal website and we will continue to use drupal in headless mode using the rest api while we migrate to a better long term solution.
Exposing custom content types be pretty straightforward for the most part, but one aspect is giving me a headache: it seems impossible to expose the list of allowed values in a list field (e.g. list of decimals, integers or text). Ideally, there would be a way to query the drupal api for a given field name, returning a list of possible values for that field.
The closest I've gotten is through the entity rest extra module found here.
but while it exposes a ton of info on the fields, even default value for the list field, the allowed values are not there.
Is there a way to expose the allowed values list in the restful api?
Since the module I found is so close to what I need, would it be easily implemented by custom patching my drupal php code? where should I look for clues?
thanks in advance

In Tableau server, how can we get measures and dimensions of a data set using REST API?

I looked at their REST API but I haven't found anything which gives me the measures and dimensions of the dataset/data source. I need to expose what measures and dimensions are there so that user knows what workbooks or visualizations he can create. Any ideas or help is greatly appreciated.
Fields in a datasource are not something that you can query directly via the REST API. My best suggestion, while not perfect, would be to add a tag for each field that you want to be queryable in the datasource, and then use the REST API to query your datasources show what is available to the user.
This shows you how to tag a datasource
Here is the specific REST API command that will return the tags
I want to stress that this isn't a perfect solution, but the REST API has a very WIP feel to it to begin with (REST should be able to do everything that tabcmd can do, but sadly, it can't).
There is also the undocumented REST API that has some additional functionality. That may have more of what you are looking for. I'm not 100% sure that this will solve your problem, but it does provide a lot of additional functionality to the base API.
Undocumented Tableau REST API

Bing search API with DisableLocationDetection not working

The Bing search API is using my (or my server's) location even when I set the appropriate option. I would like it to provide a location agnostic response.
Am I misunderstanding the documentation? Is this syntax right?
http://api.bing.net/json.aspx?Appid=<XXX>&query=microsoft&sources=news&options=DisableLocationDetection
Thanks in advance
The syntax is right. According to the doc, the DisableLocationDetection option prevents Bing from inferring location from the query itself ("microsoft" in your example), but not from the properties of the request, such as server's IP.
News requests can specify LocationOverride parameter to get news from a particular US state. Also, if you're having troubles with automatic market detection (if your server is in another country, for example), you can specify Market parameter to override the market detection.
If this still doesn't help you, can you update the question to provide an example of a query which gives you the bad result?