Can I find the most popular keyword for a particular page using the google analytics api? - google-analytics

I was hoping to to use the analytics api to find out the most popular search terms (organic) that lead to a particular page.
Is this possible?
I've trawled the documentation and found this which looks as if it outlines all possible data I can retrieve from the API and I can't see this information here.
http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDimensionsMetrics.html
If this is the case, is there any reason that the API isn't complete? I would assume if I can access the data using the analytics interface then I should be able to query for it using the API - is this assumption incorrect?

Yes, this is possible. For example, if you wanted to see what keywords led to how many entrances to index.html,
Set:
Dimensions: ga:keyword
Metrics: ga:entrances
Segment: gaid::-5
Filters: ga:landingPagePath==/index.html
Sort: -ga:entrances
(Segment gaid::-5 segments the data to only include visits referred from Organic Search; sorting by -ga:entrances will order the number of visits in descending order).
Try it out here: http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html?dimensions=ga%253Akeyword&metrics=ga%253Aentrances&segment=gaid%253A%253A-5&filters=ga%253AlandingPagePath%253D%253D%252Findex.html&sort=-ga%253Aentrances&start-date=2010-09-23&end-date=2010-10-07&max-results=50

Related

Mixable metrics and dimensions in google analytics

I'm doing some complex reports for google analytics and would like to ask you if the following is possible. The client wants to have just organic data for a bunch of metrics. Like pageviews, visitBounceRoutes, etc. The query I ended up with is the following:
https://www.googleapis.com/analytics/v3/data/ga?dimensions=ga:source,ga:medium,ga:keyword,ga:day,ga:month,ga:year&end-date=2013-11-20&fields=columnHeaders/name,rows,totalResults,totalsForAllResults&filters=ga:medium==organic&ids=ga:79067749&metrics=ga:pageviews,ga:pageviewsPerVisit,ga:visitors,ga:avgTimeOnSite,ga:newVisits,ga:visitBounceRate&start-date=2013-10-20
However the response is as follows:
'{"totalResults":0,"columnHeaders":[{"name":"ga:source"},{"name":"ga:medium"},{"name":"ga:keyword"},{"name":"ga:day"},{"name":"ga:month"},{"name":"ga:year"},{"name":"ga:pageviews"},{"name":"ga:pageviewsPerVisit"},{"name":"ga:visitors"},{"name":"ga:avgTimeOnSite"},{"name":"ga:newVisits"},{"name":"ga:visitBounceRate"}],"totalsForAllResults":{"ga:pageviews":"0","ga:pageviewsPerVisit":"0.0","ga:visitors":"0","ga:avgTimeOnSite":"0.0","ga:newVisits":"0","ga:visitBounceRate":"0.0"}}'
Can the dimensions ga:source,ga:medium,ga:keyword be mixed with the above metrics? It seems they can't since if I omit them the API returns an array of values 1 per each day within the specified range.
Where can I find more information about this and what categories are mixable? https://developers.google.com/analytics/devguides/reporting/core/dimsmets just shows all the available metrics but do not explains how they are combined and which one would be valid requests. I'm new at the analytics API and would be great any kind of help or guidance
Thanks a lot
Google Analytics Query Explorer is your friend for playing around with analytics dimensions/metrics/filters ;-)
Try http://ga-dev-tools.appspot.com/explorer/?dimensions=ga:source,ga:medium,ga:keyword,ga:day,ga:month,ga:year&metrics=ga:pageviews,ga:pageviewsPerVisit,ga:visitors,ga:avgTimeOnSite,ga:newVisits,ga:visitBounceRate&filters=ga:medium%253D%253Dorganic&start-date=2013-10-20&end-date=2013-11-20&max-results=100
Some thoughts:
Those dimensions & metrics should work -- maybe there was no organic data recorded during that time range?
Try removing the ga:medium==organic filter and see what your data looks like.
Does the profile you're using (ga:79067749) have any filters on it? If so, maybe try a different profile that has unfiltered data. (Analytics best practices -- make sure you have a profile with no filters applied that captures all data.)
As Mike said, there is no problem with the combination of metrics and dimensions you are using.
If you are entering the URL query directly in the browser problem might be the lack of URL encoding in your query string. For example, you need to convert == to %253D%253D
For example, instead of ga:medium==organic, you need ga:medium%253D%253Dorganic
If you build your query in the Google Analytics Query Explorer as Mike suggests, you can grab the direct link to your report by clicking the link symbol in the upper left:

