- Completely rewrote code to conform to PSR-4
- Unit Tests
- Rewrote Documentation
- Lots of Optimizations
-
Added better error detection when fetching metadata for ga_validator
-
Removed a few redundant code
-
Added options for performance/verbose/minimal fetch modes
- performance: sets 'include-empty-rows' to FALSE, and simply return what was fetched. This is the default setting.
- verbose: sets 'include-empty-rows' to TRUE, which means data for all possible dimension combinations will be returned, even if all metrics are 0. This ensures structural consistency across different but may take up lots of memory.
- minimal: sets 'include-empty-rows' to FALSE, and then for each report cluster, it will trim metrics that have a value of 0. This ensures all data points in the report have a non-zero value, minimizing memory needed, but will take slightly longer to process.
- Changed all array_push() statements to a more conventional
stack[] = needle;
type
- Removed the assumption that the credential files (API key, etc) have to be within the repository for security reasons:
- now the config is loaded from the directory specified in
ga_config.php
- the secrets directories in config have to now be specified as absolute directories
- Added format checks for dateRanges
- Fixed a bug where dateRange was not being processed correctly
- Fixed Styling for easier readability
-
Added a few more checks for validator
-
Google can actually return 100000 results per call, updated accordingly
-
Added fetch_interval to the config.ini in case we make calls too frequently
-
Added code for handling cases where there are more results than the 100000 limit.
-
For the dateRange argument, added some flexibility. Now it can take in 2 types of arguments:
- an array containing associative arrays with keys
StartDate
andEndDate
- a single associative array with keys
StartDate
andEndDate
-
Added results maximum per call, Google defaults to 1000 but can theoretically be maxed at 10000.
-
Changed naming style: shortened GoogleAnalytics to GA
- Changed the GA_ReportAssembler into a utility class with static methods (which means no instantiation necessary)
-
Added a GA_API.php that further abstracts the 4 stage process away from the end user. (Can be done now in 3 lines)
-
Properly formatted comments for functions
-
Moved several settings to a config.ini for easier update in the future if Google decides to change thing