URL Shortener API Stats - google-analytics

Thru Google API I am creating programatically short URLs. This works fine. On my API console I can see the stats showing, for example, the number of requests as "urlshortener.url.insert" several dozens since I started using this API last Friday.
Now I would like to know how many clicks were done on those URLs. When going to goo.gl I can see a bunch of URLs I manually created but none of the URLs created thru the API. Is there a way to do this ? Or can it be seen in Analytics ?

Yes, you can get the URL's stats. You need to add &projection=FULL to your GET request to the API. See this page for details.

Related

How can I create a tracking JavaScript code like google analytics based on Javascript?

all I am trying to create Google Analytic clone. I know how to get information about the browser location IP and other similar things in PHP
What I want to know is how to create a java-script which sends this information from any website where my code is placed on my server ???
What is the minimum security requirement to create a tracking JavaScript code like google analytics?
redirect users to different pages based on session data in PHP?
Or in other words, do I have to send an ajax request to my server?
Is there any available solution already available subject to java-script?
Most analytics tools generate a url with query string parameters attached to it and then output a 1x1 image pixel, with the img src as the url. Your server would then receive and store the data. The only thing returned is the actual 1x1 pixel. This is the common method because in the event a site does not have js enabled, you wrap a hardcoded img to your server in noscript tags and still get basic info like page view.
But is there a reason why you are wanting to build your own analytics script instead of use an existing one? There are a number of 3rd party ones available, including free ones. Alternatively there is Piwik, which is a free and open source solution if you want to build off it and not have to start from scratch.

Is there a way to track/record via Google Analytics visitors that visit my site via Flipboard?

I've been sniffing through my Apache log files and noticed hits which mention
FlipboardProxy/1.1; +http://flipboard.com/browserproxy
Is there a way to track/ID these users via Google Analytics so that I can understand what percentage of my visits are via Flipboard?
From what i read on flipboard:
Flipboard uses a proxy service to fetch, validate, and prepare certain
elements of websites for presentation through the Flipboard
Application.
Retrieving parts of your website to present it in flipboar, they are not actually real visits to your site.
But if you still want to track those requests in analytics then you would need to write a php that sniffs user agent and trigger a gif request to analytics.
IF they're not showing up in the Browser & OS Report; they're probably not running javascript and/or block GA.
Something along those lines might end up here. Right now it shows data at a snapshot only though.
http://ripl.io/flipboard-analytics/

Is it possible to send data to Google Analytics service by url?

I've been trying to send data to Google Analytics through url, but it's not working.
Here is the url:
http://www.google-analytics.com/__utm.gif?utmac=MY-UA
&utmn=0.57942900+13058623924dd5e0f88d784
&utmp=%2Fmypage.html
&utmr=http%3A%2F%2Fpp.test%2Fmypage-ref.html
&utmdt=test+ga&utmul=en-us
&utmhn=pp.test
&utmcc=__utmz%3D1.1304060743.1.1.utmcsr%3D%28direct%29%7Cutmccn%3D%28direct%29%7Cutmcmd%3D%28none%29%3B+__utma%3D1.100229728.1304060743.1304060743.1304060743.1%3B+__utmz%3D185677488.1304391672.1.1.utmcsr%3D%28direct%29%7Cutmccn%3D%28direct%29%7Cutmcmd%3D%28none%29%3B+__utma%3D185677488.2126025763.1304391672.1304667350.1305106191.6%3B+PHPSESSID%3Dpghin7v4q3g5lssq5c5mjchfj6
&utmcn=1
&utmcr=1
&utmwv=1
&utmsr=1280x1024
&utmsc=32-bit
&utmcs=-
&utmje=0
I have been trying follow the parameter here http://code.google.com/apis/analytics/docs/concepts/gaConceptsOverview.html
I call the url by curl and tested through the address bar, but not working, no data in my Google Analytics :(
Any ideas please?
It's possible, although if you're trying to do it you're probably doing something wrong.
But there's more to it than you can see at first sight. The best way to achieve it is to use a mobile library for Google Analytics. Google already provides this for a couple of languages. These libraries are built to send data to Google Analytics via your server. And if you check the server code you'll see that there are some calculations involved. You can possibly change one of these libraries to be run without a request. They're not complicated.
http://code.google.com/mobile/analytics/docs/web/

How to track RSS feed useage / views?

What's the best way to track how many times items in your RSS have been accessed?
Assuming your RSS is served from a webserver, the server logs would be the obvious place to gather statistics from. There are numerous packages for parsing and interpreting webserver logs.
AWStats is a popular (free) package, and Wikipedia keeps a fairly comprehensive list.
If you serve your feeds through something like FeedBurner then you can also get stats from there including clicks
You could use Google Analytics, but you would need a service to make the correct requests to the Google Analytics API or redirect to it. There are two APIs you can use:
the __utm.gif "API"
the Measurement Protocol API
To use the later (you need Universal Analytics), which is way better in my opinion, you would need to make a request or redirect to something like:
http://www.google-analytics.com/collect?z=<randomnumber>&t=pageview&dh=<domainname>&cid=<unique-client-uuid>&tid=<propertyid>&v=1dp=<path>
Where:
<randomnumber> is a random number to avoid caches (especially if you do redirects)
<domainname> is the domain name you see in your tracking code
<propertyid> is the property id you see in your tracking code (eg: UA-123456)
<path> is the path to the page you want to register the pageview for. Note that it must be quoted. Eg, for /path/to/page you would need to send %2Fpath%2Fto%2Fpage
I've implemented a simple redirector service that does exactly that here (explained at length here)
If you're stuck with the Classic Analytics then you would need to use nojsstats or the older implementation

Google Analytics - Goal Funnel Steps

Is there a way to test the url you're entering in a step, to see if Google Analytics will recognize it?
What I'd like to do is provide some web page or some web service with a URL, and get a pass or fail. It passes if Google Analytics recognizes a page hit to the url.
Let me give some context.
We've been having issues with our goal funnel steps in Google Analytics. The instructions on adding steps say not to use the domain.
e.g.
DO NOT use : http://www.mysite.com/step1.html
INSTEAD use: /step1.html
Our custom CRM uses friendly urls and as a result GA is having a hard time picking up on them. So we've experimented with changing around url we've placed in the step, however we've got to wait a day to see if the new url we've provided is going to work! Hence why we're looking for something quicker.
OK- so what you're doing is futzing around with the friendly URLs to see what's being tracked (so you can distinguish one URL from another), but you don't want to have to wait?
There are a few Firefox plugins which report on on-page GA (WASP & Observepoint), but the Firebug Net panel is as good as anything.
The other option is to pass a 'virtual URL' to GA in the _trackPageview, rather than depend on the friendly URL - maybe something like this
_trackPageview("/goal1/step1")
although I'd attempt to have the virtual URL (it's really just the path) named more like the actual steps in the process.
What I'd like to do is provide some web page or some web service with a URL, and get a pass or fail. It passes if Google Analytics recognizes a page hit to the url.
This would be a waste of time for someone to make, so you won't find it; it's a waste of time to make it because all that anyone needs to do to see if the page is being tracked by google analytics or not is to look at their 'content -> top content' report to see if the page is listed or not.
One can also go to the page with Firefox, and using the Firebug addon on can see if a call for the _utf.gif image is made, or not, and confirm that the ga account id's are correct, which would mean that GA is receiving the data, but this does not tell you if the data is making it past your ga profile filters. The only way to determine that the page is tracked and that the tracked page view is available in your profile is to check your content reports.

Resources