is there an API out there to access google page rank for a predefined set of keywords?

I am building an internal reporting tool that I want to update with Googles pagerank once per week.
The list of keywords would be predefined at this point.
any ideas?
They do have an Adwords API that may get you closer to what you are looking to do.
API - http://code.google.com/apis/adwords/docs/
Specifically the TrafficEstimatorService allows you to specify keyword parameters and estimate what traffic you could receive.

How I can get places with specific types using Google Places API?

I need all locations of type cafe, gas_station, and restaurant using Google Places Api. Here is my query via the API:
https://maps.googleapis.com/maps/api/place/search/json?location=41.104805,29.024291&radius=50000&sensor=true&key=AIzaSyAVH0qHD6BPxRlnck3rIqcxC5TTwOTyfds&types=gas_station||shopping_mall
This returns mosque location types only. I'm not getting shopping_mall, gas_station, or restaurant types. here i am checking type in google place api
How can i get all these types?
Unfortunately, Google Places API does not appear to have anything under those categories in that area.
Use types=establishment to get a more complete list of businesses etc. in that area.
Unfortunately, you will have to find some other way to determine what is a gas station, etc. Google Places API does not appear to have that data, at least at this time.
It may be possible to contribute that data yourself.
Since the answer above was posted, Google has added support for additional location types.
https://developers.google.com/places/documentation/supported_types
It was suggested in other SO thread, that you use 'keyword' instead of 'types' in your query to Google. Related SO thread:
How can I search places with specific types using Google Places API?

Can Google Analytics do a user's who looked at x also looked at y?

Just wondering if this this possible? I realise you could never use it to display recommendations on a page but it would be useful from an analytics point of view to see for example what other products user's who've looked at product x have also looked at.
You can use Advanced Segmentation to do this.
Advanced Segments slice Google Analytics data on the basis of sessions. Sessions are a collection of pageviews that correspond to the popular notion of a visit.
If you create an Advanced Segment for users who visited /product/x/, it will return data from all the sessions in which that page was viewed. (Similarly, you could create a segment for /product/x AND /product/y. From there, you could filter it to only include your product pages, and exclude the original products themselves.) As a result, this session-based querying is perfect for your use case.
So, yes, you could use Google Analytics API data to inform a simple recommendations engine. The only caveat I'd give is that the Google Analytics API is a little slow, so you'd want to cache the data locally in your app, rather than querying it directly on every pageload.

Generating links for Google Analytics and Omniture

I am trying to build URLs for Google Analytics and Omniture.
GA is simple enough, and those URLs can be built using http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55578
Campaign Source: * (referrer: google, citysearch, newsletter4)
Campaign Medium: * (marketing medium: cpc, banner, email)
Campaign Term: (identify the paid keywords)
Campaign Content: (use to differentiate ads)
Campaign Name*:
Does anyone know how Omniture links are constructed? Do they support this kind of URL?
Omniture does not grab predefined var=value params from a URL like GA.
What you can do though is use omniture's s.getQueryParam() plugin to grab the same parameters generated by that GA tool, and put them in s.prop and/or s.eVar variables.
The basic Omniture campaign tracking is based on the s.campaign parameter, which can be then re-defined (classified) using the SAINT tool. The "cid" (default) URL parameter only takes one value, by default a running number, which is then classified with SAINT. Fetching the value can be done with a plug-in, such as getQueryParam(), which is recommended.
I don't recommend using prop or eVar variables too much on this, since without DataWarehouse or Discover you can't really use several of them in a segment (max. 2) and this makes using 5 parameters quite useless.
The SAINT tool together with the campaign parameter is quite powerful and should be enough for basic needs.

Resources