Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Picking the Brains of Your Customers with Microsoft’s Text Analytics
Oct 14, 2016 @ 12:19:21

In the latest tutorial posted to the SitePoint PHP blog author Wern Ancheta shows you how to integrate your application with the Microsoft Text Analytics API, a service offered by the company putting machine learning to work on things like keyword extraction, topic detection and language detection.

With the explosion of machine learning services in recent years, it has become easier than ever for developers to create “smart apps”. In this article, I’ll introduce you to Microsoft’s offering for providing machine-learning capabilities to apps. Specifically, you’ll learn about the Text Analytics API and build an app to enhance the understanding of online sellers when it comes to their customers.

The tutorial then introduces the Microsoft Cognitive Services API and, more specifically, the Text Analytics API that they'll be hooking the application in to. They walk you through getting an API key for the service, creating an "account" for the application you're working with and deploying it for immediate use. They introduce the functionality of the API with a few "play" examples of each API offered before getting into the creation of their sample application - a tool that reviews the contents of customer feedback, looking for key phrases and returns highlighted versions with what it sees as important.

tagged: customer tutorial text analytics microsoft machinelearning highlight feedback application slim3

Link: https://www.sitepoint.com/picking-the-brains-of-your-customers-with-microsofts-text-analytics/

SitePoint PHP Blog:
Using the Google Analytics API with PHP: Logging In
Oct 02, 2014 @ 09:47:08

The SitePoint PHP blog has a new tutorial posted from Younes Rafie showing you how to use the Google Analytics API from PHP (part one of a series) using the Google PHP API client library to make the connection.

In this series, we’re going to see how we can use the Google Analytics API to interact with our Google Analytics data via PHP. [...] In this article we’re going to build an app that looks like Google Analytics Explorer, but to make it short, we’re going to limit the functionality and discuss how we can extend our demo.

He starts with an overview of the different parts of the Google Analytics APIs including the metadata and real-time reporting systems. In the tutorial he'll be combining several of these to provide all the data needed. After walking you through the creation of a Google developer account, he starts in on the code. With credentials in hand and the library installed via Composer, he shows how to make the connection, check if it's logged in and makes a simple "home" controller that handles the login and OAuth validation process.

tagged: google analytics api login oauth composer tutorial library

Link: http://www.sitepoint.com/using-google-analytics-api-php-logging/

Sherif Ramadan:
Web Analytics with PHP and Google Visualization: Made Simple
Dec 19, 2012 @ 12:38:47

in this new post to his site Sherif Ramadan shares a method for visualizing your website's visitor data with the help of the Google Visualization APIs and some geolocation.

The web is a place where everyone is in your backyard. This can be both a blessing and a curse. How do you know where your website traffic is coming from and how much of it there is? [...] How was traffic led to your website in the first place and why? How long do people stick around and what do they like the most about your site? These are all some of the many questions you can answer with web analytic software, but the real question is why would you want to answer these questions at all and what’s the best way to look at the answer?

[...] If we look at a heat map it’s easier to spot where the majority of our visitors and traffic are coming from, geographically. It also helps us understand that people visiting a virtual space can, and will, be physically located in different parts of the world.

He includes the steps to recreate a map like the one included in this page showing the current view statistics on his site. He uses a MySQL backend to store the GeoIP data and parses out the Apache "access_log" to get the IPs of the visiting users. He then runs these against the GeoIP data and passes this country data on to Google's visualization for handling. He also recommends using the tools offered by the Google Webmaster Tools to further enhance your introspection into your site's visitors.

tagged: google analytics geolocation analytics visualization country

Link:

Sherif Ramadan:
Web Analytics with PHP and Google Visualization: Made Simple
Dec 19, 2012 @ 12:38:47

in this new post to his site Sherif Ramadan shares a method for visualizing your website's visitor data with the help of the Google Visualization APIs and some geolocation.

The web is a place where everyone is in your backyard. This can be both a blessing and a curse. How do you know where your website traffic is coming from and how much of it there is? [...] How was traffic led to your website in the first place and why? How long do people stick around and what do they like the most about your site? These are all some of the many questions you can answer with web analytic software, but the real question is why would you want to answer these questions at all and what’s the best way to look at the answer?

[...] If we look at a heat map it’s easier to spot where the majority of our visitors and traffic are coming from, geographically. It also helps us understand that people visiting a virtual space can, and will, be physically located in different parts of the world.

He includes the steps to recreate a map like the one included in this page showing the current view statistics on his site. He uses a MySQL backend to store the GeoIP data and parses out the Apache "access_log" to get the IPs of the visiting users. He then runs these against the GeoIP data and passes this country data on to Google's visualization for handling. He also recommends using the tools offered by the Google Webmaster Tools to further enhance your introspection into your site's visitors.

