Skip to content

Library that uses Pthreads in a CodeIgniter project that performs a great amount of queries to a Google Analytics (GA) account in a short time.

License

Notifications You must be signed in to change notification settings

Armfoot/google_analytics_pthreads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Analytics Pthreads

This is essentially a mini-library that uses Pthreads (PHP threads) in a CodeIgniter project that is able to perform a great amount of queries into a Google Analytics (GA) account in a short time.

The amount of queries performed should be within the acceptable Google's "General Quota Limits" in order to avoid an overload of requests to the respective Google account (which may lead to subsequent requests refusals).

Getting Started

The libraries\GA_thread.php file is responsible for:

  • initiating a Google_AnalyticsService;
  • limiting the GA queries to certain 'filters' and 'dimensions' (query definition) through an array sent to Google;
  • returning the results with the data obtained from Google.

The config\googleanalytics.php file contains the details that allow access to the Google account.

controllers\GA_query.php contains the methods that invoke the GA_thread with a date interval and an ID to be used as a filter in the queries' labels. For simplicity the generated reports were directly configured in this file.

Prerequisites and Usage

  1. Pthreads' extension installed and active in a WAMP/LAMP/MAMP environment running on a local computer (a web server environment is not recommended since the execution may take several minutes, leading to any website being hosted in the server to be inaccessible during that time);
  2. Access the desired public method of controllers\GA_query.php in a web browser to execute the queries, e.g.: http://mydomain.mine/GA_query/ga_date_report/3;
  3. Upon completion, a log shows up on the web page and the CSV file is generated containing the queries results.

About

Library that uses Pthreads in a CodeIgniter project that performs a great amount of queries to a Google Analytics (GA) account in a short time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages