Skip to content

*WIP* Plugin to pull predefined google analytic data by date range and store into mysql table for later use.

Notifications You must be signed in to change notification settings

AudiologyHoldings/CakePHP-GAStats-Plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample configuration for app/config/database.php


public $gastats = array(
		'datasource' => 'Gastats.GaSource',
		'auth' => array(
			'Email' => 'myemail@gmail.com',
			'Passwd' => 'xxxxxxxx',
			),
		'ids' => 12345678, //default GA id to be used, others can be specified with custom stat_types
		'stat_types' => array( //(optional) custom stat_types can be made here.  default types exisit in gastats_raw.php
			'webstats' => array(
				'ids' => 87654321,//id of differernt profile which has filtered content to be used with the existing webstats stat_type
				),
			),
		'channels' => 'ChannelModelName/url_slug/is_active:1', //(optional if not using webchannels) model/field where webchannel urls are found in main apps database
																// optional third value is an active/enabled field with value to check
	);


////////////////////
To Get generic page view / url data
$stat_type = generic|generic-notracking|generic-notracking-noadmin
$start_date = YYYY-MM-DD
$end_date = YYYY-MM-DD
$paginate= true|false //continue to query Google if 1st result meets max-results

Gastats.GastatsRaw->getGAData($stat_type,$start_date,$end_date,$paginate)
OR
Gastats.GastatsRaw->processGAstats($start_date,$end_date) 
//calls getGAData($this->stat_type,$start_date,$end_date,true) //default stat_type set to generic-notracking-noadmin


To Get Other data:
// These will instantiate an instance of GastatsRaw
// If $refresh is set to true local data for the time frame will be purged
// and Google will be re-queried using special, pre-defined stat_types for each.
// If $refresh is omitted or set to false (default) the model will simply query the gastats_raws
// table for its data and compile/aggregate as needed.

Gastats.GastatsWebstat->processGAStats($start_date, $end_date, $refresh)
Gastats.GastatsWebchannel->processGAStats($start_date, $end_date, $refresh)
Gastats.GastatsAd->processGAStats($start_date, $end_date, $refresh)
Gastats.GastatsCountry->processGAStats($start_date, $end_date, $refresh)

About

*WIP* Plugin to pull predefined google analytic data by date range and store into mysql table for later use.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%