tagged: google analytics geolocation analytics visualization country

Link:

Project:
Zend Framework Google Analytics Code Generation
Aug 24, 2011 @ 09:46:58

Martin Aarhof has put together an handy tool for Zend Framework applications that creates the async javascript analytic code recommended by Google to provide tracking information back to Analytics.

It supports: browser Settings Detection, campaign Duration, campaign Fields (custom), cross-domain linking and last but not least Ecommerce tracking.

The configuration lets you set the various keys for your Analytics accounts, the domain name for it to live under, browser detection settings and various other settings for campaign configuration and domain setup. You can find the full code on his github account ready to download or clone.

tagged: project code generation google analytics javascript campaign domain configuration

Link:

Project:
Google2Piwik - From Google Analytics to Piwik (Open Source Analytics)
Feb 09, 2011 @ 09:15:09

Dominik Jendroszczyk passed along a tip about a tool that's been released to help make transitioning from the proprietary Google Analytics systems over to the Piwik open source analytics option simple - Google2Piwik.

More and more users are turning away from Google Analytics (GA) as a provider of web measurement solutions on security, independence and functionality grounds. One problem they run into is that after years of using Google’s product they have a considerable inventory of data about their websites stuck with GA, which makes starting over with an alternative provider something of a hassle. [...] Effectively, thanks to Google2Piwik, nothing is stopping you from moving away from Google Analytics to a safer, more robust and more functional alternative.

The tool is written in Python, so you'll need to have that and both access to the Google API and have a Piwik install set up (it's PHP/MySQL based) to make the translation. There's a few limitations to the import, though, so be sure to check out the tool's project page for those. Piwik is an open source project that provides real-time web analytics that installs on your own server and gathers data via a Javascript tag embedded in your site.

tagged: analytics google piwik opensource python tool

Link:

Lorna Mitchell's Blog:
Retrieving Data from Google Analytics API using PHP
Dec 09, 2010 @ 13:40:32

Lorna Mitchell has a new post to her blog continuing her look at using the Google Analytics API. This time the focus is on pulling data out of the API (if you're looking for connection advice, see her previous post).

Recently I started playing with the google analytics API, looking at ways to bring analytics onto dashboards and generate simple reports from the data in there. Very shortly after I started to look at the API, I had working data retrieval, so I thought I'd share my experiences (and code!).

She mentions the data reference document you can use to find the methods to call for specifically what you want as well as a snippet of sample code to connect and pull data based on a set of "query data".

tagged: google analytics api tutorial retrieve

Link:

Lorna Mitchell's Blog:
Google Analytics Accounts API
Nov 23, 2010 @ 10:56:35

In this new post to her blog Lorna Mitchell looks at some of the work she's done to extract information out of the Google Analytics accounts API via an OAuth interface and parsed via SimpleXML.

I'm using pecl_oauth to authenticate users against their google accounts (see my post about using OAuth from PHP), but even after I have a valid google user, working out which analytics accounts they have access to and how to refer to them is a puzzle in itself, so I thought I'd share what I learned.

In her example she shows how to fetch the permissions for a user (which analytics they can access) via a call to the "/feeds/datasources/ga/accounts" URL. This returns some XML easily parsed by SimpleXML to grab the accounts' names and IDs. This is used to fetch the profiles and gather the "magic tableId" for use with the Export API to pull the actual data.

tagged: google analytics account api oauth tutorial simplexml

Link:

Richard Thomas' Blog:
Solar Framework Shorts - Future release looks promising
Jul 20, 2010 @ 08:35:02

Richard Thomas has a quick new (Solar Framework) post to his blog about some of the upcoming cool features of the framework.

A lot of cool features are being hatched in branches that should hit trunk in the near future! [...] Things to look forward to are view helpers for various services like Google Analytics and the various CDN loaders although this is still under review and might be a few releases away.

Other new features he mentions include a reworked authentication stack that will allow for more than one auth adapter to be used at one time (his example is a normal login and a Facebook login). To help, an auth module for Facebook will also be included to make this even easier.

tagged: solar framework authentication google analytics

Link:

Sameer Borate's Blog:
Reading Google Analytics data from PHP
Feb 03, 2010 @ 11:06:08

In a new post to his blog today Sameer Borate has a tutorial about linking your application to the Google Analytics backend and using the requestReportData method to pull back interesting statistics on your sites.

Although no standard library is available from Google for PHP, some small and easy interfaces are available out there. In this post we will see how to access Google Analytics data using PHP using the GAPI library.

The GAPI library is an open sourced project that provides a direct, easy to use interface you can use to connect directly to the Analytics service without having to handle all of the manual stuff yourself. Sameer shows how to get information from the service like the top ten sources and visit counts, regional information and how to do some filtering on the results returned.

tagged: google analytics interface gapi

Link: