Google Analytics Embed Api - Compare To Past - date

I can't see a way in the embed api to implement a chart comparison between two date ranges. There doesn't seem to be anything in the options object to achieve this.
I've found two posts:
Comparing Date Ranges in Google Analytics API
Which suggests querying the first date range, then the second. I'm assuming the idea is to superimpose one ato the other, but am not sure how to achieve this.
Using Google Analytics APIs to create charts comparing data across date ranges
This one suggests OP found a solution with the same approach, but no tips on how to implement it. If anyone can point me at existing sample code, I'd be grateful.

You can do it with Embed API Third Party Visualizations:
You can recreate the demo from documentation: https://ga-dev-tools.appspot.com/embed-api/third-party-visualizations/

Related

Difference in data between Google Analytics 4 API and UI

I'm automating the data collection from a Google Analytics 4 property.
However, whenever i'm trying to match the API data with the property data I get slight differences.
For example, when I get these fields (see image below) for february and march. The total sessions from the API data is: 188.213, while the Google Analytics UI shows 189.042.
When I make the API query, really simple, by just pulling the sessions between february and march then I get the 189.042 totally perfect. Why do I get a difference when I add some dimensions?
I hope somebody can explain. Business users need to trust the data, so it must match in my opinion. Thanks for answering in advance!

How to extract view meta data from tableau

I need to extract metadata from view. When I was reading tableau rest API documentation there is no ways mention in the rest api for sheet metadata and also not mention measure and dimension API extraction. If anyone knows the way how to extract data please help me
Take a look at the Tableau Javascript API...specifically the getData method.
The Rest API is used for automating Tableau Server tasks (add users, create schedules, set permissions, etc).
You can embed a hidden extension into your dashboard that can access worksheet, field and filter information. See the docs on extensions here.
Here is a good example of one that could get you started on pulling the worksheet and field information.
Use the Tableau Metadata API - https://help.tableau.com/current/api/metadata_api/en-us/index.html
You can find sample scripts here - https://github.com/tableau/metadata-api-samples

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

async autocomplete service

Call me crazy, but I'm looking for a service that will deliver autocomplete functionality similar to Google, Twitter, etc. After searching around for 20 min I thought to ask the geniuses here. Ideas?
I don't mind paying, but it would great if free.. Also is there a top notch NLP service that I can submit strings to and get back states, cities, currencies, company names, establishments, etc. Basically I need to take unstructured data (generic search string) and pull out key information with relevant meta-data.
Big challenge, I know.
Sharing solutions I found after further research.
https://github.com/haochi/jquery.googleSuggest
http://shreyaschand.com/blog/2013/01/03/google-autocomplete-api/
If you dont want to implement it yourself, you can use this service called 'Autocomplete as a Service' which is specifically written for these purposes. You can access it here - www.aaas.io.
you can add metadata with each record and it returns metadata along with the matching results. Do check out demo put up on the home page. It has got a very simple API specifically written for autocomplete search
It does support large datasets and you can apply filters as well while searching.
Its usage is simple - Add your data and use the API URL as autocomplete data source.
Disclaimer: I am founder of it. I will be happy to provide this service to you.

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