Live Analytics User data in CMS or Framework - php

I'm trying to use analytics to determine content being served to visitors from a CMS. As far as I can tell there is no API for Google Analytics that allows you to retrieve a users browsing history.
I understand you can store this into the users session, or roll your own logging of user visits, but I'm more interested in analytics platforms that offer and interface to access this data.
Is anyone aware of an analytics platform that allows you to programmatically retrieve the users data?
The other important aspect would be whether the user data can still be retrieved even if the storing of that data is done asynchronously - which would be needed to keep web app responsive.

In analytics platform you have several solutions. The most common in open source is Piwik http://piwik.org/
It offers an API and js tracking systems : http://piwik.org/docs/javascript-tracking/

You can set this up indirectly in Google Analytics, by using funnels and goals. Set a few predetermined paths of website pages, and have the visitors walking these paths reach a goal.

Have a look at http://www.openwebanalytics.com/. A might be a little bit of overkill for your situation, but if you need a customized need, it should be the right fit. If you're a developer or have access to one then you're set.

Related

Custom display of posts of Facebook, Twitter, Linkedi and Google+ on your website

Is it possible to shows posts, feeds etc in a customized manner on your website? For example if I don't want to use the plugins they provide to embed on your website which show posts in a rectangular box I want to show posts from these social media sites in different manner. For reference please visit this website and scroll down to section below Latest News and Testimonials you will find Facebook, Twitter, LinkedIn and Google+ with Lorem Ipsum text. It seems like this website has also not implemented this feature (don't know if its possible with all social sites) but I am asking if you need to implement something like this is this possible? I have to implement it on a PHP website, if that helps. Thanks for your help in advance.
Although you're asking for something different than embedding, I still believe what you're looking for is "Embedding posts". Most social sites do not want you to rebuild their stream experience and put it somewhere else -- additionally, most content policies on these sites prohibits you from caching or storing posts because it can easily become a privacy issue. Finally, if you're pulling a lot of posts, frequently, from these services, you will encounter API call limits.
The following resources should get you started with properly embedding posts so you don't have to worry about how you're caching:
Google+
Facebook
Twitter
If you (really, really) wanted to build out your own solution you should do it client-side in JavaScript, not in PHP. For this, you would need to use the following APIs:
Google+ uses the Activity API
Facebook has the Graph/Feed API
Twitter has the Search/Get Tweets API pass from%3A[username] to get specific user Tweets
If you were to try doing this in PHP, it would be easier using client libraries and starting from sample code.
Google+ PHP example
Facebook PHP client library
Twitter PHP client libraries
Make sure that you're following the content policies of the various sites you're aggregating. In other words, if you're doing something like caching the results in a MySQL database pulled using your PHP script, invalidate the cache every 3600 seconds and every time a post is no longer retrieved from your API calls.

user's last login date and time facebook graph explorer

I have search a lot on this site and google to get the last login date and time of a particular facebook user from user id using the graph explorer. However, could not find a relevant article.
I have 20+ employees working in my office and I do not want them to access facebook during shift timings. I have their user ids with me. Is it possible to check when did they last login/logout or performed any activity on facebook using their FB UIDs using a php/mysql or any other way or just by using the graph explorer?
I read some articles that had fql options but i could not try those as fql is depreciated. Any help here would be appreciated.
Thanks
Did you meant to use a Graph or Graphic ?
Using a table to log-in when your users accessed Facebook will be simpler.
You'll have to apply a filter to remove results outside the shift timings.
Once you are done with it, creating a bar graphic will be an easy solution.
If you want to use the Graph API, you need to make sure that your employees log-on onto your application and give their consent.
You should check : https://developers.facebook.com/policy before trying anything.
Only use our SDKs to develop and distribute apps for use with the
Facebook Platform. You may also distribute any code libraries or
sample source code included in the SDKs for inclusion in such apps.
Use simple network functions like logs to collect data.
Enabling a Firewall is better than making Facebook accessible in those shift hours.
If you meant Graph API, it's a social graph explorer. It's meant to show all the relations between the users. I am not sure how far it deviates from a graph, neither if it has some visualization capabilities.
Using the Graph API to monitor your workers might be a grave legal infringement. There are many laws protecting privacy at work. The Graph API can give all kind of information. I would not suggest to use any kind of solution that gives access to some sensitive data...
Logging all the Connections going to FB would be the only choice.

Three Google Analytics Codes on One Site?

I was wondering if it was possible to have two or more sets of Google Analytics tracking codes on one page. There's going to be a single webpage that is accessible through either normal methods (desktop or mobile browser), or accessed through scanning the QR code on the product packaging and being redirected that way.
The client wants three things tracked:
Analytics for the full page (all methods of connection)
Analytics for just those connected via normal methods
Analytics for those connected via QR code
I have already developed a means of differentiating the connection method, and switching the Google provided Javascript for 2 and 3.
So is this possible, to have two analytics codes on one page? I have checked all over, can't find an answer that is to the point.
Thanks in advance
A single analytics will report browser and OS used and the origin of traffic. Hence, there's no reason to use three cookies, three JS files when you can just generate a personalized report with the data you need
Don't use different trackers for this, use custom variables. Splitting it up loses you valuable insight into how different use cases navigate the site.
If anyone is ever looking for this:
http://www.publicinsite.com/qr-codes-google-analytics-track-mobile-devices/
That;s the best bet I think

Activating google analytics using curl?

I need to execute a google analytics script on a site using curl. What are the reporting features that will be available to me for that curl request ?
To make my question more clearer, suppose i have a website www.abc.com which has analytics code on it and if i connect to www.abc.com from www.xyz.com using curl, in the analytics report of www.abc.com will the request i made using curl show ?
What are the parameters that wont show ? since there is no navigator there wouldnt be screen resolutions, color depth, or any other javascript based features. any other reporting features that wouldn't be available to me ?
I need the following to show up :
user agent (which i will be sending by setting header)
referrer (again which i will be sending by setting header)
source ip address and location (using proxies for different countries)
one issue that Im unsure of is Google's cookies and whether (since i might also be using proxies) these need to be cleared. The ultimate outcome is that I need to be able emulate site traffic as if it is coming from a variety of visitors....
IF the entire thing is not technically possible,is there any other way i can simulate diverse traffic into my google analytics account ?
So, the other answers are right: CURL doesn't execute JS, and there are some methods of automated requests that do.
Other methods to simulate diverse traffic to your account include:
Visit the site manually, and grab the __utm.gif request that Google Analytics generates, and manipulate its pieces so that you can CURL it in conjunction with curling the actual site, so that the GA pageviews are recorded. (ie, alter the hostname, pageview name, timestamp, etc.) You can find the meaning of the values of those parameters here.
Implement a server side GA on your target site.
Use a headless web engine to programmatically crawl sites. PhantomJS is a particularly user-friendly option.
Use a browser screenshot service like BrowserShots to get traffic from distributed locations to visit your site.
Use Amazon's Mechanical Turk to get people to visit the site. You could pay $0.01 per click, and get a large amount of diverse traffic from a large number of sources. (To verify, give them an arbitrary, simple task like asking them "What's the headline on this website?")
You can send events directly to Google Analytics using the Measurement Protocol, creating GET or POST requests directly with the tool of your choice.
See reference here:
https://developers.google.com/analytics/devguides/collection/protocol/v1/reference
No, because Google Analytics is based on Javascript and curl doesn't process HTML or Javascript.
Instead of curl, use a command-line tool that does JavaScript, like HTTPUnit (which includes Rhino). I have heard about WATIR too but never tried.
Those happen to be testing tools, but I guess you can use them to trigger Google Analytics too.

google analytics api in php website

I am creating a custom reporting website, where I want to show live data from google analytics and accordingly the data in my website will change. I want it to be automated and dynamic, like whenever the data changes in GA, i want it to be automatically changed in our website, which will be shown to our clients to show the performance of our websites.
I am guessing this can be achieved by some api calling from php, xml returned values and showing those data on our website along with images.
i would appreciate if anyone could give me more info on how to start working on this.
Google Analytics has an official API. They don't seem to have ready-made PHP examples, but the XML sources should be easy to query. Not sure how "live" GA's data is, though - it could be that it is not possible to do stuff live tracking of visitors.

Categories